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 <[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]>
1 parent 1159c66 commit 144a000

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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)