* [PATCH AUTOSEL 5.10 59/93] gpio: zynq: Check return value of pm_runtime_get_sync
[not found] <20210710022428.3169839-1-sashal@kernel.org>
@ 2021-07-10 2:23 ` Sasha Levin
2021-07-10 2:23 ` [PATCH AUTOSEL 5.10 60/93] gpio: zynq: Check return value of irq_get_irq_data Sasha Levin
2021-07-10 2:23 ` [PATCH AUTOSEL 5.10 64/93] gpio: pca953x: Add support for the On Semi pca9655 Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2021-07-10 2:23 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Srinivas Neeli, Bartosz Golaszewski, Sasha Levin, linux-gpio,
linux-arm-kernel
From: Srinivas Neeli <srinivas.neeli@xilinx.com>
[ Upstream commit a51b2fb94b04ab71e53a71b9fad03fa826941254 ]
Return value of "pm_runtime_get_sync" API was neither captured nor checked.
Fixed it by capturing the return value and then checking for any warning.
Addresses-Coverity: "check_return"
Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-zynq.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 3521c1dc3ac0..fb8684d70fe3 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -1001,8 +1001,11 @@ static int zynq_gpio_probe(struct platform_device *pdev)
static int zynq_gpio_remove(struct platform_device *pdev)
{
struct zynq_gpio *gpio = platform_get_drvdata(pdev);
+ int ret;
- pm_runtime_get_sync(&pdev->dev);
+ ret = pm_runtime_get_sync(&pdev->dev);
+ if (ret < 0)
+ dev_warn(&pdev->dev, "pm_runtime_get_sync() Failed\n");
gpiochip_remove(&gpio->chip);
clk_disable_unprepare(gpio->clk);
device_set_wakeup_capable(&pdev->dev, 0);
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH AUTOSEL 5.10 60/93] gpio: zynq: Check return value of irq_get_irq_data
[not found] <20210710022428.3169839-1-sashal@kernel.org>
2021-07-10 2:23 ` [PATCH AUTOSEL 5.10 59/93] gpio: zynq: Check return value of pm_runtime_get_sync Sasha Levin
@ 2021-07-10 2:23 ` Sasha Levin
2021-07-10 2:23 ` [PATCH AUTOSEL 5.10 64/93] gpio: pca953x: Add support for the On Semi pca9655 Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2021-07-10 2:23 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Srinivas Neeli, Bartosz Golaszewski, Sasha Levin, linux-gpio,
linux-arm-kernel
From: Srinivas Neeli <srinivas.neeli@xilinx.com>
[ Upstream commit 35d7b72a632bc7afb15356f44005554af8697904 ]
In two different instances the return value of "irq_get_irq_data"
API was neither captured nor checked.
Fixed it by capturing the return value and then checking for any error.
Addresses-Coverity: "returned_null"
Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-zynq.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index fb8684d70fe3..c288a7502de2 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -736,6 +736,11 @@ static int __maybe_unused zynq_gpio_suspend(struct device *dev)
struct zynq_gpio *gpio = dev_get_drvdata(dev);
struct irq_data *data = irq_get_irq_data(gpio->irq);
+ if (!data) {
+ dev_err(dev, "irq_get_irq_data() failed\n");
+ return -EINVAL;
+ }
+
if (!device_may_wakeup(dev))
disable_irq(gpio->irq);
@@ -753,6 +758,11 @@ static int __maybe_unused zynq_gpio_resume(struct device *dev)
struct irq_data *data = irq_get_irq_data(gpio->irq);
int ret;
+ if (!data) {
+ dev_err(dev, "irq_get_irq_data() failed\n");
+ return -EINVAL;
+ }
+
if (!device_may_wakeup(dev))
enable_irq(gpio->irq);
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH AUTOSEL 5.10 64/93] gpio: pca953x: Add support for the On Semi pca9655
[not found] <20210710022428.3169839-1-sashal@kernel.org>
2021-07-10 2:23 ` [PATCH AUTOSEL 5.10 59/93] gpio: zynq: Check return value of pm_runtime_get_sync Sasha Levin
2021-07-10 2:23 ` [PATCH AUTOSEL 5.10 60/93] gpio: zynq: Check return value of irq_get_irq_data Sasha Levin
@ 2021-07-10 2:23 ` Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2021-07-10 2:23 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Peter Robinson, Bartosz Golaszewski, Sasha Levin, linux-gpio
From: Peter Robinson <pbrobinson@gmail.com>
[ Upstream commit 6d49b3a0f351925b5ea5047166c112b7590b918a ]
The On Semi pca9655 is a 16 bit variant of the On Semi pca9654 GPIO
expander, with 16 GPIOs and interrupt functionality.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
[Bartosz: fixed indentation as noted by Andy]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-pca953x.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 6898c27f71f8..7cc7d137133a 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -1239,6 +1239,7 @@ static const struct of_device_id pca953x_dt_ids[] = {
{ .compatible = "onnn,cat9554", .data = OF_953X( 8, PCA_INT), },
{ .compatible = "onnn,pca9654", .data = OF_953X( 8, PCA_INT), },
+ { .compatible = "onnn,pca9655", .data = OF_953X(16, PCA_INT), },
{ .compatible = "exar,xra1202", .data = OF_953X( 8, 0), },
{ }
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-10 2:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20210710022428.3169839-1-sashal@kernel.org>
2021-07-10 2:23 ` [PATCH AUTOSEL 5.10 59/93] gpio: zynq: Check return value of pm_runtime_get_sync Sasha Levin
2021-07-10 2:23 ` [PATCH AUTOSEL 5.10 60/93] gpio: zynq: Check return value of irq_get_irq_data Sasha Levin
2021-07-10 2:23 ` [PATCH AUTOSEL 5.10 64/93] gpio: pca953x: Add support for the On Semi pca9655 Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).