[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240208070529.28562-4-raag.jadav@intel.com>
Date: Thu, 8 Feb 2024 12:35:27 +0530
From: Raag Jadav <raag.jadav@...el.com>
To: u.kleine-koenig@...gutronix.de,
jarkko.nikula@...ux.intel.com,
mika.westerberg@...ux.intel.com,
andriy.shevchenko@...ux.intel.com,
lakshmi.sowjanya.d@...el.com
Cc: linux-pwm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Raag Jadav <raag.jadav@...el.com>
Subject: [PATCH v2 3/5] pwm: dwc: simplify error handling
Simplify error handling in ->probe() function using dev_err_probe() helper.
Signed-off-by: Raag Jadav <raag.jadav@...el.com>
---
drivers/pwm/pwm-dwc.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c
index 47d76f5367fe..e1e3c62ecc56 100644
--- a/drivers/pwm/pwm-dwc.c
+++ b/drivers/pwm/pwm-dwc.c
@@ -51,18 +51,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 (%pe)\n", ERR_PTR(ret));
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 (%pe)\n", ERR_PTR(ret));
info = (const struct dwc_pwm_info *)id->driver_data;
--
2.35.3
Powered by blists - more mailing lists