Skip to content

Commit

Permalink
misc: hisi_hikey_usb: use PTR_ERR_OR_ZERO
Browse files Browse the repository at this point in the history
Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code,
we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then
doing 'return 0'.

Tested-by: Lukas Bulwahn <[email protected]>
Signed-off-by: Sudip Mukherjee <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and gregkh committed Oct 29, 2020
1 parent 3650b22 commit b36773c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/misc/hisi_hikey_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,7 @@ static int hisi_hikey_usb_parse_kirin970(struct platform_device *pdev,

hisi_hikey_usb->reset = devm_gpiod_get(&pdev->dev, "hub_reset_en_gpio",
GPIOD_OUT_HIGH);
if (IS_ERR(hisi_hikey_usb->reset))
return PTR_ERR(hisi_hikey_usb->reset);

return 0;
return PTR_ERR_OR_ZERO(hisi_hikey_usb->reset);
}

static int hisi_hikey_usb_probe(struct platform_device *pdev)
Expand Down

0 comments on commit b36773c

Please sign in to comment.