pwm: Give some sysfs related variables and functions better names
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sun, 17 Mar 2024 10:40:33 +0000 (11:40 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 26 Apr 2024 19:29:17 +0000 (21:29 +0200)
commitb40ac0e176bf2c83c78cf72fd64a42be2f9b9638
treefdf68f5e1a21c2d248236df5ad7a164fb37ec988
parent7db42aa2b629de0a103f603f41c5b0929c66ccda
pwm: Give some sysfs related variables and functions better names

The code handling the sysfs API uses "child" and "parent" to refer to
the devices corresponding to a struct pwm or a struct pwm_chip
respectively.

Other parts of the pwm core use "parent" to refer to the parent device of
a struct pwm_chip.

So rename "child" to "pwm_dev" and "parent" to "pwmchip_dev" which
better explains the semantic. Also two functions are changed to match
the new names:

        child_to_pwm_export() -> pwmexport_from_dev()
        child_to_pwm_device() -> pwm_from_dev()

(which have the additional advantage to start with "pwm" which gives the
right scope). Additionally introduce a wrapper for dev_get_drvdata() to
convert a pwmchip_dev to the respective pwm_chip.

Link: https://lore.kernel.org/r/9cc05aceeae2f06ecb850bccb15ba821e768c183.1710670958.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
drivers/pwm/sysfs.c