[PATCH] drm/panel: tdo-tl070wsh30: Use devm_drm_panel_add()

박명훈 posted 1 patch 1 month, 2 weeks ago
There is a newer version of this series
drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH] drm/panel: tdo-tl070wsh30: Use devm_drm_panel_add()
Posted by 박명훈 1 month, 2 weeks ago
From: Myeonghun Pak <mhun512@gmail.com>

tdo_tl070wsh30_panel_probe() registers the panel before attaching the DSI
device. If mipi_dsi_attach() fails, the driver's remove callback is not
called and the panel remains registered in the global DRM panel registry.

Use devm_drm_panel_add() so panel registration is automatically unwound on
probe failure and device removal, and drop the explicit drm_panel_remove()
from the remove callback.

Fixes: cf40c6600592 ("drm: panel: add TDO tl070wsh30 panel driver")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
 drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
index 227f97f9b..1cf3ca1c0 100644
--- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
+++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
@@ -169,9 +169,7 @@ static int tdo_tl070wsh30_panel_add(struct tdo_tl070wsh30_panel *tdo_tl070wsh30)
 	if (err)
 		return err;
 
-	drm_panel_add(&tdo_tl070wsh30->base);
-
-	return 0;
+	return devm_drm_panel_add(dev, &tdo_tl070wsh30->base);
 }
 
 static int tdo_tl070wsh30_panel_probe(struct mipi_dsi_device *dsi)
@@ -207,7 +205,6 @@ static void tdo_tl070wsh30_panel_remove(struct mipi_dsi_device *dsi)
 	if (err < 0)
 		dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
 
-	drm_panel_remove(&tdo_tl070wsh30->base);
 }
 
 static struct mipi_dsi_driver tdo_tl070wsh30_panel_driver = {
-- 
2.49.0
Re: [PATCH] drm/panel: tdo-tl070wsh30: Use devm_drm_panel_add()
Posted by kernel test robot 1 month, 2 weeks ago
Hi 박명훈,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on linus/master v7.1-rc1 next-20260428]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/drm-panel-tdo-tl070wsh30-Use-devm_drm_panel_add/20260428-215942
base:   https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
patch link:    https://lore.kernel.org/r/20260428131855.3501-1-pakmyeonghun%40bagmyeonghun-ui-MacBookPro.local
patch subject: [PATCH] drm/panel: tdo-tl070wsh30: Use devm_drm_panel_add()
config: nios2-randconfig-001-20260430 (https://download.01.org/0day-ci/archive/20260430/202604300328.1HVE9S0R-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260430/202604300328.1HVE9S0R-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604300328.1HVE9S0R-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c: In function 'tdo_tl070wsh30_panel_remove':
>> drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c:201:38: warning: unused variable 'tdo_tl070wsh30' [-Wunused-variable]
     201 |         struct tdo_tl070wsh30_panel *tdo_tl070wsh30 = mipi_dsi_get_drvdata(dsi);
         |                                      ^~~~~~~~~~~~~~


vim +/tdo_tl070wsh30 +201 drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c

cf40c66005920a Neil Armstrong   2020-09-15  198  
79abca2b399009 Uwe Kleine-König 2022-07-08  199  static void tdo_tl070wsh30_panel_remove(struct mipi_dsi_device *dsi)
cf40c66005920a Neil Armstrong   2020-09-15  200  {
cf40c66005920a Neil Armstrong   2020-09-15 @201  	struct tdo_tl070wsh30_panel *tdo_tl070wsh30 = mipi_dsi_get_drvdata(dsi);
cf40c66005920a Neil Armstrong   2020-09-15  202  	int err;
cf40c66005920a Neil Armstrong   2020-09-15  203  
cf40c66005920a Neil Armstrong   2020-09-15  204  	err = mipi_dsi_detach(dsi);
cf40c66005920a Neil Armstrong   2020-09-15  205  	if (err < 0)
cf40c66005920a Neil Armstrong   2020-09-15  206  		dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
cf40c66005920a Neil Armstrong   2020-09-15  207  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki