[PATCH] ACPI: APD: fix ptr_ret.cocci warnings
From: kbuild test robot
Date: Fri May 04 2018 - 16:16:18 EST
From: Fengguang Wu <fengguang.wu@xxxxxxxxx>
drivers/acpi/acpi_apd.c:114:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
Fixes: 451cec30ec2b ("ACPI: APD: Add AMD misc clock handler support")
CC: Akshu Agrawal <akshu.agrawal@xxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---
acpi_apd.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/acpi/acpi_apd.c
+++ b/drivers/acpi/acpi_apd.c
@@ -111,10 +111,7 @@ static int st_misc_setup(struct apd_priv
clkdev = platform_device_register_data(&adev->dev, "clk-st",
PLATFORM_DEVID_NONE, clk_data,
sizeof(*clk_data));
- if (IS_ERR(clkdev))
- return PTR_ERR(clkdev);
-
- return 0;
+ return PTR_ERR_OR_ZERO(clkdev);
}
static const struct apd_device_desc cz_i2c_desc = {