Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sudip Mukherjee and committed by
Greg Kroah-Hartman
b36773c3 3650b228

+1 -4
+1 -4
drivers/misc/hisi_hikey_usb.c
··· 168 168 169 169 hisi_hikey_usb->reset = devm_gpiod_get(&pdev->dev, "hub_reset_en_gpio", 170 170 GPIOD_OUT_HIGH); 171 - if (IS_ERR(hisi_hikey_usb->reset)) 172 - return PTR_ERR(hisi_hikey_usb->reset); 173 - 174 - return 0; 171 + return PTR_ERR_OR_ZERO(hisi_hikey_usb->reset); 175 172 } 176 173 177 174 static int hisi_hikey_usb_probe(struct platform_device *pdev)