diff options
| author | Raag Jadav <[email protected]> | 2024-02-19 03:38:35 +0000 |
|---|---|---|
| committer | Uwe Kleine-König <[email protected]> | 2024-02-26 10:14:46 +0000 |
| commit | 9e3440d2d57b459cd12c5a4d15e95a1181568e4f (patch) | |
| tree | 7ca5ffbe54636722ea27c16b9312f08da15df906 /drivers/pwm/pwm-dwc.c | |
| parent | pwm: dwc: Add 16 channel support for Intel Elkhart Lake (diff) | |
| download | kernel-9e3440d2d57b459cd12c5a4d15e95a1181568e4f.tar.gz kernel-9e3440d2d57b459cd12c5a4d15e95a1181568e4f.zip | |
pwm: dwc: simplify error handling
Simplify error handling in ->probe() function using dev_err_probe() helper
and while at it, drop error codes from the message to prevent duplication.
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.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c index de95352081fa..676eaf8d7a53 100644 --- a/drivers/pwm/pwm-dwc.c +++ b/drivers/pwm/pwm-dwc.c @@ -53,18 +53,14 @@ static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id) int i, ret; ret = pcim_enable_device(pci); - if (ret) { - dev_err(dev, "Failed to enable device (%pe)\n", ERR_PTR(ret)); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to enable device\n"); pci_set_master(pci); ret = pcim_iomap_regions(pci, BIT(0), pci_name(pci)); - if (ret) { - dev_err(dev, "Failed to iomap PCI BAR (%pe)\n", ERR_PTR(ret)); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to iomap PCI BAR\n"); info = (const struct dwc_pwm_info *)id->driver_data; |
