diff mbox series

[v2,15/16] backlight: make of_find_backlight_by_node() static

Message ID 20200517190139.740249-16-sam@ravnborg.org
State New
Headers show
Series backlight updates | expand

Commit Message

Sam Ravnborg May 17, 2020, 7:01 p.m. UTC
There are no external users of of_find_backlight_by_node().
Make it static so we keep it that way.

v2:
  - drop EXPORT of of_find_backlight_by_node

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Jingoo Han <jingoohan1@gmail.com>
---
 drivers/video/backlight/backlight.c | 23 +++++++++--------------
 include/linux/backlight.h           | 10 ----------
 2 files changed, 9 insertions(+), 24 deletions(-)

Comments

kbuild test robot May 17, 2020, 8:22 p.m. UTC | #1
Hi Sam,

I love your patch! Yet something to improve:

[auto build test ERROR on tegra-drm/drm/tegra/for-next]
[also build test ERROR on pwm/for-next linus/master v5.7-rc5]
[cannot apply to backlight/for-backlight-next next-20200515]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Sam-Ravnborg/backlight-updates/20200518-030516
base:   git://anongit.freedesktop.org/tegra/linux.git drm/tegra/for-next
config: arm-randconfig-r011-20200517 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

drivers/gpu/drm/tilcdc/tilcdc_panel.c: In function 'panel_probe':
>> drivers/gpu/drm/tilcdc/tilcdc_panel.c:324:26: error: implicit declaration of function 'of_find_backlight_by_node'; did you mean 'of_find_i2c_adapter_by_node'? [-Werror=implicit-function-declaration]
324 |   panel_mod->backlight = of_find_backlight_by_node(bl_node);
|                          ^~~~~~~~~~~~~~~~~~~~~~~~~
|                          of_find_i2c_adapter_by_node
>> drivers/gpu/drm/tilcdc/tilcdc_panel.c:324:24: error: assignment to 'struct backlight_device *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
324 |   panel_mod->backlight = of_find_backlight_by_node(bl_node);
|                        ^
cc1: all warnings being treated as errors

vim +324 drivers/gpu/drm/tilcdc/tilcdc_panel.c

