[PATCH v2 26/60] drm/omap: dss: Remove output devices list
Sebastian Reichel
sre at kernel.org
Sun Jun 10 20:12:31 UTC 2018
Hi,
On Sat, May 26, 2018 at 08:24:44PM +0300, Laurent Pinchart wrote:
> The output devices list isn't used anymore, all output 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
> drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 9 ++-----
> drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 8 ++----
> .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 8 ++----
> drivers/gpu/drm/omapdrm/dss/base.c | 2 ++
> drivers/gpu/drm/omapdrm/dss/dpi.c | 4 +--
> drivers/gpu/drm/omapdrm/dss/dsi.c | 4 +--
> drivers/gpu/drm/omapdrm/dss/hdmi4.c | 4 +--
> drivers/gpu/drm/omapdrm/dss/hdmi5.c | 4 +--
> drivers/gpu/drm/omapdrm/dss/omapdss.h | 5 ----
> drivers/gpu/drm/omapdrm/dss/output.c | 29 ----------------------
> drivers/gpu/drm/omapdrm/dss/sdi.c | 4 +--
> drivers/gpu/drm/omapdrm/dss/venc.c | 4 +--
> 12 files changed, 20 insertions(+), 65 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c b/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c
> index c9c744e0c92e..c1ed4e2ce8f3 100644
> --- a/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c
> +++ b/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c
> @@ -146,7 +146,6 @@ static int opa362_probe(struct platform_device *pdev)
> struct panel_drv_data *ddata;
> struct omap_dss_device *dssdev;
> struct gpio_desc *gpio;
> - int r;
>
> dev_dbg(&pdev->dev, "probe\n");
>
> @@ -169,11 +168,7 @@ static int opa362_probe(struct platform_device *pdev)
> dssdev->output_type = OMAP_DISPLAY_TYPE_VENC;
> dssdev->owner = THIS_MODULE;
>
> - r = omapdss_register_output(dssdev);
> - if (r) {
> - dev_err(&pdev->dev, "Failed to register output\n");
> - return r;
> - }
> + omapdss_device_register(dssdev);
>
> return 0;
> }
> @@ -183,7 +178,7 @@ static int __exit opa362_remove(struct platform_device *pdev)
> struct panel_drv_data *ddata = platform_get_drvdata(pdev);
> struct omap_dss_device *dssdev = &ddata->dssdev;
>
> - omapdss_unregister_output(&ddata->dssdev);
> + omapdss_device_unregister(&ddata->dssdev);
>
> WARN_ON(omapdss_device_is_enabled(dssdev));
> if (omapdss_device_is_enabled(dssdev))
> diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c b/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c
> index f568e53a9104..b360a68f074d 100644
> --- a/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c
> +++ b/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c
> @@ -192,11 +192,7 @@ static int tfp410_probe(struct platform_device *pdev)
> dssdev->owner = THIS_MODULE;
> dssdev->port_num = 1;
>
> - r = omapdss_register_output(dssdev);
> - if (r) {
> - dev_err(&pdev->dev, "Failed to register output\n");
> - return r;
> - }
> + omapdss_device_register(dssdev);
>
> return 0;
> }
> @@ -206,7 +202,7 @@ static int __exit tfp410_remove(struct platform_device *pdev)
> struct panel_drv_data *ddata = platform_get_drvdata(pdev);
> struct omap_dss_device *dssdev = &ddata->dssdev;
>
> - omapdss_unregister_output(&ddata->dssdev);
> + omapdss_device_unregister(&ddata->dssdev);
>
> WARN_ON(omapdss_device_is_enabled(dssdev));
> if (omapdss_device_is_enabled(dssdev))
> diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
> index 7bbe794e9d21..efeae1401490 100644
> --- a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
> +++ b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
> @@ -301,11 +301,7 @@ static int tpd_probe(struct platform_device *pdev)
> dssdev->owner = THIS_MODULE;
> dssdev->port_num = 1;
>
> - r = omapdss_register_output(dssdev);
> - if (r) {
> - dev_err(&pdev->dev, "Failed to register output\n");
> - return r;
> - }
> + omapdss_device_register(dssdev);
>
> return 0;
> }
> @@ -315,7 +311,7 @@ static int __exit tpd_remove(struct platform_device *pdev)
> struct panel_drv_data *ddata = platform_get_drvdata(pdev);
> struct omap_dss_device *dssdev = &ddata->dssdev;
>
> - omapdss_unregister_output(&ddata->dssdev);
> + omapdss_device_unregister(&ddata->dssdev);
>
> WARN_ON(omapdss_device_is_enabled(dssdev));
> if (omapdss_device_is_enabled(dssdev))
> diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
> index 810dcddded8a..7cd3076c2140 100644
> --- a/drivers/gpu/drm/omapdrm/dss/base.c
> +++ b/drivers/gpu/drm/omapdrm/dss/base.c
> @@ -63,6 +63,7 @@ void omapdss_device_register(struct omap_dss_device *dssdev)
> list_add_tail(&dssdev->list, &omapdss_devices_list);
> mutex_unlock(&omapdss_devices_lock);
> }
> +EXPORT_SYMBOL_GPL(omapdss_device_register);
>
> void omapdss_device_unregister(struct omap_dss_device *dssdev)
> {
> @@ -70,6 +71,7 @@ void omapdss_device_unregister(struct omap_dss_device *dssdev)
> list_del(&dssdev->list);
> mutex_unlock(&omapdss_devices_lock);
> }
> +EXPORT_SYMBOL_GPL(omapdss_device_unregister);
>
> static bool omapdss_device_is_registered(struct device_node *node)
> {
> diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c
> index c13feaf8b086..3fbed21d69a6 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dpi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
> @@ -718,7 +718,7 @@ static void dpi_init_output_port(struct dpi_data *dpi, struct device_node *port)
> out->ops = &dpi_ops;
> out->owner = THIS_MODULE;
>
> - omapdss_register_output(out);
> + omapdss_device_register(out);
> }
>
> static void dpi_uninit_output_port(struct device_node *port)
> @@ -726,7 +726,7 @@ static void dpi_uninit_output_port(struct device_node *port)
> struct dpi_data *dpi = port->data;
> struct omap_dss_device *out = &dpi->output;
>
> - omapdss_unregister_output(out);
> + omapdss_device_unregister(out);
> }
>
> int dpi_init_port(struct dss_device *dss, struct platform_device *pdev,
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index adfda2a63ada..90820402e81f 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -4995,14 +4995,14 @@ static void dsi_init_output(struct dsi_data *dsi)
> out->ops = &dsi_ops;
> out->owner = THIS_MODULE;
>
> - omapdss_register_output(out);
> + omapdss_device_register(out);
> }
>
> static void dsi_uninit_output(struct dsi_data *dsi)
> {
> struct omap_dss_device *out = &dsi->output;
>
> - omapdss_unregister_output(out);
> + omapdss_device_unregister(out);
> }
>
> static int dsi_probe_of(struct dsi_data *dsi)
> diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
> index 7e5474e87c11..fa818033f3f3 100644
> --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
> +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
> @@ -565,14 +565,14 @@ static void hdmi_init_output(struct omap_hdmi *hdmi)
> out->ops = &hdmi_ops;
> out->owner = THIS_MODULE;
>
> - omapdss_register_output(out);
> + omapdss_device_register(out);
> }
>
> static void hdmi_uninit_output(struct omap_hdmi *hdmi)
> {
> struct omap_dss_device *out = &hdmi->output;
>
> - omapdss_unregister_output(out);
> + omapdss_device_unregister(out);
> }
>
> static int hdmi_probe_of(struct omap_hdmi *hdmi)
> diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
> index 86b18ccb8d24..ef4a48f397d2 100644
> --- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
> +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
> @@ -556,14 +556,14 @@ static void hdmi_init_output(struct omap_hdmi *hdmi)
> out->ops = &hdmi_ops;
> out->owner = THIS_MODULE;
>
> - omapdss_register_output(out);
> + omapdss_device_register(out);
> }
>
> static void hdmi_uninit_output(struct omap_hdmi *hdmi)
> {
> struct omap_dss_device *out = &hdmi->output;
>
> - omapdss_unregister_output(out);
> + omapdss_device_unregister(out);
> }
>
> static int hdmi_probe_of(struct omap_hdmi *hdmi)
> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> index 0033adf534d3..26abc09f3d4a 100644
> --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> @@ -416,8 +416,6 @@ struct omap_dss_device {
>
> /* OMAP DSS output specific fields */
>
> - struct list_head output_list;
> -
> /* DISPC channel for this output */
> enum omap_channel dispc_channel;
> bool dispc_channel_connected;
> @@ -510,9 +508,6 @@ int omap_dss_get_num_overlay_managers(void);
>
> int omap_dss_get_num_overlays(void);
>
> -int omapdss_register_output(struct omap_dss_device *output);
> -void omapdss_unregister_output(struct omap_dss_device *output);
> -struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id);
> int omapdss_output_set_device(struct omap_dss_device *out,
> struct omap_dss_device *dssdev);
> int omapdss_output_unset_device(struct omap_dss_device *out);
> diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c
> index 6abdb615a4c0..e62da96f83af 100644
> --- a/drivers/gpu/drm/omapdrm/dss/output.c
> +++ b/drivers/gpu/drm/omapdrm/dss/output.c
> @@ -23,7 +23,6 @@
>
> #include "omapdss.h"
>
> -static LIST_HEAD(output_list);
> static DEFINE_MUTEX(output_lock);
>
> int omapdss_output_set_device(struct omap_dss_device *out,
> @@ -88,34 +87,6 @@ int omapdss_output_unset_device(struct omap_dss_device *out)
> }
> EXPORT_SYMBOL(omapdss_output_unset_device);
>
> -int omapdss_register_output(struct omap_dss_device *out)
> -{
> - list_add_tail(&out->output_list, &output_list);
> - omapdss_device_register(out);
> - return 0;
> -}
> -EXPORT_SYMBOL(omapdss_register_output);
> -
> -void omapdss_unregister_output(struct omap_dss_device *out)
> -{
> - list_del(&out->output_list);
> - omapdss_device_unregister(out);
> -}
> -EXPORT_SYMBOL(omapdss_unregister_output);
> -
> -struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id)
> -{
> - struct omap_dss_device *out;
> -
> - list_for_each_entry(out, &output_list, output_list) {
> - if (out->id == id)
> - return out;
> - }
> -
> - return NULL;
> -}
> -EXPORT_SYMBOL(omap_dss_get_output);
> -
> struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev)
> {
> while (dssdev->src)
> diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c b/drivers/gpu/drm/omapdrm/dss/sdi.c
> index 77a8f7d86f7a..76842ca4a619 100644
> --- a/drivers/gpu/drm/omapdrm/dss/sdi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
> @@ -328,12 +328,12 @@ static void sdi_init_output(struct sdi_device *sdi)
> out->ops = &sdi_ops;
> out->owner = THIS_MODULE;
>
> - omapdss_register_output(out);
> + omapdss_device_register(out);
> }
>
> static void sdi_uninit_output(struct sdi_device *sdi)
> {
> - omapdss_unregister_output(&sdi->output);
> + omapdss_device_unregister(&sdi->output);
> }
>
> int sdi_init_port(struct dss_device *dss, struct platform_device *pdev,
> diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
> index 8ea622d02b5c..bed7fcb35d89 100644
> --- a/drivers/gpu/drm/omapdrm/dss/venc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/venc.c
> @@ -768,12 +768,12 @@ static void venc_init_output(struct venc_device *venc)
> out->ops = &venc_ops;
> out->owner = THIS_MODULE;
>
> - omapdss_register_output(out);
> + omapdss_device_register(out);
> }
>
> static void venc_uninit_output(struct venc_device *venc)
> {
> - omapdss_unregister_output(&venc->output);
> + omapdss_device_unregister(&venc->output);
> }
>
> static int venc_probe_of(struct venc_device *venc)
> --
> 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/60c5e8f8/attachment-0001.sig>
More information about the dri-devel
mailing list