From cef699749f3789add5ecaf0a2f73a659cae1c7ae Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Sat, 22 Jan 2022 11:31:37 +0000 Subject: media: mc: Set bus_info in media_device_init() Set bus_info field based on struct device in media_device_init() and remove corresponding code from drivers. Also update media_device_init() documentation: the dev field must be now initialised before calling it. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/media/mc/mc-device.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/media/mc') diff --git a/drivers/media/mc/mc-device.c b/drivers/media/mc/mc-device.c index 094647fdb866..824d89b325a6 100644 --- a/drivers/media/mc/mc-device.c +++ b/drivers/media/mc/mc-device.c @@ -700,6 +700,10 @@ void media_device_init(struct media_device *mdev) atomic_set(&mdev->request_id, 0); + if (!*mdev->bus_info) + media_set_bus_info(mdev->bus_info, sizeof(mdev->bus_info), + mdev->dev); + dev_dbg(mdev->dev, "Media device initialized\n"); } EXPORT_SYMBOL_GPL(media_device_init); -- cgit v1.2.3