dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: airlied@linux.ie, dri-devel@lists.freedesktop.org,
	paul@crapouillou.net, kraxel@redhat.com,
	emil.velikov@collabora.com, xinliang.liu@linaro.org,
	kong.kongxinwei@hisilicon.com, tomi.valkeinen@ti.com,
	chunkuang.hu@kernel.org, puck.chen@hisilicon.com,
	hdegoede@redhat.com, jsarha@ti.com, matthias.bgg@gmail.com,
	sean@poorly.run, zourongrong@gmail.com, tiantao6@hisilicon.com
Subject: Re: [PATCH 10/10] drm/fb-helper: Remove return value from drm_fbdev_generic_setup()
Date: Tue, 7 Apr 2020 12:16:01 +0200	[thread overview]
Message-ID: <20200407101601.GB12686@ravnborg.org> (raw)
In-Reply-To: <20200406134405.6232-11-tzimmermann@suse.de>

Hi Thomas.

On Mon, Apr 06, 2020 at 03:44:05PM +0200, Thomas Zimmermann wrote:
> Generic fbdev emulation is a DRM client. Drivers should invoke the
> setup function, but not depend on its success. Hence remove the return
> value.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

If this goes in as-is then it is:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

You could apply the series now to avoid letting a doc update
postponse the others.
And then make the doc update a follow-up patch.

	Sam


> ---
>  drivers/gpu/drm/drm_fb_helper.c | 18 ++++++++----------
>  include/drm/drm_fb_helper.h     |  5 +++--
>  2 files changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 165c8dab50797..24db97eee53d4 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -2186,11 +2186,9 @@ static const struct drm_client_funcs drm_fbdev_client_funcs = {
>   * Setup will be retried on the next hotplug event.
>   *
>   * The fbdev is destroyed by drm_dev_unregister().
> - *
> - * Returns:
> - * Zero on success or negative error code on failure.
>   */
> -int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)
> +void drm_fbdev_generic_setup(struct drm_device *dev,
> +			     unsigned int preferred_bpp)
>  {
>  	struct drm_fb_helper *fb_helper;
>  	int ret;
> @@ -2198,17 +2196,19 @@ int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)
>  	WARN(dev->fb_helper, "fb_helper is already set!\n");
>  
>  	if (!drm_fbdev_emulation)
> -		return 0;
> +		return;
>  
>  	fb_helper = kzalloc(sizeof(*fb_helper), GFP_KERNEL);
> -	if (!fb_helper)
> -		return -ENOMEM;
> +	if (!fb_helper) {
> +		drm_err(dev, "Failed to allocate fb_helper\n");
> +		return;
> +	}
>  
>  	ret = drm_client_init(dev, &fb_helper->client, "fbdev", &drm_fbdev_client_funcs);
>  	if (ret) {
>  		kfree(fb_helper);
>  		drm_err(dev, "Failed to register client: %d\n", ret);
> -		return ret;
> +		return;
>  	}
>  
>  	if (!preferred_bpp)
> @@ -2222,8 +2222,6 @@ int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)
>  		drm_dbg_kms(dev, "client hotplug ret=%d\n", ret);
>  
>  	drm_client_register(&fb_helper->client);
> -
> -	return 0;
>  }
>  EXPORT_SYMBOL(drm_fbdev_generic_setup);
>  
> diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
> index 208dbf87afa3e..fb037be83997d 100644
> --- a/include/drm/drm_fb_helper.h
> +++ b/include/drm/drm_fb_helper.h
> @@ -269,7 +269,8 @@ int drm_fb_helper_debug_leave(struct fb_info *info);
>  void drm_fb_helper_lastclose(struct drm_device *dev);
>  void drm_fb_helper_output_poll_changed(struct drm_device *dev);
>  
> -int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp);
> +void drm_fbdev_generic_setup(struct drm_device *dev,
> +			     unsigned int preferred_bpp);
>  #else
>  static inline void drm_fb_helper_prepare(struct drm_device *dev,
>  					struct drm_fb_helper *helper,
> @@ -443,7 +444,7 @@ static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev)
>  {
>  }
>  
> -static inline int
> +static inline void
>  drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)
>  {
>  	return 0;
> -- 
> 2.26.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-04-07 10:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 13:43 [PATCH 00/10] Set up generic fbdev after registering device Thomas Zimmermann
2020-04-06 13:43 ` [PATCH 01/10] drm/ast: Set up fbdev after registering device; remove error checks Thomas Zimmermann
2020-04-06 13:43 ` [PATCH 02/10] drm/hibmc: Remove error check from fbdev setup Thomas Zimmermann
2020-04-06 13:43 ` [PATCH 03/10] drm/kirin: Set up fbdev after fully registering device Thomas Zimmermann
2020-04-07  8:04   ` Daniel Vetter
2020-04-07 13:19     ` Thomas Zimmermann
2020-04-06 13:43 ` [PATCH 04/10] drm/ingenic: Remove error check from fbdev setup Thomas Zimmermann
2020-04-06 23:45   ` Paul Cercueil
2020-04-06 13:44 ` [PATCH 05/10] drm/mediathek: " Thomas Zimmermann
2020-04-07 11:04   ` Noralf Trønnes
2020-04-06 13:44 ` [PATCH 06/10] drm/mgag200: Set up fbdev after registering device; remove error checks Thomas Zimmermann
2020-04-06 13:44 ` [PATCH 07/10] drm/tilcdc: Set up fbdev after fully registering device Thomas Zimmermann
2020-04-07 11:59   ` Jyri Sarha
2020-04-06 13:44 ` [PATCH 08/10] drm/udl: Remove error check from fbdev setup Thomas Zimmermann
2020-04-06 13:44 ` [PATCH 09/10] drm/vboxvideo: Set up fbdev after registering device; remove error checks Thomas Zimmermann
2020-04-06 13:44 ` [PATCH 10/10] drm/fb-helper: Remove return value from drm_fbdev_generic_setup() Thomas Zimmermann
2020-04-07 10:16   ` Sam Ravnborg [this message]
2020-04-06 20:00 ` [PATCH 00/10] Set up generic fbdev after registering device Sam Ravnborg
2020-04-07  6:28   ` Thomas Zimmermann
2020-04-07  7:24     ` Jani Nikula
2020-04-08  7:55       ` Thomas Zimmermann
2020-04-07 10:13     ` Sam Ravnborg
2020-04-07  7:21 ` Gerd Hoffmann
2020-04-07 11:02 ` Noralf Trønnes
2020-04-07 13:00   ` Thomas Zimmermann
2020-04-07 16:50     ` Sam Ravnborg
2020-04-08  6:28       ` Thomas Zimmermann

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=20200407101601.GB12686@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=airlied@linux.ie \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.velikov@collabora.com \
    --cc=hdegoede@redhat.com \
    --cc=jsarha@ti.com \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=kraxel@redhat.com \
    --cc=matthias.bgg@gmail.com \
    --cc=paul@crapouillou.net \
    --cc=puck.chen@hisilicon.com \
    --cc=sean@poorly.run \
    --cc=tiantao6@hisilicon.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=tzimmermann@suse.de \
    --cc=xinliang.liu@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox