This commit condition the removal of the video driver to the existence
of the VIDEO_REMOVE kconfig parameter on the model of what has been done
on commit b8d3a6c7d12f ("drivers: video: tidss: tidss_drv: Use kconfig
VIDEO_REMOVE to remove video") for TI DSS driver.

Signed-off-by: Thomas Bonnefille <[email protected]>
---
 drivers/video/mxsfb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index e72839cead4..f30818d90c7 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -375,9 +375,11 @@ static int mxs_video_bind(struct udevice *dev)
 
 static int mxs_video_remove(struct udevice *dev)
 {
-       struct video_uc_plat *plat = dev_get_uclass_plat(dev);
+       if (CONFIG_IS_ENABLED(VIDEO_REMOVE)) {
+               struct video_uc_plat *plat = dev_get_uclass_plat(dev);
 
-       mxs_remove_common(plat->base);
+               mxs_remove_common(plat->base);
+       }
 
        return 0;
 }

-- 
2.52.0

Reply via email to