Skip to content

Commit

Permalink
media: rcar-csi2: Fix coccinelle warning for PTR_ERR_OR_ZERO()
Browse files Browse the repository at this point in the history
Use the PTR_ERR_OR_ZERO() macro instead of construct:

    if (IS_ERR(foo))
        return PTR_ERR(foo);

    return 0;

Fixes: 3ae854cafd76 ("rcar-csi2: Use standby mode instead of resetting")

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Niklas Söderlund authored and Mauro Carvalho Chehab committed May 28, 2019
1 parent 20059cb commit 0c31086
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/media/platform/rcar-vin/rcar-csi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,8 @@ static int rcsi2_probe_resources(struct rcar_csi2 *priv,
return ret;

priv->rstc = devm_reset_control_get(&pdev->dev, NULL);
if (IS_ERR(priv->rstc))
return PTR_ERR(priv->rstc);

return 0;
return PTR_ERR_OR_ZERO(priv->rstc);
}

static const struct rcar_csi2_info rcar_csi2_info_r8a7795 = {
Expand Down

0 comments on commit 0c31086

Please sign in to comment.