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>
This commit is contained in:
parent
8a18b97332
commit
07b61160e4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user