[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240219033835.11369-3-raag.jadav@intel.com>
Date: Mon, 19 Feb 2024 09:08:33 +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 v4 2/4] 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@...ux.intel.com>
Signed-off-by: Raag Jadav <raag.jadav@...el.com>
Tested-by: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
---
drivers/pwm/pwm-dwc.c | 5 +----
1 file changed, 1 insertion(+), 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)
--
2.35.3
Powered by blists - more mailing lists