diff mbox series

[v5,3/3] drm/bridge/analogix/anx78xx: Drop conditionals around of_node pointers

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

Commit Message

Biju Das Aug. 30, 2023, 5:08 p.m. UTC
Having conditional around the of_node pointers turns out to make driver
code use ugly #ifdef and #if blocks. So drop the conditionals.

Suggested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v5:
 * Split from patch#2
---
 drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Doug Anderson Aug. 30, 2023, 7:53 p.m. UTC | #1
Hi,

On Wed, Aug 30, 2023 at 10:08 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
>
> Having conditional around the of_node pointers turns out to make driver
> code use ugly #ifdef and #if blocks. So drop the conditionals.
>
> Suggested-by: Douglas Anderson <dianders@chromium.org>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v5:
>  * Split from patch#2
> ---
>  drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 2 --
>  1 file changed, 2 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

My current plan, assuming no objections, will be to apply all 3
patches to drm-misc-next in about a week. I'd also be fine if someone
else wanted to apply then. ;-)
Laurent Pinchart Aug. 30, 2023, 8:41 p.m. UTC | #2
Hi Biju,

Thank you for the patch.

On Wed, Aug 30, 2023 at 06:08:19PM +0100, Biju Das wrote:
> Having conditional around the of_node pointers turns out to make driver
> code use ugly #ifdef and #if blocks. So drop the conditionals.

How about doing this for all bridge drivers in one go ?

> Suggested-by: Douglas Anderson <dianders@chromium.org>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v5:
>  * Split from patch#2
> ---
>  drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
> index 6169db73d2fe..ad8241758896 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
> @@ -1231,9 +1231,7 @@ static int anx78xx_i2c_probe(struct i2c_client *client)
>  
>  	mutex_init(&anx78xx->lock);
>  
> -#if IS_ENABLED(CONFIG_OF)
>  	anx78xx->bridge.of_node = client->dev.of_node;
> -#endif
>  
>  	anx78xx->client = client;
>  	i2c_set_clientdata(client, anx78xx);
Biju Das Aug. 31, 2023, 6:52 a.m. UTC | #3
Hi Laurent,

Thanks for the feedback.

> Subject: Re: [PATCH v5 3/3] drm/bridge/analogix/anx78xx: Drop conditionals
> around of_node pointers
> 
> Hi Biju,
> 
> Thank you for the patch.
> 
> On Wed, Aug 30, 2023 at 06:08:19PM +0100, Biju Das wrote:
> > Having conditional around the of_node pointers turns out to make
> > driver code use ugly #ifdef and #if blocks. So drop the conditionals.
> 
> How about doing this for all bridge drivers in one go ?

I will send separate patch for that one later.

Will send V6 with changes suggested for patch#2 first and then will investigate creating patch for dropping conditionals for remaining bridge drivers.

Cheers,
Biju

> 
> > Suggested-by: Douglas Anderson <dianders@chromium.org>
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v5:
> >  * Split from patch#2
> > ---
> >  drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
> > b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
> > index 6169db73d2fe..ad8241758896 100644
> > --- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
> > +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
> > @@ -1231,9 +1231,7 @@ static int anx78xx_i2c_probe(struct i2c_client
> > *client)
> >
> >  	mutex_init(&anx78xx->lock);
> >
> > -#if IS_ENABLED(CONFIG_OF)
> >  	anx78xx->bridge.of_node = client->dev.of_node; -#endif
> >
> >  	anx78xx->client = client;
> >  	i2c_set_clientdata(client, anx78xx);
> 
> --
> Regards,
> 
> Laurent Pinchart
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
index 6169db73d2fe..ad8241758896 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
@@ -1231,9 +1231,7 @@  static int anx78xx_i2c_probe(struct i2c_client *client)
 
 	mutex_init(&anx78xx->lock);
 
-#if IS_ENABLED(CONFIG_OF)
 	anx78xx->bridge.of_node = client->dev.of_node;
-#endif
 
 	anx78xx->client = client;
 	i2c_set_clientdata(client, anx78xx);