mbox series

[0/3] pwm: Drop useless member "pwm" from struct pwm_device

Message ID 20230728145824.616687-1-u.kleine-koenig@pengutronix.de
Headers show
Series pwm: Drop useless member "pwm" from struct pwm_device | expand

Message

Uwe Kleine-König July 28, 2023, 2:58 p.m. UTC
Hello,

there are only two users of struct pwm_device::pwm in the tree; both use
it for some dev_dbg output. While this number allows to identify the
PWM, it's not trivial, for example the data currently available in
/sys/kernel/debug/pwm isn't enough. (You have to look in /sys/class/pwm,
pick the pwmchip with the highest number that isn't bigger than the
PWM's number.)

To be honest the label isn't always usefull either, but it's easy to use
and should be enough to identify the used PWM. The parent device + hwid
might be more useful?! On the other hand using that for a dev_dbg that
is probably only looked at by someone debugging the driver and thus
knowing the used PWM anyhow is of little value either.

Assuming this change is still considered worthwile I suggest that patches #1
and #2 go in via their respective maintainer trees and I resend patch #3 to go
via the pwm tree once these two are "in".

Best regards
Uwe

Uwe Kleine-König (3):
  drm/ssd130x: Print the PWM's label instead of its number
  video: fbdev: ssd1307fb: Print the PWM's label instead of its number
  pwm: Drop unused member "pwm" from struct pwm_device

 drivers/gpu/drm/solomon/ssd130x.c | 4 ++--
 drivers/pwm/core.c                | 1 -
 drivers/video/fbdev/ssd1307fb.c   | 4 ++--
 include/linux/pwm.h               | 1 -
 4 files changed, 4 insertions(+), 6 deletions(-)

base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5

Comments

Uwe Kleine-König Nov. 13, 2023, 9:28 p.m. UTC | #1
Hello,

On Fri, Jul 28, 2023 at 04:58:21PM +0200, Uwe Kleine-König wrote:
> there are only two users of struct pwm_device::pwm in the tree; both use
> it for some dev_dbg output. While this number allows to identify the
> PWM, it's not trivial, for example the data currently available in
> /sys/kernel/debug/pwm isn't enough. (You have to look in /sys/class/pwm,
> pick the pwmchip with the highest number that isn't bigger than the
> PWM's number.)
> 
> To be honest the label isn't always usefull either, but it's easy to use
> and should be enough to identify the used PWM. The parent device + hwid
> might be more useful?! On the other hand using that for a dev_dbg that
> is probably only looked at by someone debugging the driver and thus
> knowing the used PWM anyhow is of little value either.
> 
> Assuming this change is still considered worthwile I suggest that patches #1
> and #2 go in via their respective maintainer trees and I resend patch #3 to go
> via the pwm tree once these two are "in".
> 
> Best regards
> Uwe
> 
> Uwe Kleine-König (3):
>   drm/ssd130x: Print the PWM's label instead of its number
>   video: fbdev: ssd1307fb: Print the PWM's label instead of its number
>   pwm: Drop unused member "pwm" from struct pwm_device

The two patches to stop making use of struct pwm_device::pwm are now in
Linus's tree (as of v6.7-rc1). The third patch is still "new" in
patchwork, so I don't resend.

It's great if patch #3 goes in during the next merge window.

Best regards
Uwe