diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-02-14 12:30:52 +0300 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-02-15 14:59:19 +0300 |
commit | 96af28dc44b9a13c04d6b70a9ad5a8fa0daf1d67 (patch) | |
tree | abe772420bfb7f46509354a0a5f8d19bebcfb374 /drivers/pwm/pwm-ab8500.c | |
parent | ddabe9093c172445c133dd2a46fb01ac265a8f8d (diff) | |
download | linux-96af28dc44b9a13c04d6b70a9ad5a8fa0daf1d67.tar.xz |
pwm: ab8500: Introduce a local pwm_chip variable in .probe()
This simplifies converting the driver to pwmchip_alloc() as there is only
a single code line left that makes use of struct ab8500_pwm_chip::chip.
Link: https://lore.kernel.org/r/7fae4833b97728abc8bd400663fdd331c86a761b.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-ab8500.c')
-rw-r--r-- | drivers/pwm/pwm-ab8500.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/pwm/pwm-ab8500.c b/drivers/pwm/pwm-ab8500.c index 719e4ccf1800..9043e5643f44 100644 --- a/drivers/pwm/pwm-ab8500.c +++ b/drivers/pwm/pwm-ab8500.c @@ -185,6 +185,7 @@ static const struct pwm_ops ab8500_pwm_ops = { static int ab8500_pwm_probe(struct platform_device *pdev) { + struct pwm_chip *chip; struct ab8500_pwm_chip *ab8500; int err; @@ -199,12 +200,13 @@ static int ab8500_pwm_probe(struct platform_device *pdev) if (ab8500 == NULL) return -ENOMEM; - ab8500->chip.dev = &pdev->dev; - ab8500->chip.ops = &ab8500_pwm_ops; - ab8500->chip.npwm = 1; + chip = &ab8500->chip; + chip->dev = &pdev->dev; + chip->ops = &ab8500_pwm_ops; + chip->npwm = 1; ab8500->hwid = pdev->id - 1; - err = devm_pwmchip_add(&pdev->dev, &ab8500->chip); + err = devm_pwmchip_add(&pdev->dev, chip); if (err < 0) return dev_err_probe(&pdev->dev, err, "Failed to add pwm chip\n"); |