Skip to content

Commit 144a000

Browse files
raagjadavUwe Kleine-König
authored andcommitted
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 <andriy.shevchenko@linux.intel.com> Signed-off-by: Raag Jadav <raag.jadav@intel.com> Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20240219033835.11369-3-raag.jadav@intel.com Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
1 parent 1159c66 commit 144a000

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/pwm/pwm-dwc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,8 @@ static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id)
5151
return ret;
5252
}
5353

54+
/* No need to check for failure, pcim_iomap_regions() does it for us. */
5455
dwc->base = pcim_iomap_table(pci)[0];
55-
if (!dwc->base) {
56-
dev_err(dev, "Base address missing\n");
57-
return -ENOMEM;
58-
}
5956

6057
ret = devm_pwmchip_add(dev, chip);
6158
if (ret)

0 commit comments

Comments
 (0)