diff options
author | Chen Ni <nichen@iscas.ac.cn> | 2023-11-06 21:40:52 +0300 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-12-07 16:50:25 +0300 |
commit | 92827c1020706333f528e1ecd47145d9a426517e (patch) | |
tree | 510bb10076ebfb557302b05fff9bf9bf3ba97700 /drivers/mfd/intel-lpss.c | |
parent | 6978c7d2dd81e0a3f9d30d1fbdb013a5ae5fabaf (diff) | |
download | linux-92827c1020706333f528e1ecd47145d9a426517e.tar.xz |
mfd: intel-lpss: Return error code received from the IRQ API
platform_get_irq() returns a negative error code to indicate an error.
As does pci_alloc_irq_vectors() and pci_irq_vector(). So in
intel_lpss_probe() the erroneous IRQ would be better returned as is.
The pci_alloc_irq_vectors() call and platform_get_irq() guarantee
that IRQs will not be 0, so we'll drop that check as well.
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
[andy: updated commit message]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231106184052.1166579-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd/intel-lpss.c')
-rw-r--r-- | drivers/mfd/intel-lpss.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index 9115ba4c768f..bbd65da46db6 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -378,9 +378,12 @@ int intel_lpss_probe(struct device *dev, struct intel_lpss *lpss; int ret; - if (!info || !info->mem || info->irq <= 0) + if (!info || !info->mem) return -EINVAL; + if (info->irq < 0) + return info->irq; + lpss = devm_kzalloc(dev, sizeof(*lpss), GFP_KERNEL); if (!lpss) return -ENOMEM; |