[PATCH] drm/sysfb: Fix unused function simpledrm_device_of_dev()

Thomas Zimmermann tzimmermann at suse.de
Mon Apr 7 13:23:07 UTC 2025


Hi,

thanks for the patch.

Am 07.04.25 um 15:13 schrieb Jocelyn Falempe:
> When building with clang, with CONFIG_OF unset, I got the following
> error:
>
> drivers/gpu/drm/sysfb/simpledrm.c:247:33: error: unused function 'simpledrm_device_of_dev' [-Werror,-Wunused-function]
>    247 | static struct simpledrm_device *simpledrm_device_of_dev(struct drm_device *dev)
>
> Add #if to define the function only when needed.
>
> Signed-off-by: Jocelyn Falempe <jfalempe at redhat.com>
> Fixes: 177dfbdb7e67 ("drm/sysfb: Merge primary-plane functions")
> ---
>   drivers/gpu/drm/sysfb/simpledrm.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/sysfb/simpledrm.c b/drivers/gpu/drm/sysfb/simpledrm.c
> index cfb1fe07704d..82b1a669a42e 100644
> --- a/drivers/gpu/drm/sysfb/simpledrm.c
> +++ b/drivers/gpu/drm/sysfb/simpledrm.c
> @@ -244,10 +244,12 @@ struct simpledrm_device {
>   	struct drm_connector connector;
>   };
>   
> +#if defined CONFIG_OF && (defined CONFIG_COMMON_CLK || defined CONFIG_REGULATOR)
>   static struct simpledrm_device *simpledrm_device_of_dev(struct drm_device *dev)
>   {
>   	return container_of(to_drm_sysfb_device(dev), struct simpledrm_device, sysfb);
>   }
> +#endif
>   
>   /*
>    * Hardware

There's the same #if right below this comment. Please move the function 
there.

The helper used to be used throughout  the driver, but that is no longer 
the case. Apologies for missing it.

Best regards
Thomas

>
> base-commit: fbe43810d563a293e3de301141d33caf1f5d5c5a

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)



More information about the dri-devel mailing list