[PATCH v2 30/60] drm/omap: dss: Remove panel devices list

Sebastian Reichel sre at kernel.org
Sun Jun 10 20:32:28 UTC 2018


Hi,

On Sat, May 26, 2018 at 08:24:48PM +0300, Laurent Pinchart wrote:
> The panel devices list isn't used anymore, all panel devices are
> accessed through the global devices list. Remove it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel at collabora.co.uk>

-- Sebastian

>  .../gpu/drm/omapdrm/displays/connector-analog-tv.c |  9 ++------
>  drivers/gpu/drm/omapdrm/displays/connector-dvi.c   | 14 ++---------
>  drivers/gpu/drm/omapdrm/displays/connector-hdmi.c  |  8 ++-----
>  drivers/gpu/drm/omapdrm/displays/panel-dpi.c       |  8 ++-----
>  drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c    |  8 ++-----
>  .../omapdrm/displays/panel-lgphilips-lb035q02.c    |  8 ++-----
>  .../drm/omapdrm/displays/panel-nec-nl8048hl11.c    |  8 ++-----
>  .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c |  8 ++-----
>  .../drm/omapdrm/displays/panel-sony-acx565akm.c    | 27 +++++++---------------
>  .../drm/omapdrm/displays/panel-tpo-td028ttec1.c    |  8 ++-----
>  .../drm/omapdrm/displays/panel-tpo-td043mtea1.c    | 22 ++++--------------
>  drivers/gpu/drm/omapdrm/dss/display.c              | 23 ------------------
>  drivers/gpu/drm/omapdrm/dss/omapdss.h              |  3 ---
>  13 files changed, 31 insertions(+), 123 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c b/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
> index fb23fae7fbf4..f1d1c67d72b8 100644
> --- a/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
> +++ b/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
> @@ -154,7 +154,6 @@ static int tvc_probe(struct platform_device *pdev)
>  {
>  	struct panel_drv_data *ddata;
>  	struct omap_dss_device *dssdev;
> -	int r;
>  
>  	ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
>  	if (!ddata)
> @@ -172,11 +171,7 @@ static int tvc_probe(struct platform_device *pdev)
>  	dssdev->owner = THIS_MODULE;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(&pdev->dev, "Failed to register panel\n");
> -		return r;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	return 0;
>  }
> @@ -186,7 +181,7 @@ static int __exit tvc_remove(struct platform_device *pdev)
>  	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
>  	struct omap_dss_device *dssdev = &ddata->dssdev;
>  
> -	omapdss_unregister_display(&ddata->dssdev);
> +	omapdss_device_unregister(&ddata->dssdev);
>  
>  	tvc_disable(dssdev);
>  	tvc_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/displays/connector-dvi.c b/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
> index 5333fb166c83..9e0b5a0b2eea 100644
> --- a/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
> +++ b/drivers/gpu/drm/omapdrm/displays/connector-dvi.c
> @@ -391,19 +391,9 @@ static int dvic_probe(struct platform_device *pdev)
>  	dssdev->owner = THIS_MODULE;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(&pdev->dev, "Failed to register panel\n");
> -		goto err_reg;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	return 0;
> -
> -err_reg:
> -	i2c_put_adapter(ddata->i2c_adapter);
> -	mutex_destroy(&ddata->hpd_lock);
> -
> -	return r;
>  }
>  
>  static int __exit dvic_remove(struct platform_device *pdev)
> @@ -411,7 +401,7 @@ static int __exit dvic_remove(struct platform_device *pdev)
>  	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
>  	struct omap_dss_device *dssdev = &ddata->dssdev;
>  
> -	omapdss_unregister_display(&ddata->dssdev);
> +	omapdss_device_unregister(&ddata->dssdev);
>  
>  	dvic_disable(dssdev);
>  	dvic_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> index 2c5e8cf70c9f..064b051c0a29 100644
> --- a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> +++ b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> @@ -351,11 +351,7 @@ static int hdmic_probe(struct platform_device *pdev)
>  	dssdev->owner = THIS_MODULE;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(&pdev->dev, "Failed to register panel\n");
> -		return r;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	return 0;
>  }
> @@ -365,7 +361,7 @@ static int __exit hdmic_remove(struct platform_device *pdev)
>  	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
>  	struct omap_dss_device *dssdev = &ddata->dssdev;
>  
> -	omapdss_unregister_display(&ddata->dssdev);
> +	omapdss_device_unregister(&ddata->dssdev);
>  
>  	hdmic_disable(dssdev);
>  	hdmic_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
> index 87f11618e85f..bd598be1ba6b 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c
> @@ -219,11 +219,7 @@ static int panel_dpi_probe(struct platform_device *pdev)
>  	dssdev->owner = THIS_MODULE;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(&pdev->dev, "Failed to register panel\n");
> -		return r;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	return 0;
>  }
> @@ -233,7 +229,7 @@ static int __exit panel_dpi_remove(struct platform_device *pdev)
>  	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
>  	struct omap_dss_device *dssdev = &ddata->dssdev;
>  
> -	omapdss_unregister_display(dssdev);
> +	omapdss_device_unregister(dssdev);
>  
>  	panel_dpi_disable(dssdev);
>  	panel_dpi_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
> index 94275fc931be..e27399ca3ac5 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
> @@ -1329,11 +1329,7 @@ static int dsicm_probe(struct platform_device *pdev)
>  		OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(dev, "Failed to register panel\n");
> -		goto err_reg;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	mutex_init(&ddata->lock);
>  
> @@ -1404,7 +1400,7 @@ static int __exit dsicm_remove(struct platform_device *pdev)
>  
>  	dev_dbg(&pdev->dev, "remove\n");
>  
> -	omapdss_unregister_display(dssdev);
> +	omapdss_device_unregister(dssdev);
>  
>  	dsicm_disable(dssdev);
>  	dsicm_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c b/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
> index 88c075414b7c..0e89fc1bc34c 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
> @@ -271,11 +271,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi)
>  	dssdev->owner = THIS_MODULE;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(&spi->dev, "Failed to register panel\n");
> -		return r;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	return 0;
>  }
> @@ -285,7 +281,7 @@ static int lb035q02_panel_spi_remove(struct spi_device *spi)
>  	struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
>  	struct omap_dss_device *dssdev = &ddata->dssdev;
>  
> -	omapdss_unregister_display(dssdev);
> +	omapdss_device_unregister(dssdev);
>  
>  	lb035q02_disable(dssdev);
>  	lb035q02_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c b/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
> index fafb3e43f390..9f32343e5122 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
> @@ -294,11 +294,7 @@ static int nec_8048_probe(struct spi_device *spi)
>  	dssdev->owner = THIS_MODULE;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(&spi->dev, "Failed to register panel\n");
> -		return r;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	return 0;
>  }
> @@ -310,7 +306,7 @@ static int nec_8048_remove(struct spi_device *spi)
>  
>  	dev_dbg(&ddata->spi->dev, "%s\n", __func__);
>  
> -	omapdss_unregister_display(dssdev);
> +	omapdss_device_unregister(dssdev);
>  
>  	nec_8048_disable(dssdev);
>  	nec_8048_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
> index bb28994cedc0..320d2e73c40c 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
> @@ -270,11 +270,7 @@ static int sharp_ls_probe(struct platform_device *pdev)
>  	dssdev->owner = THIS_MODULE;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(&pdev->dev, "Failed to register panel\n");
> -		return r;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	return 0;
>  }
> @@ -284,7 +280,7 @@ static int __exit sharp_ls_remove(struct platform_device *pdev)
>  	struct panel_drv_data *ddata = platform_get_drvdata(pdev);
>  	struct omap_dss_device *dssdev = &ddata->dssdev;
>  
> -	omapdss_unregister_display(dssdev);
> +	omapdss_device_unregister(dssdev);
>  
>  	sharp_ls_disable(dssdev);
>  	sharp_ls_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> index 46ede08ce65b..5411c0ce9bb4 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
> @@ -733,7 +733,7 @@ static int acx565akm_probe(struct spi_device *spi)
>  		r = devm_gpio_request_one(&spi->dev, ddata->reset_gpio,
>  				GPIOF_OUT_INIT_LOW, "lcd reset");
>  		if (r)
> -			goto err_gpio;
> +			return r;
>  	}
>  
>  	if (gpio_is_valid(ddata->reset_gpio))
> @@ -754,7 +754,7 @@ static int acx565akm_probe(struct spi_device *spi)
>  
>  	if (r) {
>  		dev_err(&spi->dev, "%s panel detect error\n", __func__);
> -		goto err_detect;
> +		return r;
>  	}
>  
>  	memset(&props, 0, sizeof(props));
> @@ -764,17 +764,15 @@ static int acx565akm_probe(struct spi_device *spi)
>  
>  	bldev = backlight_device_register("acx565akm", &ddata->spi->dev,
>  			ddata, &acx565akm_bl_ops, &props);
> -	if (IS_ERR(bldev)) {
> -		r = PTR_ERR(bldev);
> -		goto err_reg_bl;
> -	}
> +	if (IS_ERR(bldev))
> +		return PTR_ERR(bldev);
>  	ddata->bl_dev = bldev;
>  	if (ddata->has_cabc) {
>  		r = sysfs_create_group(&bldev->dev.kobj, &bldev_attr_group);
>  		if (r) {
>  			dev_err(&bldev->dev,
>  				"%s failed to create sysfs files\n", __func__);
> -			goto err_sysfs;
> +			goto err_backlight_unregister;
>  		}
>  		ddata->cabc_mode = get_hw_cabc_mode(ddata);
>  	}
> @@ -801,21 +799,12 @@ static int acx565akm_probe(struct spi_device *spi)
>  	dssdev->owner = THIS_MODULE;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(&spi->dev, "Failed to register panel\n");
> -		goto err_reg;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	return 0;
>  
> -err_reg:
> -	sysfs_remove_group(&bldev->dev.kobj, &bldev_attr_group);
> -err_sysfs:
> +err_backlight_unregister:
>  	backlight_device_unregister(bldev);
> -err_reg_bl:
> -err_detect:
> -err_gpio:
>  	return r;
>  }
>  
> @@ -829,7 +818,7 @@ static int acx565akm_remove(struct spi_device *spi)
>  	sysfs_remove_group(&ddata->bl_dev->dev.kobj, &bldev_attr_group);
>  	backlight_device_unregister(ddata->bl_dev);
>  
> -	omapdss_unregister_display(dssdev);
> +	omapdss_device_unregister(dssdev);
>  
>  	acx565akm_disable(dssdev);
>  	acx565akm_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
> index a76387dfc0e2..839fc0eaf164 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
> @@ -395,11 +395,7 @@ static int td028ttec1_panel_probe(struct spi_device *spi)
>  	dssdev->owner = THIS_MODULE;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(&spi->dev, "Failed to register panel\n");
> -		return r;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	return 0;
>  }
> @@ -411,7 +407,7 @@ static int td028ttec1_panel_remove(struct spi_device *spi)
>  
>  	dev_dbg(&ddata->spi_dev->dev, "%s\n", __func__);
>  
> -	omapdss_unregister_display(dssdev);
> +	omapdss_device_unregister(dssdev);
>  
>  	td028ttec1_panel_disable(dssdev);
>  	td028ttec1_panel_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
> index dbb1abf1459a..5ad85326a84e 100644
> --- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
> +++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
> @@ -509,8 +509,7 @@ static int tpo_td043_probe(struct spi_device *spi)
>  	ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc");
>  	if (IS_ERR(ddata->vcc_reg)) {
>  		dev_err(&spi->dev, "failed to get LCD VCC regulator\n");
> -		r = PTR_ERR(ddata->vcc_reg);
> -		goto err_regulator;
> +		return PTR_ERR(ddata->vcc_reg);
>  	}
>  
>  	if (gpio_is_valid(ddata->nreset_gpio)) {
> @@ -519,14 +518,14 @@ static int tpo_td043_probe(struct spi_device *spi)
>  				"lcd reset");
>  		if (r < 0) {
>  			dev_err(&spi->dev, "couldn't request reset GPIO\n");
> -			goto err_gpio_req;
> +			return r;
>  		}
>  	}
>  
>  	r = sysfs_create_group(&spi->dev.kobj, &tpo_td043_attr_group);
>  	if (r) {
>  		dev_err(&spi->dev, "failed to create sysfs files\n");
> -		goto err_sysfs;
> +		return r;
>  	}
>  
>  	ddata->vm = tpo_td043_vm;
> @@ -538,20 +537,9 @@ static int tpo_td043_probe(struct spi_device *spi)
>  	dssdev->owner = THIS_MODULE;
>  
>  	omapdss_display_init(dssdev);
> -	r = omapdss_register_display(dssdev);
> -	if (r) {
> -		dev_err(&spi->dev, "Failed to register panel\n");
> -		goto err_reg;
> -	}
> +	omapdss_device_register(dssdev);
>  
>  	return 0;
> -
> -err_reg:
> -	sysfs_remove_group(&spi->dev.kobj, &tpo_td043_attr_group);
> -err_sysfs:
> -err_gpio_req:
> -err_regulator:
> -	return r;
>  }
>  
>  static int tpo_td043_remove(struct spi_device *spi)
> @@ -561,7 +549,7 @@ static int tpo_td043_remove(struct spi_device *spi)
>  
>  	dev_dbg(&ddata->spi->dev, "%s\n", __func__);
>  
> -	omapdss_unregister_display(dssdev);
> +	omapdss_device_unregister(dssdev);
>  
>  	tpo_td043_disable(dssdev);
>  	tpo_td043_disconnect(dssdev);
> diff --git a/drivers/gpu/drm/omapdrm/dss/display.c b/drivers/gpu/drm/omapdrm/dss/display.c
> index 057069b7a6cf..524e43f71af4 100644
> --- a/drivers/gpu/drm/omapdrm/dss/display.c
> +++ b/drivers/gpu/drm/omapdrm/dss/display.c
> @@ -28,8 +28,6 @@
>  
>  #include "omapdss.h"
>  
> -static LIST_HEAD(panel_list);
> -static DEFINE_MUTEX(panel_list_mutex);
>  static int disp_num_counter;
>  
>  void omapdss_display_init(struct omap_dss_device *dssdev)
> @@ -55,27 +53,6 @@ void omapdss_display_init(struct omap_dss_device *dssdev)
>  }
>  EXPORT_SYMBOL_GPL(omapdss_display_init);
>  
> -int omapdss_register_display(struct omap_dss_device *dssdev)
> -{
> -	mutex_lock(&panel_list_mutex);
> -	list_add_tail(&dssdev->panel_list, &panel_list);
> -	mutex_unlock(&panel_list_mutex);
> -
> -	omapdss_device_register(dssdev);
> -	return 0;
> -}
> -EXPORT_SYMBOL(omapdss_register_display);
> -
> -void omapdss_unregister_display(struct omap_dss_device *dssdev)
> -{
> -	mutex_lock(&panel_list_mutex);
> -	list_del(&dssdev->panel_list);
> -	mutex_unlock(&panel_list_mutex);
> -
> -	omapdss_device_register(dssdev);
> -}
> -EXPORT_SYMBOL(omapdss_unregister_display);
> -
>  struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev)
>  {
>  	if (!try_module_get(dssdev->owner))
> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> index e42821583b91..5f71f6885991 100644
> --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> @@ -395,7 +395,6 @@ struct omap_dss_device {
>  	struct omap_dss_device *dst;
>  
>  	struct list_head list;
> -	struct list_head panel_list;
>  
>  	unsigned int alias_id;
>  
> @@ -488,8 +487,6 @@ static inline bool omapdss_is_initialized(void)
>  }
>  
>  void omapdss_display_init(struct omap_dss_device *dssdev);
> -int omapdss_register_display(struct omap_dss_device *dssdev);
> -void omapdss_unregister_display(struct omap_dss_device *dssdev);
>  #define for_each_dss_display(d) \
>  	while ((d = omapdss_device_get_next(d, true)) != NULL)
>  
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180610/b7d7190b/attachment-0001.sig>


More information about the dri-devel mailing list