0d4bbaf9f3e5b9 Rob Clark        2012-12-18  303  
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  304  static int panel_probe(struct platform_device *pdev)
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  305  {
18c44db8cafe9b Ezequiel Garcia  2014-09-02  306  	struct device_node *bl_node, *node = pdev->dev.of_node;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  307  	struct panel_module *panel_mod;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  308  	struct tilcdc_module *mod;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  309  	struct pinctrl *pinctrl;
12778fc14301cf Ezequiel Garcia  2014-09-02  310  	int ret;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  311  
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  312  	/* bail out early if no DT data: */
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  313  	if (!node) {
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  314  		dev_err(&pdev->dev, "device-tree data is missing\n");
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  315  		return -ENXIO;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  316  	}
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  317  
971645d1fd734b Ezequiel Garcia  2014-09-02  318  	panel_mod = devm_kzalloc(&pdev->dev, sizeof(*panel_mod), GFP_KERNEL);
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  319  	if (!panel_mod)
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  320  		return -ENOMEM;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  321  
18c44db8cafe9b Ezequiel Garcia  2014-09-02  322  	bl_node = of_parse_phandle(node, "backlight", 0);
18c44db8cafe9b Ezequiel Garcia  2014-09-02  323  	if (bl_node) {
18c44db8cafe9b Ezequiel Garcia  2014-09-02 @324  		panel_mod->backlight = of_find_backlight_by_node(bl_node);
18c44db8cafe9b Ezequiel Garcia  2014-09-02  325  		of_node_put(bl_node);
18c44db8cafe9b Ezequiel Garcia  2014-09-02  326  
18c44db8cafe9b Ezequiel Garcia  2014-09-02  327  		if (!panel_mod->backlight)
18c44db8cafe9b Ezequiel Garcia  2014-09-02  328  			return -EPROBE_DEFER;
18c44db8cafe9b Ezequiel Garcia  2014-09-02  329  
18c44db8cafe9b Ezequiel Garcia  2014-09-02  330  		dev_info(&pdev->dev, "found backlight\n");
18c44db8cafe9b Ezequiel Garcia  2014-09-02  331  	}
18c44db8cafe9b Ezequiel Garcia  2014-09-02  332  
26a5bd26499fba Uwe Kleine-König 2015-02-11  333  	panel_mod->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
26a5bd26499fba Uwe Kleine-König 2015-02-11  334  							 GPIOD_OUT_LOW);
d898ce03675fc0 Ezequiel Garcia  2014-09-02  335  	if (IS_ERR(panel_mod->enable_gpio)) {
d898ce03675fc0 Ezequiel Garcia  2014-09-02  336  		ret = PTR_ERR(panel_mod->enable_gpio);
d898ce03675fc0 Ezequiel Garcia  2014-09-02  337  		dev_err(&pdev->dev, "failed to request enable GPIO\n");
d898ce03675fc0 Ezequiel Garcia  2014-09-02  338  		goto fail_backlight;
d898ce03675fc0 Ezequiel Garcia  2014-09-02  339  	}
d898ce03675fc0 Ezequiel Garcia  2014-09-02  340  
26a5bd26499fba Uwe Kleine-König 2015-02-11  341  	if (panel_mod->enable_gpio)
d898ce03675fc0 Ezequiel Garcia  2014-09-02  342  		dev_info(&pdev->dev, "found enable GPIO\n");
d898ce03675fc0 Ezequiel Garcia  2014-09-02  343  
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  344  	mod = &panel_mod->base;
7cdcce9f8b4c15 Guido Martínez   2014-06-17  345  	pdev->dev.platform_data = mod;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  346  
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  347  	tilcdc_module_init(mod, "panel", &panel_module_ops);
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  348  
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  349  	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  350  	if (IS_ERR(pinctrl))
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  351  		dev_warn(&pdev->dev, "pins are not configured\n");
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  352  
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  353  	panel_mod->timings = of_get_display_timings(node);
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  354  	if (!panel_mod->timings) {
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  355  		dev_err(&pdev->dev, "could not get panel timings\n");
12778fc14301cf Ezequiel Garcia  2014-09-02  356  		ret = -EINVAL;
7cdcce9f8b4c15 Guido Martínez   2014-06-17  357  		goto fail_free;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  358  	}
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  359  
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  360  	panel_mod->info = of_get_panel_info(node);
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  361  	if (!panel_mod->info) {
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  362  		dev_err(&pdev->dev, "could not get panel info\n");
12778fc14301cf Ezequiel Garcia  2014-09-02  363  		ret = -EINVAL;
7cdcce9f8b4c15 Guido Martínez   2014-06-17  364  		goto fail_timings;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  365  	}
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  366  
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  367  	return 0;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  368  
7cdcce9f8b4c15 Guido Martínez   2014-06-17  369  fail_timings:
7cdcce9f8b4c15 Guido Martínez   2014-06-17  370  	display_timings_release(panel_mod->timings);
7cdcce9f8b4c15 Guido Martínez   2014-06-17  371  
7cdcce9f8b4c15 Guido Martínez   2014-06-17  372  fail_free:
7cdcce9f8b4c15 Guido Martínez   2014-06-17  373  	tilcdc_module_cleanup(mod);
d898ce03675fc0 Ezequiel Garcia  2014-09-02  374  
d898ce03675fc0 Ezequiel Garcia  2014-09-02  375  fail_backlight:
18c44db8cafe9b Ezequiel Garcia  2014-09-02  376  	if (panel_mod->backlight)
18c44db8cafe9b Ezequiel Garcia  2014-09-02  377  		put_device(&panel_mod->backlight->dev);
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  378  	return ret;
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  379  }
0d4bbaf9f3e5b9 Rob Clark        2012-12-18  380  

:::::: The code at line 324 was first introduced by commit
:::::: 18c44db8cafe9bda4fcb51bfc05c1f1d7cefc44c drm/tilcdc: panel: Fix backlight devicetree support

:::::: TO: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
:::::: CC: Dave Airlie <airlied@redhat.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kbuild test robot May 17, 2020, 8:53 p.m. UTC | #2
Hi Sam,

I love your patch! Yet something to improve:

