hwmon: (acpi_power_meter) Fix acpi_bus_get_device() return value check

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:07 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=3a4cbc190643d0c6f7ca36a84af8367947f558c7
Commit:     3a4cbc190643d0c6f7ca36a84af8367947f558c7
Parent:     cc76dee17fc996cf23c3cebe543a2d1ea36aa89e
Author:     Yijing Wang <wangyijing at huawei.com>
AuthorDate: Wed Nov 20 17:28:23 2013 +0800
Committer:  Guenter Roeck <linux at roeck-us.net>
CommitDate: Wed Nov 20 08:31:01 2013 -0800

    hwmon: (acpi_power_meter) Fix acpi_bus_get_device() return value check
    
    Since acpi_bus_get_device() returns plain int and not acpi_status,
    ACPI_FAILURE() should not be used for checking its return value.  Fix
    that.
    
    Signed-off-by: Yijing Wang <wangyijing at huawei.com>
    Signed-off-by: Guenter Roeck <linux at roeck-us.net>
---
 drivers/hwmon/acpi_power_meter.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
index 8d40da3..6a34f7f 100644
--- a/drivers/hwmon/acpi_power_meter.c
+++ b/drivers/hwmon/acpi_power_meter.c
@@ -602,9 +602,8 @@ static int read_domain_devices(struct acpi_power_meter_resource *resource)
 
 		/* Create a symlink to domain objects */
 		resource->domain_devices[i] = NULL;
-		status = acpi_bus_get_device(element->reference.handle,
-					     &resource->domain_devices[i]);
-		if (ACPI_FAILURE(status))
+		if (acpi_bus_get_device(element->reference.handle,
+					&resource->domain_devices[i]))
 			continue;
 
 		obj = resource->domain_devices[i];



More information about the linux-mtd-cvs mailing list