aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-dwc.c
diff options
context:
space:
mode:
authorRaag Jadav <[email protected]>2024-02-19 03:38:33 +0000
committerUwe Kleine-König <[email protected]>2024-02-26 10:14:46 +0000
commit144a0008b30bc133cbaa9da7cf56d7cf2bacc4f9 (patch)
treeeef76bcd09b42019c07e447ab7fbc1423952dfc3 /drivers/pwm/pwm-dwc.c
parentstaging: greybus: pwm: Make use of devm_pwmchip_alloc() function (diff)
downloadkernel-144a0008b30bc133cbaa9da7cf56d7cf2bacc4f9.tar.gz
kernel-144a0008b30bc133cbaa9da7cf56d7cf2bacc4f9.zip
pwm: dwc: drop redundant error check
pcim_iomap_table() fails only if pcim_iomap_regions() fails. No need to check for failure if the latter is already successful. Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Raag Jadav <[email protected]> Tested-by: Jarkko Nikula <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-dwc.c')
-rw-r--r--drivers/pwm/pwm-dwc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c
index c0e586688e57..7dbb72c80ef5 100644
--- a/drivers/pwm/pwm-dwc.c
+++ b/drivers/pwm/pwm-dwc.c
@@ -51,11 +51,8 @@ static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id)
return ret;
}
+ /* No need to check for failure, pcim_iomap_regions() does it for us. */
dwc->base = pcim_iomap_table(pci)[0];
- if (!dwc->base) {
- dev_err(dev, "Base address missing\n");
- return -ENOMEM;
- }
ret = devm_pwmchip_add(dev, chip);
if (ret)