diff mbox series

[-next] clocksource/drivers/sun5i: Remove surplus dev_err() when using platform_get_irq()

Message ID 20230831041414.66434-1-yang.lee@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series [-next] clocksource/drivers/sun5i: Remove surplus dev_err() when using platform_get_irq() | expand

Commit Message

Yang Li Aug. 31, 2023, 4:14 a.m. UTC
There is no need to call the dev_err() function directly to print a
custom message when handling an error from either the platform_get_irq()
or platform_get_irq_byname() functions as both are going to display an
appropriate error message in case of a failure.

./drivers/clocksource/timer-sun5i.c:260:2-9: line 260 is redundant because platform_get_irq() already prints an error

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/clocksource/timer-sun5i.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jernej Škrabec Sept. 5, 2023, 8:33 p.m. UTC | #1
On Thursday, August 31, 2023 6:14:14 AM CEST Yang Li wrote:
> There is no need to call the dev_err() function directly to print a
> custom message when handling an error from either the platform_get_irq()
> or platform_get_irq_byname() functions as both are going to display an
> appropriate error message in case of a failure.
> 
> ./drivers/clocksource/timer-sun5i.c:260:2-9: line 260 is redundant because
> platform_get_irq() already prints an error
> 
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej
> ---
>  drivers/clocksource/timer-sun5i.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-sun5i.c
> b/drivers/clocksource/timer-sun5i.c index 69fee3540d37..0d229a9058da 100644
> --- a/drivers/clocksource/timer-sun5i.c
> +++ b/drivers/clocksource/timer-sun5i.c
> @@ -256,10 +256,8 @@ static int sun5i_timer_probe(struct platform_device
> *pdev) }
> 
>  	irq = platform_get_irq(pdev, 0);
> -	if (irq < 0) {
> -		dev_err(dev, "Can't get IRQ\n");
> +	if (irq < 0)
>  		return irq;
> -	}
> 
>  	clk = devm_clk_get_enabled(dev, NULL);
>  	if (IS_ERR(clk)) {
Daniel Lezcano Oct. 11, 2023, 9:03 a.m. UTC | #2
On 31/08/2023 06:14, Yang Li wrote:
> There is no need to call the dev_err() function directly to print a
> custom message when handling an error from either the platform_get_irq()
> or platform_get_irq_byname() functions as both are going to display an
> appropriate error message in case of a failure.
> 
> ./drivers/clocksource/timer-sun5i.c:260:2-9: line 260 is redundant because platform_get_irq() already prints an error
> 
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/clocksource/timer-sun5i.c b/drivers/clocksource/timer-sun5i.c
index 69fee3540d37..0d229a9058da 100644
--- a/drivers/clocksource/timer-sun5i.c
+++ b/drivers/clocksource/timer-sun5i.c
@@ -256,10 +256,8 @@  static int sun5i_timer_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "Can't get IRQ\n");
+	if (irq < 0)
 		return irq;
-	}
 
 	clk = devm_clk_get_enabled(dev, NULL);
 	if (IS_ERR(clk)) {