Skip to content

Commit

Permalink
acpi_power_meter: clean up code around setup_attrs
Browse files Browse the repository at this point in the history
We don't need to duplicate if (res) checks if we're always running
one or the other.

Signed-off-by: Kyle McMartin <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
jkkm authored and Guenter Roeck committed May 21, 2012
1 parent 9fe789f commit 7bb5ee0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions drivers/hwmon/acpi_power_meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,21 +697,20 @@ static int setup_attrs(struct acpi_power_meter_resource *resource)
goto skip_unsafe_cap;
}

if (resource->caps.configurable_cap) {
if (resource->caps.configurable_cap)
res = register_attrs(resource, rw_cap_attrs);
if (res)
goto error;
} else {
else
res = register_attrs(resource, ro_cap_attrs);
if (res)
goto error;
}

if (res)
goto error;

res = register_attrs(resource, misc_cap_attrs);
if (res)
goto error;
}
skip_unsafe_cap:

skip_unsafe_cap:
if (resource->caps.flags & POWER_METER_CAN_TRIP) {
res = register_attrs(resource, trip_attrs);
if (res)
Expand Down

0 comments on commit 7bb5ee0

Please sign in to comment.