[auto build test ERROR on tegra-drm/drm/tegra/for-next]
[also build test ERROR on pwm/for-next linus/master v5.7-rc5]
[cannot apply to backlight/for-backlight-next next-20200515]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Sam-Ravnborg/backlight-updates/20200518-030516
base:   git://anongit.freedesktop.org/tegra/linux.git drm/tegra/for-next
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>, old ones prefixed by <<):

drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c: In function 'dsicm_probe_of':
>> drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c:1221:21: error: implicit declaration of function 'of_find_backlight_by_node'; did you mean 'of_find_device_by_node'? [-Werror=implicit-function-declaration]
1221 |   ddata->extbldev = of_find_backlight_by_node(backlight);
|                     ^~~~~~~~~~~~~~~~~~~~~~~~~
|                     of_find_device_by_node
>> drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c:1221:19: warning: assignment to 'struct backlight_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1221 |   ddata->extbldev = of_find_backlight_by_node(backlight);
|                   ^
cc1: some warnings being treated as errors

vim +1221 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c

dbc23840b4d70f drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-05-24  1162  
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1163  static int dsicm_probe_of(struct platform_device *pdev)
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1164  {
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1165  	struct device_node *node = pdev->dev.of_node;
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1166  	struct device_node *backlight;
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1167  	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1168  	struct display_timing timing;
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1169  	int err;
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1170  
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1171  	ddata->reset_gpio = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW);
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1172  	if (IS_ERR(ddata->reset_gpio)) {
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1173  		err = PTR_ERR(ddata->reset_gpio);
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1174  		dev_err(&pdev->dev, "reset gpio request failed: %d", err);
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1175  		return err;
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1176  	}
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1177  
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1178  	ddata->ext_te_gpio = devm_gpiod_get_optional(&pdev->dev, "te",
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1179  						     GPIOD_IN);
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1180  	if (IS_ERR(ddata->ext_te_gpio)) {
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1181  		err = PTR_ERR(ddata->ext_te_gpio);
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1182  		dev_err(&pdev->dev, "TE gpio request failed: %d", err);
9231abd32876db drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1183  		return err;
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1184  	}
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1185  
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1186  	err = of_get_display_timing(node, "panel-timing", &timing);
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1187  	if (!err) {
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1188  		videomode_from_timing(&timing, &ddata->vm);
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1189  		if (!ddata->vm.pixelclock)
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1190  			ddata->vm.pixelclock =
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1191  				ddata->vm.hactive * ddata->vm.vactive * 60;
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1192  	} else {
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1193  		dev_warn(&pdev->dev,
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1194  			 "failed to get video timing, using defaults\n");
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1195  	}
e128310ddd379b drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Tony Lindgren     2017-07-24  1196  
d95c5a0e0154af drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1197  	ddata->width_mm = 0;
d95c5a0e0154af drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1198  	of_property_read_u32(node, "width-mm", &ddata->width_mm);
d95c5a0e0154af drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1199  
d95c5a0e0154af drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1200  	ddata->height_mm = 0;
d95c5a0e0154af drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1201  	of_property_read_u32(node, "height-mm", &ddata->height_mm);
d95c5a0e0154af drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1202  
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1203  	ddata->vpnl = devm_regulator_get_optional(&pdev->dev, "vpnl");
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1204  	if (IS_ERR(ddata->vpnl)) {
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1205  		err = PTR_ERR(ddata->vpnl);
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1206  		if (err == -EPROBE_DEFER)
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1207  			return err;
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1208  		ddata->vpnl = NULL;
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1209  	}
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1210  
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1211  	ddata->vddi = devm_regulator_get_optional(&pdev->dev, "vddi");
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1212  	if (IS_ERR(ddata->vddi)) {
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1213  		err = PTR_ERR(ddata->vddi);
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1214  		if (err == -EPROBE_DEFER)
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1215  			return err;
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1216  		ddata->vddi = NULL;
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1217  	}
82fa10d46be9d1 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1218  
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1219  	backlight = of_parse_phandle(node, "backlight", 0);
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1220  	if (backlight) {
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24 @1221  		ddata->extbldev = of_find_backlight_by_node(backlight);
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1222  		of_node_put(backlight);
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1223  
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1224  		if (!ddata->extbldev)
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1225  			return -EPROBE_DEFER;
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1226  	} else {
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1227  		/* assume native backlight support */
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1228  		ddata->use_dsi_backlight = true;
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1229  	}
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1230  
a44e552a1f4371 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c Sebastian Reichel 2017-07-24  1231  	/* TODO: ulps */
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1232  
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1233  	return 0;
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1234  }
cdeeaca2a11d31 drivers/video/omap2/displays-new/panel-dsi-cm.c Tomi Valkeinen    2013-07-30  1235  

