diff mbox series

[2/3] video: fbdev: ssd1307fb: Print the PWM's label instead of its number

Message ID 20230728145824.616687-3-u.kleine-koenig@pengutronix.de (mailing list archive)
State Accepted, archived
Headers show
Series pwm: Drop useless member "pwm" from struct pwm_device | expand

Commit Message

Uwe Kleine-König July 28, 2023, 2:58 p.m. UTC
struct pwm_device::pwm is a write-only variable in the pwm core and used
nowhere apart from this and another dev_dbg. So it isn't useful to
identify the used PWM. Emit the PWM's label instead in the debug
message.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/fbdev/ssd1307fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Javier Martinez Canillas July 28, 2023, 3:40 p.m. UTC | #1
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:

> struct pwm_device::pwm is a write-only variable in the pwm core and used
> nowhere apart from this and another dev_dbg. So it isn't useful to
> identify the used PWM. Emit the PWM's label instead in the debug
> message.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Helge Deller July 31, 2023, 12:42 p.m. UTC | #2
On 7/28/23 16:58, Uwe Kleine-König wrote:
> struct pwm_device::pwm is a write-only variable in the pwm core and used
> nowhere apart from this and another dev_dbg. So it isn't useful to
> identify the used PWM. Emit the PWM's label instead in the debug
> message.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

applied.

Thanks!
Helge

> ---
>   drivers/video/fbdev/ssd1307fb.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> index 11c373798279..46881a691549 100644
> --- a/drivers/video/fbdev/ssd1307fb.c
> +++ b/drivers/video/fbdev/ssd1307fb.c
> @@ -399,8 +399,8 @@ static int ssd1307fb_init(struct ssd1307fb_par *par)
>   		/* Enable the PWM */
>   		pwm_enable(par->pwm);
>
> -		dev_dbg(&par->client->dev, "Using PWM%d with a %lluns period.\n",
> -			par->pwm->pwm, pwm_get_period(par->pwm));
> +		dev_dbg(&par->client->dev, "Using PWM %s with a %lluns period.\n",
> +			par->pwm->label, pwm_get_period(par->pwm));
>   	}
>
>   	/* Set initial contrast */
Andy Shevchenko Aug. 1, 2023, 8:54 a.m. UTC | #3
On Fri, Jul 28, 2023 at 04:58:23PM +0200, Uwe Kleine-König wrote:
> struct pwm_device::pwm is a write-only variable in the pwm core and used
> nowhere apart from this and another dev_dbg. So it isn't useful to
> identify the used PWM. Emit the PWM's label instead in the debug
> message.

Do we have firmware node of PWM available? I would print it rather than some
(possibly non-unique) string.
Javier Martinez Canillas Sept. 9, 2023, 2:38 p.m. UTC | #4
Javier Martinez Canillas <javierm@redhat.com> writes:

> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
>
>> struct pwm_device::pwm is a write-only variable in the pwm core and used
>> nowhere apart from this and another dev_dbg. So it isn't useful to
>> identify the used PWM. Emit the PWM's label instead in the debug
>> message.
>>
>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>> ---
>
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
>

Pushed to drm-misc (drm-misc-next). Thanks!
Uwe Kleine-König Sept. 9, 2023, 8:21 p.m. UTC | #5
Hello,

On Sat, Sep 09, 2023 at 04:38:28PM +0200, Javier Martinez Canillas wrote:
> Javier Martinez Canillas <javierm@redhat.com> writes:
> 
> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
> >
> >> struct pwm_device::pwm is a write-only variable in the pwm core and used
> >> nowhere apart from this and another dev_dbg. So it isn't useful to
> >> identify the used PWM. Emit the PWM's label instead in the debug
> >> message.
> >>
> >> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >> ---
> >
> > Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> >
> 
> Pushed to drm-misc (drm-misc-next). Thanks!

JFTR: This patch is already in linus/master. And Javier pushed
"drm/ssd130x: Print the PWM's label instead of its number" to
drm-misc-next which is great. So the "Pushed to ..." mail is just in
reply to the wrong patch in this thread and in git everything is fine.

Thanks
Uwe
Javier Martinez Canillas Sept. 10, 2023, 6:58 a.m. UTC | #6
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:

Hello Uwe,

> Hello,
>
> On Sat, Sep 09, 2023 at 04:38:28PM +0200, Javier Martinez Canillas wrote:
>> Javier Martinez Canillas <javierm@redhat.com> writes:
>> 
>> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
>> >
>> >> struct pwm_device::pwm is a write-only variable in the pwm core and used
>> >> nowhere apart from this and another dev_dbg. So it isn't useful to
>> >> identify the used PWM. Emit the PWM's label instead in the debug
>> >> message.
>> >>
>> >> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>> >> ---
>> >
>> > Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
>> >
>> 
>> Pushed to drm-misc (drm-misc-next). Thanks!
>
> JFTR: This patch is already in linus/master. And Javier pushed
> "drm/ssd130x: Print the PWM's label instead of its number" to
> drm-misc-next which is great. So the "Pushed to ..." mail is just in
> reply to the wrong patch in this thread and in git everything is fine.
>

Ups, that's correct. Thanks a lot for pointing that out!

> Thanks
> Uwe
>
diff mbox series

Patch

diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index 11c373798279..46881a691549 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -399,8 +399,8 @@  static int ssd1307fb_init(struct ssd1307fb_par *par)
 		/* Enable the PWM */
 		pwm_enable(par->pwm);
 
-		dev_dbg(&par->client->dev, "Using PWM%d with a %lluns period.\n",
-			par->pwm->pwm, pwm_get_period(par->pwm));
+		dev_dbg(&par->client->dev, "Using PWM %s with a %lluns period.\n",
+			par->pwm->label, pwm_get_period(par->pwm));
 	}
 
 	/* Set initial contrast */