pwm: Provide an inline function to get the parent device of a given chip
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 14 Feb 2024 09:30:48 +0000 (10:30 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 15 Feb 2024 11:37:29 +0000 (12:37 +0100)
commit4e59267c7a20eb1c1ad9106e682cb6a0d8eb3111
tree46ff9d6257227c59bd4416d733a11f2eddf41f16
parenteb58bf4afd708eb3c64c7b9b2c5fbfacdcdee3e5
pwm: Provide an inline function to get the parent device of a given chip

Currently a pwm_chip stores in its struct device *dev member a pointer
to the parent device. Preparing a change that embeds a full struct
device in struct pwm_chip, this accessor function should be used in all
drivers directly accessing chip->dev now. This way struct pwm_chip and
this new function can be changed without having to touch all drivers in
the same change set.

Make use of this function in the framework's core sources.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/cc30090d2f9762bed9854a55612144bccc910781.1707900770.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
drivers/pwm/core.c
drivers/pwm/sysfs.c
include/linux/pwm.h