media: mtk-jpeg: Set platform driver data earlier
authorChen-Yu Tsai <wenst@chromium.org>
Mon, 10 Jul 2023 06:51:36 +0000 (08:51 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 28 Jul 2023 08:19:11 +0000 (10:19 +0200)
commit8329d0c7355bfb7237baf09ec979c3e8144d2781
treed778076452b567ccde41646c8b63645674639c44
parent0cb1d9c845110ce638a43a1417c7df5968d1daa3
media: mtk-jpeg: Set platform driver data earlier

In the multi-core JPEG encoder/decoder setup, the driver for the
individual cores references the parent device's platform driver data.
However, in the parent driver, this is only set at the end of the probe
function, way later than devm_of_platform_populate(), which triggers
the probe of the cores. This causes a kernel splat in the sub-device
probe function.

Move platform_set_drvdata() to before devm_of_platform_populate() to
fix this.

Fixes: 934e8bccac95 ("mtk-jpegenc: support jpegenc multi-hardware")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c