All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xinwei Kong <kong.kongxinwei@hisilicon.com>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	dri-devel@lists.freedesktop.org
Cc: Chen Feng <puck.chen@hisilicon.com>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Jyri Sarha <jsarha@ti.com>,
	Xinliang Liu <z.liuxinliang@hisilicon.com>,
	Ben Skeggs <bskeggs@redhat.com>,
	Rongrong Zou <zourongrong@gmail.com>,
	Vincent Abriou <vincent.abriou@st.com>
Subject: Re: [PATCH] drm: Remove the struct drm_device platformdev field
Date: Wed, 4 Jan 2017 09:22:31 +0800	[thread overview]
Message-ID: <586C4E57.8050404@hisilicon.com> (raw)
In-Reply-To: <20161217223916.32384-1-laurent.pinchart+renesas@ideasonboard.com>

On 2016/12/18 6:39, Laurent Pinchart wrote:
> The field contains a pointer to the parent platform device of the DRM
> device. As struct drm_device also contains a dev pointer to the struct
> device embedded in the platform_device structure, the platformdev field
> is redundant. Remove it and use the dev pointer directly.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>   drivers/gpu/drm/armada/armada_drv.c             | 3 +--
>   drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 5 ++---
>   drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 --
>   drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c         | 2 +-
>   drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c         | 2 +-
>   drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c        | 2 +-
>   drivers/gpu/drm/msm/msm_drv.c                   | 1 -
>   drivers/gpu/drm/nouveau/nouveau_drm.c           | 3 +--
>   drivers/gpu/drm/sti/sti_drv.c                   | 2 --
>   drivers/gpu/drm/tilcdc/tilcdc_drv.c             | 1 -
>   include/drm/drmP.h                              | 1 -
>   11 files changed, 7 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
> index 07086b427c22..f6442ed23bcd 100644
> --- a/drivers/gpu/drm/armada/armada_drv.c
> +++ b/drivers/gpu/drm/armada/armada_drv.c
> @@ -154,10 +154,9 @@ static int armada_drm_bind(struct device *dev)
>   		return ret;
>   	}
>   
> -	priv->drm.platformdev = to_platform_device(dev);
>   	priv->drm.dev_private = priv;
>   
> -	platform_set_drvdata(priv->drm.platformdev, &priv->drm);
> +	dev_set_drvdata(dev, &priv->drm);
>   
>   	INIT_WORK(&priv->fb_unref_work, armada_drm_unref_work);
>   	INIT_KFIFO(priv->fb_unref);
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> index afc2b5d2d5f0..ec1c70d1b682 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> @@ -975,7 +975,7 @@ static int ade_dts_parse(struct platform_device *pdev, struct ade_hw_ctx *ctx)
>   
>   static int ade_drm_init(struct drm_device *dev)
>   {
> -	struct platform_device *pdev = dev->platformdev;
> +	struct platform_device *pdev = to_platform_device(dev->dev);
>   	struct ade_data *ade;
>   	struct ade_hw_ctx *ctx;
>   	struct ade_crtc *acrtc;
> @@ -1036,8 +1036,7 @@ static int ade_drm_init(struct drm_device *dev)
>   
>   static void ade_drm_cleanup(struct drm_device *dev)
>   {
> -	struct platform_device *pdev = dev->platformdev;
> -	struct ade_data *ade = platform_get_drvdata(pdev);
> +	struct ade_data *ade = dev_get_drvdata(dev->dev);
>   	struct drm_crtc *crtc = &ade->acrtc.base;
>   
>   	drm_crtc_cleanup(crtc);
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index ebd5f4fe4c23..842f70251691 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -209,8 +209,6 @@ static int kirin_drm_bind(struct device *dev)
>   	if (IS_ERR(drm_dev))
>   		return PTR_ERR(drm_dev);
>   
> -	drm_dev->platformdev = to_platform_device(dev);
> -
>   	ret = kirin_drm_kms_init(drm_dev);
>   	if (ret)
>   		goto err_drm_dev_unref;
> diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
> index b782efd4b95f..e8e14a502d21 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
> @@ -438,7 +438,7 @@ static int modeset_init(struct mdp4_kms *mdp4_kms)
>   
>   struct msm_kms *mdp4_kms_init(struct drm_device *dev)
>   {
> -	struct platform_device *pdev = dev->platformdev;
> +	struct platform_device *pdev = to_platform_device(dev->dev);
>   	struct mdp4_platform_config *config = mdp4_get_config(pdev);
>   	struct mdp4_kms *mdp4_kms;
>   	struct msm_kms *kms = NULL;
> diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c
> index 618b2ffed9b4..70eae85cf1de 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c
> @@ -495,7 +495,7 @@ struct mdp5_cfg_handler *mdp5_cfg_init(struct mdp5_kms *mdp5_kms,
>   		uint32_t major, uint32_t minor)
>   {
>   	struct drm_device *dev = mdp5_kms->dev;
> -	struct platform_device *pdev = dev->platformdev;
> +	struct platform_device *pdev = to_platform_device(dev->dev);
>   	struct mdp5_cfg_handler *cfg_handler;
>   	struct mdp5_cfg_platform *pconfig;
>   	int i, ret = 0;
> diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c
> index d444a6901fff..f8f48d014978 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c
> @@ -160,7 +160,7 @@ void msm_mdss_destroy(struct drm_device *dev)
>   
>   int msm_mdss_init(struct drm_device *dev)
>   {
> -	struct platform_device *pdev = dev->platformdev;
> +	struct platform_device *pdev = to_platform_device(dev->dev);
>   	struct msm_drm_private *priv = dev->dev_private;
>   	struct msm_mdss *mdss;
>   	int ret;
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index e29bb66f55b1..12548642b227 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -364,7 +364,6 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
>   	}
>   
>   	platform_set_drvdata(pdev, ddev);
> -	ddev->platformdev = pdev;
>   
>   	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
>   	if (!priv) {
> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index 59348fc41c77..6082e184007d 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -106,7 +106,7 @@ nouveau_name(struct drm_device *dev)
>   	if (dev->pdev)
>   		return nouveau_pci_name(dev->pdev);
>   	else
> -		return nouveau_platform_name(dev->platformdev);
> +		return nouveau_platform_name(to_platform_device(dev->dev));
>   }
>   
>   static int
> @@ -1089,7 +1089,6 @@ nouveau_platform_device_create(const struct nvkm_device_tegra_func *func,
>   		goto err_free;
>   	}
>   
> -	drm->platformdev = pdev;
>   	platform_set_drvdata(pdev, drm);
>   
>   	return drm;
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index ff71e25ab5bf..0df0de397d2c 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -388,8 +388,6 @@ static int sti_bind(struct device *dev)
>   	if (IS_ERR(ddev))
>   		return PTR_ERR(ddev);
>   
> -	ddev->platformdev = to_platform_device(dev);
> -
>   	ret = sti_init(ddev);
>   	if (ret)
>   		goto err_drm_dev_unref;
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index bd0a3bd07167..8f7f6a54ee68 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -245,7 +245,6 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev)
>   	if (IS_ERR(ddev))
>   		return PTR_ERR(ddev);
>   
> -	ddev->platformdev = pdev;
>   	ddev->dev_private = priv;
>   	platform_set_drvdata(pdev, ddev);
>   	drm_mode_config_init(ddev);
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index 0d6c1a13f533..4cc27449d6d7 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -609,7 +609,6 @@ struct drm_device {
>   	struct pci_controller *hose;
>   #endif
>   
> -	struct platform_device *platformdev; /**< Platform device struture */
>   	struct virtio_device *virtdev;
>   
>   	struct drm_sg_mem *sg;	/**< Scatter gather memory */

Acked-by: Xinwei Kong<kong.kongxinwei@hisilicon.com>


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2017-01-04  1:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13 19:34 [PATCH 0/2] exynosdrm: Remove .load/.unload midlayer Laurent Pinchart
2016-12-13 19:34 ` [PATCH 1/2] drm: exynos: Perform initialization/cleanup at probe/remove time Laurent Pinchart
2016-12-13 21:03   ` Sean Paul
2016-12-13 21:10   ` Daniel Vetter
2016-12-13 21:30     ` Laurent Pinchart
2016-12-13 21:32       ` Sean Paul
2016-12-13 21:49         ` Daniel Vetter
2016-12-13 21:54           ` Laurent Pinchart
2016-12-16 18:02   ` Daniel Stone
2016-12-17 21:49     ` Laurent Pinchart
2016-12-17  0:33   ` Inki Dae
2016-12-17 22:12     ` Laurent Pinchart
2016-12-19  6:32       ` Inki Dae
2016-12-17 22:29   ` [PATCH v2] " Laurent Pinchart
2016-12-19  9:29     ` Daniel Stone
2016-12-13 19:34 ` [PATCH 2/2] drm: Remove unused drm_platform midlayer Laurent Pinchart
2016-12-13 21:03   ` Daniel Vetter
2016-12-13 21:04     ` Sean Paul
2016-12-17 22:39 ` [PATCH] drm: Remove the struct drm_device platformdev field Laurent Pinchart
2016-12-18 13:16   ` Daniel Vetter
2016-12-18 20:24     ` Laurent Pinchart
2016-12-19  8:30   ` Jyri Sarha
2017-01-03 13:49   ` Vincent ABRIOU
2017-01-03 14:00   ` Russell King - ARM Linux
2017-01-03 15:29   ` Rob Clark
2017-01-04  1:22   ` Xinwei Kong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=586C4E57.8050404@hisilicon.com \
    --to=kong.kongxinwei@hisilicon.com \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=puck.chen@hisilicon.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=vincent.abriou@st.com \
    --cc=z.liuxinliang@hisilicon.com \
    --cc=zourongrong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.