:::::: The code at line 1221 was first introduced by commit
:::::: a44e552a1f4371a02473da5448add5320a01f5ff drm/omap: panel-dsi-cm: add external backlight support

:::::: TO: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
:::::: CC: Tomi Valkeinen <tomi.valkeinen@ti.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Daniel Thompson May 18, 2020, 4:56 p.m. UTC | #3
On Sun, May 17, 2020 at 09:01:38PM +0200, Sam Ravnborg wrote:
> There are no external users of of_find_backlight_by_node().
> Make it static so we keep it that way.
> 
> v2:
>   - drop EXPORT of of_find_backlight_by_node
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Daniel Thompson <daniel.thompson@linaro.org>
> Cc: Jingoo Han <jingoohan1@gmail.com>

Assuming the 0day-ci comments are because some of the patches have
already been sucked up in a different tree then:

Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


Daniel.


> ---
>  drivers/video/backlight/backlight.c | 23 +++++++++--------------
>  include/linux/backlight.h           | 10 ----------
>  2 files changed, 9 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> index 7f3eecaf8317..3fa29330a820 100644
> --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -627,19 +627,9 @@ static int of_parent_match(struct device *dev, const void *data)
>  	return dev->parent && dev->parent->of_node == data;
>  }
>  
> -/**
> - * of_find_backlight_by_node() - find backlight device by device-tree node
> - * @node: device-tree node of the backlight device
> - *
> - * Returns a pointer to the backlight device corresponding to the given DT
> - * node or NULL if no such backlight device exists or if the device hasn't
> - * been probed yet.
> - *
> - * This function obtains a reference on the backlight device and it is the
> - * caller's responsibility to drop the reference by calling put_device() on
> - * the backlight device's .dev field.
> - */
> -struct backlight_device *of_find_backlight_by_node(struct device_node *node)
> +/* Find backlight device by device-tree node */
> +static struct backlight_device *
> +of_find_backlight_by_node(struct device_node *node)
>  {
>  	struct device *dev;
>  
> @@ -647,7 +637,12 @@ struct backlight_device *of_find_backlight_by_node(struct device_node *node)
>  
>  	return dev ? to_backlight_device(dev) : NULL;
>  }
> -EXPORT_SYMBOL(of_find_backlight_by_node);
> +#else
> +static struct backlight_device *
> +of_find_backlight_by_node(struct device_node *node)
> +{
> +	return NULL;
> +}
>  #endif
>  
>  static struct backlight_device *of_find_backlight(struct device *dev)
> diff --git a/include/linux/backlight.h b/include/linux/backlight.h
> index d92e523650ec..1e29ab43f4f6 100644
> --- a/include/linux/backlight.h
> +++ b/include/linux/backlight.h
> @@ -473,16 +473,6 @@ static inline void * bl_get_data(struct backlight_device *bl_dev)
>  	return dev_get_drvdata(&bl_dev->dev);
>  }
>  
> -#ifdef CONFIG_OF
> -struct backlight_device *of_find_backlight_by_node(struct device_node *node);
> -#else
> -static inline struct backlight_device *
> -of_find_backlight_by_node(struct device_node *node)
> -{
> -	return NULL;
> -}
> -#endif
> -
>  #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
>  struct backlight_device *devm_of_find_backlight(struct device *dev);
>  #else
> -- 
> 2.25.1
>
Sam Ravnborg May 18, 2020, 6:12 p.m. UTC | #4
On Mon, May 18, 2020 at 05:56:48PM +0100, Daniel Thompson wrote:
> On Sun, May 17, 2020 at 09:01:38PM +0200, Sam Ravnborg wrote:
> > There are no external users of of_find_backlight_by_node().
> > Make it static so we keep it that way.
> > 
> > v2:
> >   - drop EXPORT of of_find_backlight_by_node
> > 
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Lee Jones <lee.jones@linaro.org>
> > Cc: Daniel Thompson <daniel.thompson@linaro.org>
> > Cc: Jingoo Han <jingoohan1@gmail.com>
> 
> Assuming the 0day-ci comments are because some of the patches have
> already been sucked up in a different tree then:
Correct. For now only drm-misc-next have no users of
of_find_backlight_by_node() which is why the other trees failed.

 
> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Thanks for all your reviews!
I will shortly (within a few days) address the comments and send out a v3.

