lkml.org 
[lkml]   [2023]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] mfd: intel-lpss: Fix IRQ check
Date
platform_get_irq() returns a negative error code to indicating an
error. So in intel_lpss_probe() the unset / erroneous IRQ should be
returned as is.

Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
Changelog:

v1 -> v2:
1. Update commit message
2. Fix IRQ check in intel_lpcc_probe()
---
drivers/mfd/intel-lpss.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index 9591b354072a..4c9d0222751a 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;
--
2.25.1
\
 
 \ /
  Last update: 2023-11-01 07:32    [W:0.143 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site