diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-09-27 19:24:17 +0300 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2022-09-28 16:10:35 +0200 |
commit | 68af6fb00f2f1e72521169d5a4283faa8533694d (patch) | |
tree | 599631015b94849bcb0304e58fb3b8d2c6edaebe /drivers/pwm/pwm-lpss-platform.c | |
parent | a3682d2fe3c36c68899bf1b956ed68d36d005868 (diff) | |
download | linux-68af6fb00f2f1e72521169d5a4283faa8533694d.tar.gz linux-68af6fb00f2f1e72521169d5a4283faa8533694d.tar.bz2 linux-68af6fb00f2f1e72521169d5a4283faa8533694d.zip |
pwm: lpss: Move resource mapping to the glue drivers
Move resource mapping to the glue drivers which helps
to transform pwm_lpss_probe() to pure library function
that may be used by others without need of specific
resource management.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-lpss-platform.c')
-rw-r--r-- | drivers/pwm/pwm-lpss-platform.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pwm/pwm-lpss-platform.c b/drivers/pwm/pwm-lpss-platform.c index 65154c0abab1..7bbbb7a9b578 100644 --- a/drivers/pwm/pwm-lpss-platform.c +++ b/drivers/pwm/pwm-lpss-platform.c @@ -21,16 +21,19 @@ static int pwm_lpss_probe_platform(struct platform_device *pdev) const struct pwm_lpss_boardinfo *info; const struct acpi_device_id *id; struct pwm_lpss_chip *lpwm; - struct resource *r; + void __iomem *base; id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev); if (!id) return -ENODEV; info = (const struct pwm_lpss_boardinfo *)id->driver_data; - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - lpwm = pwm_lpss_probe(&pdev->dev, r, info); + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + lpwm = pwm_lpss_probe(&pdev->dev, base, info); if (IS_ERR(lpwm)) return PTR_ERR(lpwm); |