devfreq: rk3399_dmc: fix error code in rk3399_dmcfreq_probe()
PATCH 1/1 devfreq: rk3399_dmc: fix error code in rk3399_dmcfreq_probe()
Print and propagate the return value of platform_get_irq on failure.
--- drivers/devfreq/rk3399_dmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/devfreq/rk3399_dmc.c +3 -2
@@ -336,8 +336,9 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev) irq =platform_get_irq (pdev,0 );if (irq <0 ) { -dev_err (&pdev->dev,"Cannot get the dmc interrupt resource\n" ); -return -EINVAL ; +dev_err (&pdev->dev, +"Cannot get the dmc interrupt resource: %d\n" , irq); +return irq; } data =devm_kzalloc (dev,sizeof (struct rk3399_dmcfreq ),GFP_KERNEL );if (!data)
Signature · 1 line
2.5.0
Hi,
Quoted 14 lines · Gustavo A. R. Silva
Print and propagate the return value of
platform_get_irqon failure.Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/devfreq/rk3399_dmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/devfreq/rk3399_dmc.c +0
-0@@ -336,8 +336,9 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
drivers/devfreq/rk3399_dmc.c static int rk3399_dmcfreq_probe(struct platform_device *pdev) · line 344
Quoted 10 lines
drivers/devfreq/rk3399_dmc.c +3
-2irq =platform_get_irq (pdev,0 );if (irq <0 ) { -dev_err (&pdev->dev,"Cannot get the dmc interrupt resource\n" ); -return -EINVAL ; +dev_err (&pdev->dev, +"Cannot get the dmc interrupt resource: %d\n" , irq); +return irq; } data =devm_kzalloc (dev,sizeof (struct rk3399_dmcfreq ),GFP_KERNEL );if (!data)
Signature · 3 lines
Best Regards, Chanwoo Choi Samsung Electronics
Quoted 16 lines · Chanwoo Choi
Hi,
Quoted 13 lines · Gustavo A. R. Silva
Print and propagate the return value of
platform_get_irqon failure.Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/devfreq/rk3399_dmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/devfreq/rk3399_dmc.c +0
-0@@ -336,8 +336,9 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
Quoted 13 lines
drivers/devfreq/rk3399_dmc.c static int rk3399_dmcfreq_probe(struct platform_device *pdev) · line 344
Quoted 11 lines
drivers/devfreq/rk3399_dmc.c +3
-2irq =platform_get_irq (pdev,0 );if (irq <0 ) { -dev_err (&pdev->dev,"Cannot get the dmc interrupt resource\n" ); -return -EINVAL ; +dev_err (&pdev->dev, +"Cannot get the dmc interrupt resource: %d\n" , irq); +return irq; } data =devm_kzalloc (dev,sizeof (struct rk3399_dmcfreq ),GFP_KERNEL );if (!data)Reviewed-by Chanwoo Choi <[email protected]>
Quoted 5 lines
--
Best Regards,
Chanwoo Choi
Samsung Electronics
Signature · 2 lines
MyungJoo Ham, Ph.D. S/W Center, Samsung Electronics
PATCH v2 1/1 devfreq: rk3399_dmc: fix error return code in rk3399_dmcfreq_probe()
platform_get_irq() returns an error code, but the rk3399_dmc driver ignores it and always returns -EINVAL. This is not correct, and prevents -EPROBE_DEFER from being propagated properly.
Notice that platform_get_irq() no longer returns 0 on error:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af
Print and propagate the return value of platform_get_irq on failure.
---
Changes in v2:
Rewrite commit message.
drivers/devfreq/rk3399_dmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/devfreq/rk3399_dmc.c +3 -2
@@ -336,8 +336,9 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev) irq =platform_get_irq (pdev,0 );if (irq <0 ) { -dev_err (&pdev->dev,"Cannot get the dmc interrupt resource\n" ); -return -EINVAL ; +dev_err (&pdev->dev, +"Cannot get the dmc interrupt resource: %d\n" , irq); +return irq; } data =devm_kzalloc (dev,sizeof (struct rk3399_dmcfreq ),GFP_KERNEL );if (!data)
Signature · 1 line
2.5.0
Quoted 31 lines · MyungJoo Ham
Quoted 16 lines · Chanwoo Choi
Hi,
Quoted 13 lines · Gustavo A. R. Silva
Print and propagate the return value of
platform_get_irqon failure.Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/devfreq/rk3399_dmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/devfreq/rk3399_dmc.c +0
-0@@ -336,8 +336,9 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)Quoted 13 lines
drivers/devfreq/rk3399_dmc.c static int rk3399_dmcfreq_probe(struct platform_device *pdev) · line 344
Quoted 11 lines
drivers/devfreq/rk3399_dmc.c +3
-2irq =platform_get_irq (pdev,0 );if (irq <0 ) { -dev_err (&pdev->dev,"Cannot get the dmc interrupt resource\n" ); -return -EINVAL ; +dev_err (&pdev->dev, +"Cannot get the dmc interrupt resource: %d\n" , irq); +return irq; } data =devm_kzalloc (dev,sizeof (struct rk3399_dmcfreq ),GFP_KERNEL );if (!data)Reviewed-by Chanwoo Choi <[email protected]>
Quoted 2 lines
Acked-by MyungJoo Ham <[email protected]>
Thank you, Chanwoo and MyungJoo.
Signature · 1 line
Gustavo A. R. Silva