summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/it87.c
diff options
context:
space:
mode:
authorGuenter Roeck2015-03-28 15:44:59 +0100
committerGuenter Roeck2016-04-19 15:32:35 +0200
commit5cae84a58ee60eb54f636133f4f3ede9af93d476 (patch)
tree827e4460bb1bc089cffd3286fb546cce0f596a37 /drivers/hwmon/it87.c
parenthwmon: (it87) Add support for second pwm frequency register (diff)
downloadkernel-qcow2-linux-5cae84a58ee60eb54f636133f4f3ede9af93d476.tar.gz
kernel-qcow2-linux-5cae84a58ee60eb54f636133f4f3ede9af93d476.tar.xz
kernel-qcow2-linux-5cae84a58ee60eb54f636133f4f3ede9af93d476.zip
hwmon: (it87) Simplify error return in it87_device_add
Return directly on errors if there is no cleanup necessary. Don't create an error message on memory allocation errors. Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/it87.c')
-rw-r--r--drivers/hwmon/it87.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 68c8d98e711a..9b36987d7949 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -2898,14 +2898,11 @@ static int __init it87_device_add(unsigned short address,
err = acpi_check_resource_conflict(&res);
if (err)
- goto exit;
+ return err;
pdev = platform_device_alloc(DRVNAME, address);
- if (!pdev) {
- err = -ENOMEM;
- pr_err("Device allocation failed\n");
- goto exit;
- }
+ if (!pdev)
+ return -ENOMEM;
err = platform_device_add_resources(pdev, &res, 1);
if (err) {
@@ -2930,7 +2927,6 @@ static int __init it87_device_add(unsigned short address,
exit_device_put:
platform_device_put(pdev);
-exit:
return err;
}