summaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-lpss-pci.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-09-27 19:24:17 +0300
committerThierry Reding <thierry.reding@gmail.com>2022-09-28 17:10:35 +0300
commit68af6fb00f2f1e72521169d5a4283faa8533694d (patch)
tree599631015b94849bcb0304e58fb3b8d2c6edaebe /drivers/pwm/pwm-lpss-pci.c
parenta3682d2fe3c36c68899bf1b956ed68d36d005868 (diff)
downloadlinux-68af6fb00f2f1e72521169d5a4283faa8533694d.tar.xz
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-pci.c')
-rw-r--r--drivers/pwm/pwm-lpss-pci.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-lpss-pci.c b/drivers/pwm/pwm-lpss-pci.c
index 9f2c666b95ec..f3367e844e61 100644
--- a/drivers/pwm/pwm-lpss-pci.c
+++ b/drivers/pwm/pwm-lpss-pci.c
@@ -25,8 +25,12 @@ static int pwm_lpss_probe_pci(struct pci_dev *pdev,
if (err < 0)
return err;
+ err = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
+ if (err)
+ return err;
+
info = (struct pwm_lpss_boardinfo *)id->driver_data;
- lpwm = pwm_lpss_probe(&pdev->dev, &pdev->resource[0], info);
+ lpwm = pwm_lpss_probe(&pdev->dev, pcim_iomap_table(pdev)[0], info);
if (IS_ERR(lpwm))
return PTR_ERR(lpwm);