diff mbox

[PATCHv3,05/10,media] rcar-vin: return correct error from platform_get_irq()

Message ID 20160815150635.22637-6-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State New, archived
Headers show

Commit Message

Niklas Söderlund Aug. 15, 2016, 3:06 p.m. UTC
Fix a error from the original driver where the wrong error code is
returned if the driver fails to get a IRQ number from
platform_get_irq().

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Sergei Shtylyov Sept. 3, 2016, 6:36 p.m. UTC | #1
On 08/15/2016 06:06 PM, Niklas Söderlund wrote:

> Fix a error from the original driver where the wrong error code is
> returned if the driver fails to get a IRQ number from
> platform_get_irq().
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  drivers/media/platform/rcar-vin/rcar-core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
> index a1eb26b..3941134 100644
> --- a/drivers/media/platform/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/rcar-vin/rcar-core.c
> @@ -282,8 +282,8 @@ static int rcar_vin_probe(struct platform_device *pdev)
>  		return PTR_ERR(vin->base);
>
>  	irq = platform_get_irq(pdev, 0);
> -	if (irq <= 0)
> -		return ret;
> +	if (irq < 0)

    You don't explain this change. It's OK however (my patch fixing this 
function not to return 0 on error is in GregKH's driver-core-next tree).

> +		return irq;
>
>  	ret = rvin_dma_probe(vin, irq);
>  	if (ret)

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
index a1eb26b..3941134 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -282,8 +282,8 @@  static int rcar_vin_probe(struct platform_device *pdev)
 		return PTR_ERR(vin->base);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0)
-		return ret;
+	if (irq < 0)
+		return irq;
 
 	ret = rvin_dma_probe(vin, irq);
 	if (ret)