[PATCH] drm/bridge: fix build with CONFIG_OF=n
Borah, Chaitanya Kumar
chaitanya.kumar.borah at intel.com
Thu May 22 07:58:57 UTC 2025
> -----Original Message-----
> From: dri-devel <dri-devel-bounces at lists.freedesktop.org> On Behalf Of Luca
> Ceresoli
> Sent: Thursday, May 22, 2025 12:43 PM
> To: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>; Maxime Ripard
> <mripard at kernel.org>; Thomas Zimmermann <tzimmermann at suse.de>;
> Hajda, Andrzej <andrzej.hajda at intel.com>; Neil Armstrong
> <neil.armstrong at linaro.org>; Robert Foss <rfoss at kernel.org>; Laurent
> Pinchart <Laurent.pinchart at ideasonboard.com>; Jonas Karlman
> <jonas at kwiboo.se>; Jernej Skrabec <jernej.skrabec at gmail.com>; David
> Airlie <airlied at gmail.com>; Simona Vetter <simona at ffwll.ch>; Ville Syrjala
> <ville.syrjala at linux.intel.com>
> Cc: Thomas Petazzoni <thomas.petazzoni at bootlin.com>; dri-
> devel at lists.freedesktop.org; linux-kernel at vger.kernel.org; Luca Ceresoli
> <luca.ceresoli at bootlin.com>
> Subject: [PATCH] drm/bridge: fix build with CONFIG_OF=n
>
> Commit 5164553d739e ("drm/bridge: add devm_drm_put_bridge()") adds
> two declarations for devm_drm_put_bridge():
>
> 1) an inline declaration in the #else branch of
> '#if defined(CONFIG_OF)...'
> 2) one outside of the same #if
>
> This results in a build failure with CONFIG_OF=n:
>
> ../drivers/gpu/drm/drm_bridge.c:1406:6: error: redefinition of
> ‘devm_drm_put_bridge’
>
> The function has nothing to do with OF, thus fix by removing declaration 1.
LGTM. Fixes the build error.
Tested-by: Chaitanya Kumar Borah <chaitanya.kumar.borah at intel.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah at intel.com>
>
> Fixes: 5164553d739e ("drm/bridge: add devm_drm_put_bridge()")
> Reported-by: Ville Syrjala <ville.syrjala at linux.intel.com>
> Closes: https://oftc.catirclogs.org/dri-devel/2025-05-21#34288266;
> Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>
> ---
> include/drm/drm_bridge.h | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index
> 464da28f9134f0fcece5c72a8c5fe7f3e42c7e3d..0af5db244db8580ea0c9af1d9a
> 373b7bf62ee699 100644
> --- a/include/drm/drm_bridge.h
> +++ b/include/drm/drm_bridge.h
> @@ -1311,8 +1311,6 @@ static inline struct drm_bridge
> *devm_drm_of_get_bridge(struct device *dev,
> return ERR_PTR(-ENODEV);
> }
>
> -static inline void devm_drm_put_bridge(struct device *dev, struct
> drm_bridge *bridge) {}
> -
> static inline struct drm_bridge *drmm_of_get_bridge(struct drm_device
> *drm,
> struct device_node *node,
> u32 port,
>
> ---
> base-commit: a3436f63aa4f93b043a970cc72a196a501191ecc
> change-id: 20250522-devm_drm_put_bridge-fix-non-of-build-fbb67d28494c
>
> Best regards,
> --
> Luca Ceresoli <luca.ceresoli at bootlin.com>
More information about the dri-devel
mailing list