public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Louis Chauvet <louis.chauvet@bootlin.com>
Cc: "Rodrigo Siqueira" <rodrigosiqueiramelo@gmail.com>,
	"Melissa Wen" <melissa.srw@gmail.com>,
	"Maíra Canal" <mairacanal@riseup.net>,
	"Haneen Mohammed" <hamohammed.sa@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	dri-devel@lists.freedesktop.org, arthurgrillo@riseup.net,
	linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com,
	miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com,
	seanpaul@google.com, nicolejadeyee@google.com
Subject: Re: [PATCH RFC 01/15] drm/vkms: Remove useles devres group
Date: Mon, 19 Aug 2024 16:23:10 +0200	[thread overview]
Message-ID: <ZsNVTtigz4F4-npb@phenom.ffwll.local> (raw)
In-Reply-To: <20240814-google-remove-crtc-index-from-parameter-v1-1-6e179abf9fd4@bootlin.com>

On Wed, Aug 14, 2024 at 04:36:23PM +0200, Louis Chauvet wrote:
> As the driver now uses drm managed allocation, the devres group is not
> needed anymore, so remove it.

drmm isn't devres, and you still have a devres managed resource here,
namely devm_drm_dev_alloc. The reason I suggest in the review on google's
series for configfs to nuke this is that they switched over to making vkms
a proper platform driver, in which case you get a devres group
automatically for your driver binding.

But neither the explicit one or the driver binding is one devres too few
:-)

Cheers, Sima
> 
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
> ---
>  drivers/gpu/drm/vkms/vkms_drv.c | 18 +++++-------------
>  1 file changed, 5 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> index e79832e10f3c..7ac3ab7e16e5 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.c
> +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> @@ -297,16 +297,11 @@ static int vkms_create(struct vkms_config *config)
>  	if (IS_ERR(pdev))
>  		return PTR_ERR(pdev);
>  
> -	if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) {
> -		ret = -ENOMEM;
> -		goto out_unregister;
> -	}
> -
>  	vkms_device = devm_drm_dev_alloc(&pdev->dev, &vkms_driver,
>  					 struct vkms_device, drm);
>  	if (IS_ERR(vkms_device)) {
>  		ret = PTR_ERR(vkms_device);
> -		goto out_devres;
> +		goto out_unregister;
>  	}
>  	vkms_device->platform = pdev;
>  	vkms_device->config = config;
> @@ -317,32 +312,30 @@ static int vkms_create(struct vkms_config *config)
>  
>  	if (ret) {
>  		DRM_ERROR("Could not initialize DMA support\n");
> -		goto out_devres;
> +		goto out_unregister;
>  	}
>  
>  	ret = drm_vblank_init(&vkms_device->drm, 1);
>  	if (ret) {
>  		DRM_ERROR("Failed to vblank\n");
> -		goto out_devres;
> +		goto out_unregister;
>  	}
>  
>  	ret = vkms_modeset_init(vkms_device);
>  	if (ret)
> -		goto out_devres;
> +		goto out_unregister;
>  
>  	drm_debugfs_add_files(&vkms_device->drm, vkms_config_debugfs_list,
>  			      ARRAY_SIZE(vkms_config_debugfs_list));
>  
>  	ret = drm_dev_register(&vkms_device->drm, 0);
>  	if (ret)
> -		goto out_devres;
> +		goto out_unregister;
>  
>  	drm_fbdev_shmem_setup(&vkms_device->drm, 0);
>  
>  	return 0;
>  
> -out_devres:
> -	devres_release_group(&pdev->dev, NULL);
>  out_unregister:
>  	platform_device_unregister(pdev);
>  	return ret;
> @@ -383,7 +376,6 @@ static void vkms_destroy(struct vkms_config *config)
>  
>  	drm_dev_unregister(&config->dev->drm);
>  	drm_atomic_helper_shutdown(&config->dev->drm);
> -	devres_release_group(&pdev->dev, NULL);
>  	platform_device_unregister(pdev);
>  
>  	config->dev = NULL;
> 
> -- 
> 2.44.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2024-08-19 14:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 14:36 [PATCH RFC 00/15] drm/vkms: Introduce detailed configuration Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 01/15] drm/vkms: Remove useles devres group Louis Chauvet
2024-08-19 14:23   ` Daniel Vetter [this message]
2024-08-14 14:36 ` [PATCH RFC 02/15] drm/vkms: remove possible crtc from parameters Louis Chauvet
2024-09-05 12:33   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 03/15] drm/vkms: Extract vkms_config header Louis Chauvet
2024-09-05 12:33   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 04/15] drm/vkms: Add a validation function for vkms configuration Louis Chauvet
2024-09-05 12:33   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 05/15] drm/vkms: Move default_config creation to its own function Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 06/15] drm/vkms: Introduce plane configuration Louis Chauvet
2024-09-05 12:33   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 07/15] drm/vkms: Introduce plane name configuration Louis Chauvet
2024-09-05 12:34   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 08/15] drm/vkms: Introduce plane rotation configuration Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 09/15] drm/vkms: Introduce configuration for plane color encoding Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 10/15] drm/vkms: Introduce configuration for plane color range Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 11/15] drm: writeback: Add drm_writeback_connector cleanup Louis Chauvet
2024-08-27 14:33   ` Maxime Ripard
2024-08-27 15:42     ` Louis Chauvet
2024-08-28  8:35       ` Jani Nikula
2024-08-28  9:07         ` Louis Chauvet
2024-08-28 15:17           ` Maxime Ripard
2024-08-14 14:36 ` [PATCH RFC 12/15] drm/vkms: Add configuration for CRTCs and encoders Louis Chauvet
2024-09-05 12:34   ` José Expósito
2024-08-14 14:36 ` [PATCH RFC 13/15] drm/vkms: Add name configuration for encoders Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 14/15] drm/vkms: Add name configuration for CRTCs Louis Chauvet
2024-08-14 14:36 ` [PATCH RFC 15/15] drm/vkms: Add test for config structure Louis Chauvet

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=ZsNVTtigz4F4-npb@phenom.ffwll.local \
    --to=daniel.vetter@ffwll.ch \
    --cc=airlied@gmail.com \
    --cc=arthurgrillo@riseup.net \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=jeremie.dautheribes@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=louis.chauvet@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mairacanal@riseup.net \
    --cc=melissa.srw@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=mripard@kernel.org \
    --cc=nicolejadeyee@google.com \
    --cc=rodrigosiqueiramelo@gmail.com \
    --cc=seanpaul@google.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tzimmermann@suse.de \
    /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