diff options
author | Kyle McMartin <kyle@mcmartin.ca> | 2012-04-02 14:19:04 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2012-05-20 22:41:49 -0400 |
commit | 7bb5ee0169b80d40aa7d4854c07f1c2a90efc5b8 (patch) | |
tree | 4bf1bc45ca14c228515ab3dc8e25bf04e8d5b909 /drivers/hwmon | |
parent | 9fe789f88ae5488d8b8af1c4c962e619ed05bb2e (diff) |
acpi_power_meter: clean up code around setup_attrs
We don't need to duplicate if (res) checks if we're always running
one or the other.
Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/acpi_power_meter.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c index c3f3058a7099..34ad5a27a7e9 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c | |||
@@ -697,21 +697,20 @@ static int setup_attrs(struct acpi_power_meter_resource *resource) | |||
697 | goto skip_unsafe_cap; | 697 | goto skip_unsafe_cap; |
698 | } | 698 | } |
699 | 699 | ||
700 | if (resource->caps.configurable_cap) { | 700 | if (resource->caps.configurable_cap) |
701 | res = register_attrs(resource, rw_cap_attrs); | 701 | res = register_attrs(resource, rw_cap_attrs); |
702 | if (res) | 702 | else |
703 | goto error; | ||
704 | } else { | ||
705 | res = register_attrs(resource, ro_cap_attrs); | 703 | res = register_attrs(resource, ro_cap_attrs); |
706 | if (res) | 704 | |
707 | goto error; | 705 | if (res) |
708 | } | 706 | goto error; |
707 | |||
709 | res = register_attrs(resource, misc_cap_attrs); | 708 | res = register_attrs(resource, misc_cap_attrs); |
710 | if (res) | 709 | if (res) |
711 | goto error; | 710 | goto error; |
712 | } | 711 | } |
713 | skip_unsafe_cap: | ||
714 | 712 | ||
713 | skip_unsafe_cap: | ||
715 | if (resource->caps.flags & POWER_METER_CAN_TRIP) { | 714 | if (resource->caps.flags & POWER_METER_CAN_TRIP) { |
716 | res = register_attrs(resource, trip_attrs); | 715 | res = register_attrs(resource, trip_attrs); |
717 | if (res) | 716 | if (res) |