drm: panel: simple: add missing platform_driver_unregister() in panel_simple_init
diff mbox series

Message ID 20201031011856.137307-1-miaoqinglang@huawei.com
State In Next
Commit f2e66f212a9de04afc2caa5ec79057c0ac75c728
Headers show
Series
  • drm: panel: simple: add missing platform_driver_unregister() in panel_simple_init
Related show

Commit Message

Qinglang Miao Oct. 31, 2020, 1:18 a.m. UTC
Add the missing platform_driver_unregister() before return
from panel_simple_init in the error handling case when failed
to register panel_simple_dsi_driver with CONFIG_DRM_MIPI_DSI
enabled.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Sam Ravnborg Nov. 8, 2020, 9:56 a.m. UTC | #1
Hi Qinglang

On Sat, Oct 31, 2020 at 09:18:56AM +0800, Qinglang Miao wrote:
> Add the missing platform_driver_unregister() before return
> from panel_simple_init in the error handling case when failed
> to register panel_simple_dsi_driver with CONFIG_DRM_MIPI_DSI
> enabled.
> 
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>

Looks relevant, applied to drm-misc-next.

	Sam

Patch
diff mbox series

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 2be358fb4..2966ac13c 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -4644,8 +4644,10 @@  static int __init panel_simple_init(void)
 
 	if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
 		err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
-		if (err < 0)
+		if (err < 0) {
+			platform_driver_unregister(&panel_simple_platform_driver);
 			return err;
+		}
 	}
 
 	return 0;