diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-02-14 10:31:40 +0100 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-02-19 11:04:10 +0100 |
commit | 07b61160e45d3f6694708e2f9891845713043625 (patch) | |
tree | b1a72183bc89ec81b85c56b394c2a87726e799fd /drivers/pwm/pwm-iqs620a.c | |
parent | 8a18b9733239f794cb5e53c876760302a21f804d (diff) | |
download | lwn-07b61160e45d3f6694708e2f9891845713043625.tar.gz lwn-07b61160e45d3f6694708e2f9891845713043625.zip |
pwm: iqs620a: Prepare removing pwm_chip from driver data
This prepares the driver for further changes that will drop struct
pwm_chip chip from struct iqs620_pwm_private. The only two functions
that make use of struct iqs620_pwm_private::chip (apart from the probe
function that is handled later when converting to pwmchip_alloc()) only
use the chip's device pointer. Introduce such a pointer in driver data
and use that instead.
Link: https://lore.kernel.org/r/e6b1636c0d26d8bcb02a66b2963e2cc394014d76.1707900770.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'drivers/pwm/pwm-iqs620a.c')
-rw-r--r-- | drivers/pwm/pwm-iqs620a.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pwm/pwm-iqs620a.c b/drivers/pwm/pwm-iqs620a.c index 98008cae6d70..faf52d3c2720 100644 --- a/drivers/pwm/pwm-iqs620a.c +++ b/drivers/pwm/pwm-iqs620a.c @@ -34,6 +34,7 @@ struct iqs620_pwm_private { struct iqs62x_core *iqs62x; + struct device *dev; struct pwm_chip chip; struct notifier_block notifier; struct mutex lock; @@ -160,7 +161,7 @@ static int iqs620_pwm_notifier(struct notifier_block *notifier, mutex_unlock(&iqs620_pwm->lock); if (ret) { - dev_err(iqs620_pwm->chip.dev, + dev_err(iqs620_pwm->dev, "Failed to re-initialize device: %d\n", ret); return NOTIFY_BAD; } @@ -181,7 +182,7 @@ static void iqs620_pwm_notifier_unregister(void *context) ret = blocking_notifier_chain_unregister(&iqs620_pwm->iqs62x->nh, &iqs620_pwm->notifier); if (ret) - dev_err(iqs620_pwm->chip.dev, + dev_err(iqs620_pwm->dev, "Failed to unregister notifier: %d\n", ret); } @@ -196,6 +197,7 @@ static int iqs620_pwm_probe(struct platform_device *pdev) if (!iqs620_pwm) return -ENOMEM; + iqs620_pwm->dev = &pdev->dev; iqs620_pwm->iqs62x = iqs62x; ret = regmap_read(iqs62x->regmap, IQS620_PWR_SETTINGS, &val); |