[PATCH 10/10] drm/fb-helper: Remove return value from drm_fbdev_generic_setup()
Sam Ravnborg
sam at ravnborg.org
Tue Apr 7 10:16:01 UTC 2020
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 at suse.de>
If this goes in as-is then it is:
Reviewed-by: Sam Ravnborg <sam at 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
More information about the dri-devel
mailing list