diff mbox series

[v6,4/4] drm/bridge: panel: Drop CONFIG_OF conditional around *_of_get_bridge()

Message ID 20230831080938.47454-5-biju.das.jz@bp.renesas.com (mailing list archive)
State New, archived
Headers show
Series Drop ID table and conditionals around of_node pointers | expand

Commit Message

Biju Das Aug. 31, 2023, 8:09 a.m. UTC
Drop unnecessary CONFIG_OF conditional around devm_drm_of_get_bridge() and
drmm_of_get_bridge() as it is guarded with #if..#else blocks in
drm_bridge.h.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v6:
 * New patch.
---
 drivers/gpu/drm/bridge/panel.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Laurent Pinchart Aug. 31, 2023, 9:31 a.m. UTC | #1
On Thu, Aug 31, 2023 at 09:09:38AM +0100, Biju Das wrote:
> Drop unnecessary CONFIG_OF conditional around devm_drm_of_get_bridge() and
> drmm_of_get_bridge() as it is guarded with #if..#else blocks in
> drm_bridge.h.

This will increase the kernel size on non-OF system, to add functions
that are not used. I don't think the #ifdef here is problematic.

> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v6:
>  * New patch.
> ---
>  drivers/gpu/drm/bridge/panel.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
> index 7f41525f7a6e..9220a1c23697 100644
> --- a/drivers/gpu/drm/bridge/panel.c
> +++ b/drivers/gpu/drm/bridge/panel.c
> @@ -482,7 +482,6 @@ struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge)
>  }
>  EXPORT_SYMBOL(drm_panel_bridge_connector);
>  
> -#ifdef CONFIG_OF
>  /**
>   * devm_drm_of_get_bridge - Return next bridge in the chain
>   * @dev: device to tie the bridge lifetime to
> @@ -550,5 +549,3 @@ struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm,
>  	return bridge;
>  }
>  EXPORT_SYMBOL(drmm_of_get_bridge);
> -
> -#endif
Biju Das Aug. 31, 2023, 10:47 a.m. UTC | #2
Hi Laurent Pinchart,

> Subject: Re: [PATCH v6 4/4] drm/bridge: panel: Drop CONFIG_OF conditional
> around *_of_get_bridge()
> 
> On Thu, Aug 31, 2023 at 09:09:38AM +0100, Biju Das wrote:
> > Drop unnecessary CONFIG_OF conditional around devm_drm_of_get_bridge()
> > and
> > drmm_of_get_bridge() as it is guarded with #if..#else blocks in
> > drm_bridge.h.
> 
> This will increase the kernel size on non-OF system, to add functions that
> are not used. I don't think the #ifdef here is problematic.

OK agreed. I guess for NON-OF system it will give build error
for function redefinition, if that is the case I would like to
drop this patch.

static inline struct drm_bridge *devm_drm_of_get_bridge()

vs

struct drm_bridge *devm_drm_of_get_bridge()


Cheers,
Biju

> 
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v6:
> >  * New patch.
> > ---
> >  drivers/gpu/drm/bridge/panel.c | 3 ---
> >  1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/panel.c
> > b/drivers/gpu/drm/bridge/panel.c index 7f41525f7a6e..9220a1c23697
> > 100644
> > --- a/drivers/gpu/drm/bridge/panel.c
> > +++ b/drivers/gpu/drm/bridge/panel.c
> > @@ -482,7 +482,6 @@ struct drm_connector
> > *drm_panel_bridge_connector(struct drm_bridge *bridge)  }
> > EXPORT_SYMBOL(drm_panel_bridge_connector);
> >
> > -#ifdef CONFIG_OF
> >  /**
> >   * devm_drm_of_get_bridge - Return next bridge in the chain
> >   * @dev: device to tie the bridge lifetime to @@ -550,5 +549,3 @@
> > struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm,
> >  	return bridge;
> >  }
> >  EXPORT_SYMBOL(drmm_of_get_bridge);
> > -
> > -#endif
> 
> --
> Regards,
> 
> Laurent Pinchart
Andy Shevchenko Aug. 31, 2023, 4:16 p.m. UTC | #3
On Thu, Aug 31, 2023 at 10:47:24AM +0000, Biju Das wrote:
> > On Thu, Aug 31, 2023 at 09:09:38AM +0100, Biju Das wrote:

...

> > > Drop unnecessary CONFIG_OF conditional around devm_drm_of_get_bridge()
> > > and
> > > drmm_of_get_bridge() as it is guarded with #if..#else blocks in
> > > drm_bridge.h.
> > 
> > This will increase the kernel size on non-OF system, to add functions that
> > are not used. I don't think the #ifdef here is problematic.
> 
> OK agreed. I guess for NON-OF system it will give build error
> for function redefinition, if that is the case I would like to
> drop this patch.
> 
> static inline struct drm_bridge *devm_drm_of_get_bridge()
> 
> vs
> 
> struct drm_bridge *devm_drm_of_get_bridge()

Yeah, yet another argument in favour of switching to fwnode.
Doug Anderson Sept. 6, 2023, 3:42 p.m. UTC | #4
Hi,

On Thu, Aug 31, 2023 at 1:10 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
>
> Drop unnecessary CONFIG_OF conditional around devm_drm_of_get_bridge() and
> drmm_of_get_bridge() as it is guarded with #if..#else blocks in
> drm_bridge.h.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v6:
>  * New patch.
> ---
>  drivers/gpu/drm/bridge/panel.c | 3 ---
>  1 file changed, 3 deletions(-)

Just to be explicit, I'm _not_ landing this patch though I've landed
patches #1 - #3 from this series.


-Doug
Biju Das Sept. 6, 2023, 6:15 p.m. UTC | #5
Hi Doug Anderson,

> Subject: Re: [PATCH v6 4/4] drm/bridge: panel: Drop CONFIG_OF conditional
> around *_of_get_bridge()
> 
> Hi,
> 
> On Thu, Aug 31, 2023 at 1:10 AM Biju Das <biju.das.jz@bp.renesas.com>
> wrote:
> >
> > Drop unnecessary CONFIG_OF conditional around devm_drm_of_get_bridge()
> > and
> > drmm_of_get_bridge() as it is guarded with #if..#else blocks in
> > drm_bridge.h.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v6:
> >  * New patch.
> > ---
> >  drivers/gpu/drm/bridge/panel.c | 3 ---
> >  1 file changed, 3 deletions(-)
> 
> Just to be explicit, I'm _not_ landing this patch though I've landed
> patches #1 - #3 from this series.

Thank you.

Cheers,
Biju
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
index 7f41525f7a6e..9220a1c23697 100644
--- a/drivers/gpu/drm/bridge/panel.c
+++ b/drivers/gpu/drm/bridge/panel.c
@@ -482,7 +482,6 @@  struct drm_connector *drm_panel_bridge_connector(struct drm_bridge *bridge)
 }
 EXPORT_SYMBOL(drm_panel_bridge_connector);
 
-#ifdef CONFIG_OF
 /**
  * devm_drm_of_get_bridge - Return next bridge in the chain
  * @dev: device to tie the bridge lifetime to
@@ -550,5 +549,3 @@  struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm,
 	return bridge;
 }
 EXPORT_SYMBOL(drmm_of_get_bridge);
-
-#endif