* [PATCH] thermal: Delete an error message in four functions
@ 2020-04-05 16:50 Markus Elfring
2020-04-06 7:30 ` Amit Kucheria
2020-04-06 9:03 ` Daniel Lezcano
0 siblings, 2 replies; 4+ messages in thread
From: Markus Elfring @ 2020-04-05 16:50 UTC (permalink / raw)
To: linux-pm, linux-arm-kernel, linux-rockchip, linux-stm32,
linux-omap, Alexandre Torgue, Allison Randal, Amit Kucheria,
Clark Williams, Colin Ian King, Daniel Lezcano, Eduardo Valentin,
Greg Kroah-Hartman, Heiko Stübner, Keerthy, Maxime Coquelin,
Pascal Paillet, Sebastian Andrzej Siewior, Thomas Gleixner,
Zhang Rui
Cc: LKML, kernel-janitors, Tang Bin
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 5 Apr 2020 18:35:16 +0200
The function “platform_get_irq” can log an error already.
Thus omit redundant messages for the exception handling in the
calling functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/thermal/rockchip_thermal.c | 4 +---
drivers/thermal/st/st_thermal_memmap.c | 4 +---
drivers/thermal/st/stm_thermal.c | 4 +---
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 5 ++---
4 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 7c1a8bccdcba..15a71ecc916c 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -1241,10 +1241,8 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
return -ENXIO;
irq = platform_get_irq(pdev, 0);
- if (irq < 0) {
- dev_err(&pdev->dev, "no irq resource?\n");
+ if (irq < 0)
return -EINVAL;
- }
thermal = devm_kzalloc(&pdev->dev, sizeof(struct rockchip_thermal_data),
GFP_KERNEL);
diff --git a/drivers/thermal/st/st_thermal_memmap.c b/drivers/thermal/st/st_thermal_memmap.c
index a824b78dabf8..a0114452d11f 100644
--- a/drivers/thermal/st/st_thermal_memmap.c
+++ b/drivers/thermal/st/st_thermal_memmap.c
@@ -94,10 +94,8 @@ static int st_mmap_register_enable_irq(struct st_thermal_sensor *sensor)
int ret;
sensor->irq = platform_get_irq(pdev, 0);
- if (sensor->irq < 0) {
- dev_err(dev, "failed to register IRQ\n");
+ if (sensor->irq < 0)
return sensor->irq;
- }
ret = devm_request_threaded_irq(dev, sensor->irq,
NULL, st_mmap_thermal_trip_handler,
diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c
index 9314e3df6a42..331e2b768df5 100644
--- a/drivers/thermal/st/stm_thermal.c
+++ b/drivers/thermal/st/stm_thermal.c
@@ -385,10 +385,8 @@ static int stm_register_irq(struct stm_thermal_sensor *sensor)
int ret;
sensor->irq = platform_get_irq(pdev, 0);
- if (sensor->irq < 0) {
- dev_err(dev, "%s: Unable to find IRQ\n", __func__);
+ if (sensor->irq < 0)
return sensor->irq;
- }
ret = devm_request_threaded_irq(dev, sensor->irq,
NULL,
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 263b0420fbe4..ab19ceff6e2a 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -772,10 +772,9 @@ static int ti_bandgap_talert_init(struct ti_bandgap *bgp,
int ret;
bgp->irq = platform_get_irq(pdev, 0);
- if (bgp->irq < 0) {
- dev_err(&pdev->dev, "get_irq failed\n");
+ if (bgp->irq < 0)
return bgp->irq;
- }
+
ret = request_threaded_irq(bgp->irq, NULL,
ti_bandgap_talert_irq_handler,
IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
--
2.26.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: Delete an error message in four functions
2020-04-05 16:50 [PATCH] thermal: Delete an error message in four functions Markus Elfring
@ 2020-04-06 7:30 ` Amit Kucheria
2020-04-06 8:17 ` J, KEERTHY
2020-04-06 9:03 ` Daniel Lezcano
1 sibling, 1 reply; 4+ messages in thread
From: Amit Kucheria @ 2020-04-06 7:30 UTC (permalink / raw)
To: Markus Elfring
Cc: Linux PM list, lakml, linux-rockchip, linux-stm32, linux-omap,
Alexandre Torgue, Allison Randal, Clark Williams, Colin Ian King,
Daniel Lezcano, Eduardo Valentin, Greg Kroah-Hartman,
Heiko Stübner, Keerthy, Maxime Coquelin, Pascal Paillet,
Sebastian Andrzej Siewior, Thomas Gleixner, Zhang Rui, LKML,
kernel-janitors, Tang Bin
On Sun, Apr 5, 2020 at 10:21 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 5 Apr 2020 18:35:16 +0200
>
> The function “platform_get_irq” can log an error already.
> Thus omit redundant messages for the exception handling in the
> calling functions.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
> ---
> drivers/thermal/rockchip_thermal.c | 4 +---
> drivers/thermal/st/st_thermal_memmap.c | 4 +---
> drivers/thermal/st/stm_thermal.c | 4 +---
> drivers/thermal/ti-soc-thermal/ti-bandgap.c | 5 ++---
> 4 files changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
> index 7c1a8bccdcba..15a71ecc916c 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -1241,10 +1241,8 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
> return -ENXIO;
>
> irq = platform_get_irq(pdev, 0);
> - if (irq < 0) {
> - dev_err(&pdev->dev, "no irq resource?\n");
> + if (irq < 0)
> return -EINVAL;
> - }
>
> thermal = devm_kzalloc(&pdev->dev, sizeof(struct rockchip_thermal_data),
> GFP_KERNEL);
> diff --git a/drivers/thermal/st/st_thermal_memmap.c b/drivers/thermal/st/st_thermal_memmap.c
> index a824b78dabf8..a0114452d11f 100644
> --- a/drivers/thermal/st/st_thermal_memmap.c
> +++ b/drivers/thermal/st/st_thermal_memmap.c
> @@ -94,10 +94,8 @@ static int st_mmap_register_enable_irq(struct st_thermal_sensor *sensor)
> int ret;
>
> sensor->irq = platform_get_irq(pdev, 0);
> - if (sensor->irq < 0) {
> - dev_err(dev, "failed to register IRQ\n");
> + if (sensor->irq < 0)
> return sensor->irq;
> - }
>
> ret = devm_request_threaded_irq(dev, sensor->irq,
> NULL, st_mmap_thermal_trip_handler,
> diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c
> index 9314e3df6a42..331e2b768df5 100644
> --- a/drivers/thermal/st/stm_thermal.c
> +++ b/drivers/thermal/st/stm_thermal.c
> @@ -385,10 +385,8 @@ static int stm_register_irq(struct stm_thermal_sensor *sensor)
> int ret;
>
> sensor->irq = platform_get_irq(pdev, 0);
> - if (sensor->irq < 0) {
> - dev_err(dev, "%s: Unable to find IRQ\n", __func__);
> + if (sensor->irq < 0)
> return sensor->irq;
> - }
>
> ret = devm_request_threaded_irq(dev, sensor->irq,
> NULL,
> diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> index 263b0420fbe4..ab19ceff6e2a 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> @@ -772,10 +772,9 @@ static int ti_bandgap_talert_init(struct ti_bandgap *bgp,
> int ret;
>
> bgp->irq = platform_get_irq(pdev, 0);
> - if (bgp->irq < 0) {
> - dev_err(&pdev->dev, "get_irq failed\n");
> + if (bgp->irq < 0)
> return bgp->irq;
> - }
> +
> ret = request_threaded_irq(bgp->irq, NULL,
> ti_bandgap_talert_irq_handler,
> IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
> --
> 2.26.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: Delete an error message in four functions
2020-04-06 7:30 ` Amit Kucheria
@ 2020-04-06 8:17 ` J, KEERTHY
0 siblings, 0 replies; 4+ messages in thread
From: J, KEERTHY @ 2020-04-06 8:17 UTC (permalink / raw)
To: Amit Kucheria, Markus Elfring
Cc: Linux PM list, lakml, linux-rockchip, linux-stm32, linux-omap,
Alexandre Torgue, Allison Randal, Clark Williams, Colin Ian King,
Daniel Lezcano, Eduardo Valentin, Greg Kroah-Hartman,
Heiko Stübner, Maxime Coquelin, Pascal Paillet,
Sebastian Andrzej Siewior, Thomas Gleixner, Zhang Rui, LKML,
kernel-janitors, Tang Bin
On 4/6/2020 1:00 PM, Amit Kucheria wrote:
> On Sun, Apr 5, 2020 at 10:21 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>>
>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Sun, 5 Apr 2020 18:35:16 +0200
>>
>> The function “platform_get_irq” can log an error already.
>> Thus omit redundant messages for the exception handling in the
>> calling functions.
>>
>> This issue was detected by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Keerthy <j-keerthy@ti.com>
>
> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
>
>> ---
>> drivers/thermal/rockchip_thermal.c | 4 +---
>> drivers/thermal/st/st_thermal_memmap.c | 4 +---
>> drivers/thermal/st/stm_thermal.c | 4 +---
>> drivers/thermal/ti-soc-thermal/ti-bandgap.c | 5 ++---
>> 4 files changed, 5 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
>> index 7c1a8bccdcba..15a71ecc916c 100644
>> --- a/drivers/thermal/rockchip_thermal.c
>> +++ b/drivers/thermal/rockchip_thermal.c
>> @@ -1241,10 +1241,8 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
>> return -ENXIO;
>>
>> irq = platform_get_irq(pdev, 0);
>> - if (irq < 0) {
>> - dev_err(&pdev->dev, "no irq resource?\n");
>> + if (irq < 0)
>> return -EINVAL;
>> - }
>>
>> thermal = devm_kzalloc(&pdev->dev, sizeof(struct rockchip_thermal_data),
>> GFP_KERNEL);
>> diff --git a/drivers/thermal/st/st_thermal_memmap.c b/drivers/thermal/st/st_thermal_memmap.c
>> index a824b78dabf8..a0114452d11f 100644
>> --- a/drivers/thermal/st/st_thermal_memmap.c
>> +++ b/drivers/thermal/st/st_thermal_memmap.c
>> @@ -94,10 +94,8 @@ static int st_mmap_register_enable_irq(struct st_thermal_sensor *sensor)
>> int ret;
>>
>> sensor->irq = platform_get_irq(pdev, 0);
>> - if (sensor->irq < 0) {
>> - dev_err(dev, "failed to register IRQ\n");
>> + if (sensor->irq < 0)
>> return sensor->irq;
>> - }
>>
>> ret = devm_request_threaded_irq(dev, sensor->irq,
>> NULL, st_mmap_thermal_trip_handler,
>> diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c
>> index 9314e3df6a42..331e2b768df5 100644
>> --- a/drivers/thermal/st/stm_thermal.c
>> +++ b/drivers/thermal/st/stm_thermal.c
>> @@ -385,10 +385,8 @@ static int stm_register_irq(struct stm_thermal_sensor *sensor)
>> int ret;
>>
>> sensor->irq = platform_get_irq(pdev, 0);
>> - if (sensor->irq < 0) {
>> - dev_err(dev, "%s: Unable to find IRQ\n", __func__);
>> + if (sensor->irq < 0)
>> return sensor->irq;
>> - }
>>
>> ret = devm_request_threaded_irq(dev, sensor->irq,
>> NULL,
>> diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
>> index 263b0420fbe4..ab19ceff6e2a 100644
>> --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
>> +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
>> @@ -772,10 +772,9 @@ static int ti_bandgap_talert_init(struct ti_bandgap *bgp,
>> int ret;
>>
>> bgp->irq = platform_get_irq(pdev, 0);
>> - if (bgp->irq < 0) {
>> - dev_err(&pdev->dev, "get_irq failed\n");
>> + if (bgp->irq < 0)
>> return bgp->irq;
>> - }
>> +
>> ret = request_threaded_irq(bgp->irq, NULL,
>> ti_bandgap_talert_irq_handler,
>> IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
>> --
>> 2.26.0
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: Delete an error message in four functions
2020-04-05 16:50 [PATCH] thermal: Delete an error message in four functions Markus Elfring
2020-04-06 7:30 ` Amit Kucheria
@ 2020-04-06 9:03 ` Daniel Lezcano
1 sibling, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2020-04-06 9:03 UTC (permalink / raw)
To: Markus Elfring, linux-pm, linux-arm-kernel, linux-rockchip,
linux-stm32, linux-omap, Alexandre Torgue, Allison Randal,
Amit Kucheria, Clark Williams, Colin Ian King, Eduardo Valentin,
Greg Kroah-Hartman, Heiko Stübner, Keerthy, Maxime Coquelin,
Pascal Paillet, Sebastian Andrzej Siewior, Thomas Gleixner,
Zhang Rui
Cc: LKML, kernel-janitors, Tang Bin
On 05/04/2020 18:50, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 5 Apr 2020 18:35:16 +0200
>
> The function “platform_get_irq” can log an error already.
> Thus omit redundant messages for the exception handling in the
> calling functions.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Applied, thanks
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-06 9:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-05 16:50 [PATCH] thermal: Delete an error message in four functions Markus Elfring
2020-04-06 7:30 ` Amit Kucheria
2020-04-06 8:17 ` J, KEERTHY
2020-04-06 9:03 ` Daniel Lezcano
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).