summaryrefslogtreecommitdiff
path: root/drivers/misc/hisi_hikey_usb.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2020-10-26 18:00:26 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 08:37:29 +0100
commitb36773c3912e770e92ba57fa0957c1cf4db6e8a7 (patch)
tree4d69727260659ab0ffd9db4a1c882db6ae562555 /drivers/misc/hisi_hikey_usb.c
parent3650b228f83adda7e5ee532e2b90429c03f7b9ec (diff)
misc: hisi_hikey_usb: use PTR_ERR_OR_ZERO
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 <lukas.bulwahn@gmail.com> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Link: https://lore.kernel.org/r/20201026180026.3350-1-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/hisi_hikey_usb.c')
-rw-r--r--drivers/misc/hisi_hikey_usb.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/misc/hisi_hikey_usb.c b/drivers/misc/hisi_hikey_usb.c
index cc93569e601c..989d7d129469 100644
--- a/drivers/misc/hisi_hikey_usb.c
+++ b/drivers/misc/hisi_hikey_usb.c
@@ -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)