Is is correct that I assume you or Lee or Jingoo will apply the patches
to a backlight tree somewhere when they are ready?
If you have a tree you use for backlight patches I can base v3 on that,
given that I get a link and have access to pull from it.

	Sam
Daniel Thompson May 18, 2020, 7:56 p.m. UTC | #5
On Mon, May 18, 2020 at 08:12:27PM +0200, Sam Ravnborg wrote:
> On Mon, May 18, 2020 at 05:56:48PM +0100, Daniel Thompson wrote:
> > On Sun, May 17, 2020 at 09:01:38PM +0200, Sam Ravnborg wrote:
> > > There are no external users of of_find_backlight_by_node().
> > > Make it static so we keep it that way.
> > > 
> > > v2:
> > >   - drop EXPORT of of_find_backlight_by_node
> > > 
> > > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > > Cc: Lee Jones <lee.jones@linaro.org>
> > > Cc: Daniel Thompson <daniel.thompson@linaro.org>
> > > Cc: Jingoo Han <jingoohan1@gmail.com>
> > 
> > Assuming the 0day-ci comments are because some of the patches have
> > already been sucked up in a different tree then:
> Correct. For now only drm-misc-next have no users of
> of_find_backlight_by_node() which is why the other trees failed.
> 
>  
> > Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
> Thanks for all your reviews!
> I will shortly (within a few days) address the comments and send out a v3.
> 
> Is is correct that I assume you or Lee or Jingoo will apply the patches
> to a backlight tree somewhere when they are ready?
> If you have a tree you use for backlight patches I can base v3 on that,
> given that I get a link and have access to pull from it.

Absent holidays and the like, Lee usually does that actual patch
hoovering.


Daniel.
diff mbox series

Patch

diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 7f3eecaf8317..3fa29330a820 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -627,19 +627,9 @@  static int of_parent_match(struct device *dev, const void *data)
 	return dev->parent && dev->parent->of_node == data;
 }
 
-/**
- * of_find_backlight_by_node() - find backlight device by device-tree node
- * @node: device-tree node of the backlight device
- *
- * Returns a pointer to the backlight device corresponding to the given DT
- * node or NULL if no such backlight device exists or if the device hasn't
- * been probed yet.
- *
- * This function obtains a reference on the backlight device and it is the
- * caller's responsibility to drop the reference by calling put_device() on
- * the backlight device's .dev field.
- */
-struct backlight_device *of_find_backlight_by_node(struct device_node *node)
+/* Find backlight device by device-tree node */
+static struct backlight_device *
+of_find_backlight_by_node(struct device_node *node)
 {
 	struct device *dev;
 
@@ -647,7 +637,12 @@  struct backlight_device *of_find_backlight_by_node(struct device_node *node)
 
 	return dev ? to_backlight_device(dev) : NULL;
 }
-EXPORT_SYMBOL(of_find_backlight_by_node);
+#else
+static struct backlight_device *
+of_find_backlight_by_node(struct device_node *node)
+{
+	return NULL;
+}
 #endif
 
 static struct backlight_device *of_find_backlight(struct device *dev)
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index d92e523650ec..1e29ab43f4f6 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -473,16 +473,6 @@  static inline void * bl_get_data(struct backlight_device *bl_dev)
 	return dev_get_drvdata(&bl_dev->dev);
 }
 
-#ifdef CONFIG_OF
-struct backlight_device *of_find_backlight_by_node(struct device_node *node);
-#else
-static inline struct backlight_device *
-of_find_backlight_by_node(struct device_node *node)
-{
-	return NULL;
-}
-#endif
-
 #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
 struct backlight_device *devm_of_find_backlight(struct device *dev);
 #else