public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>
Subject: Re: [PATCH 3/4 v2] drm: atmel_hldc - use generic drm_connector_register_all() helper
Date: Mon, 21 Mar 2016 14:10:37 +0100	[thread overview]
Message-ID: <20160321141037.78822900@bbrezillon> (raw)
In-Reply-To: <1458563320-30541-4-git-send-email-abrodkin@synopsys.com>

On Mon, 21 Mar 2016 15:28:39 +0300
Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:

> This driver used to have its own implementation of connector_register_all()
> which actually was taken as a prototype of drm_connector_register_all().
> 
> Now when drm_connector_register_all() exists reusing it here.
> 
> And while at it replace atmel_hlcdc_dc_connector_unplug_all()
> with generic drm_connector_unregister_all().
> 
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Boris Brezillon <boris.brezillon@free-electrons.com>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
> 
> No changes v1 -> v2.
> 
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 39 ++--------------------------
>  1 file changed, 2 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index 3d8d164..1c537e4 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -584,41 +584,6 @@ static void atmel_hlcdc_dc_unload(struct drm_device *dev)
>  	destroy_workqueue(dc->wq);
>  }
>  
> -static int atmel_hlcdc_dc_connector_plug_all(struct drm_device *dev)
> -{
> -	struct drm_connector *connector, *failed;
> -	int ret;
> -
> -	mutex_lock(&dev->mode_config.mutex);
> -	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
> -		ret = drm_connector_register(connector);
> -		if (ret) {
> -			failed = connector;
> -			goto err;
> -		}
> -	}
> -	mutex_unlock(&dev->mode_config.mutex);
> -	return 0;
> -
> -err:
> -	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
> -		if (failed == connector)
> -			break;
> -
> -		drm_connector_unregister(connector);
> -	}
> -	mutex_unlock(&dev->mode_config.mutex);
> -
> -	return ret;
> -}
> -
> -static void atmel_hlcdc_dc_connector_unplug_all(struct drm_device *dev)
> -{
> -	mutex_lock(&dev->mode_config.mutex);
> -	drm_connector_unplug_all(dev);
> -	mutex_unlock(&dev->mode_config.mutex);
> -}
> -
>  static void atmel_hlcdc_dc_lastclose(struct drm_device *dev)
>  {
>  	struct atmel_hlcdc_dc *dc = dev->dev_private;
> @@ -736,7 +701,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto err_unload;
>  
> -	ret = atmel_hlcdc_dc_connector_plug_all(ddev);
> +	ret = drm_connector_register_all(ddev);
>  	if (ret)
>  		goto err_unregister;
>  
> @@ -758,7 +723,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev)
>  {
>  	struct drm_device *ddev = platform_get_drvdata(pdev);
>  
> -	atmel_hlcdc_dc_connector_unplug_all(ddev);
> +	drm_connector_unregister_all(ddev);
>  	drm_dev_unregister(ddev);
>  	atmel_hlcdc_dc_unload(ddev);
>  	drm_dev_unref(ddev);



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-03-21 13:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 12:28 [PATCH 0/4 v2] drm: introduce drm_connector_register_all() helper Alexey Brodkin
2016-03-21 12:28 ` [PATCH 1/4 v2] drm: rename drm_connector_unplug_all() to drm_connector_unregister_all() Alexey Brodkin
2016-03-21 13:23   ` Laurent Pinchart
2016-03-21 12:28 ` [PATCH 2/4 v2] drm: introduce drm_connector_register_all() helper Alexey Brodkin
2016-03-21 13:33   ` Laurent Pinchart
2016-03-21 12:28 ` [PATCH 3/4 v2] drm: atmel_hldc - use generic " Alexey Brodkin
2016-03-21 13:10   ` Boris Brezillon [this message]
2016-03-21 12:28 ` [PATCH 4/4 v2] drm: rcar-du " Alexey Brodkin
2016-03-21 13:26   ` Laurent Pinchart

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=20160321141037.78822900@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox