[PATCH 09/18] media: microchip-isc: Register and unregister statistics device

Balamanikandan Gunasundar
2025-10-09T15:54:41Z

From: Balakrishnan Sambath <balakrishnan.s@microchip.com>

Register the statistics sub-device during async complete and ensure
proper cleanup for the same in isc_mc_cleanup().

Signed-off-by: Balakrishnan Sambath <balakrishnan.s@microchip.com>
Signed-off-by: Balamanikandan Gunasundar <balamanikandan.gunasundar@microchip.com>
---
drivers/media/platform/microchip/microchip-isc-base.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c
index cd379f95fc1c..5b49b6ff5ae9 100644
--- a/drivers/media/platform/microchip/microchip-isc-base.c
+++ b/drivers/media/platform/microchip/microchip-isc-base.c
@@ -1912,6 +1912,13 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)
goto isc_async_complete_err;
}

+ /* Register statistics device */
+ ret = isc_stats_register(isc);
+ if (ret) {
+ dev_err(isc->dev, "Failed to register stats device: %d\n", ret);
+ goto isc_async_complete_unregister_device;
+ }
+
ret = isc_scaler_link(isc);
if (ret < 0)
goto isc_async_complete_unregister_device;
@@ -2036,6 +2043,7 @@ void isc_mc_cleanup(struct isc_device *isc)
{
media_entity_cleanup(&isc->video_dev.entity);
media_device_cleanup(&isc->mdev);
+ isc_stats_unregister(isc);
}
EXPORT_SYMBOL_GPL(isc_mc_cleanup);

--
2.34.1