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>
This commit is contained in:

committed by
Guenter Roeck

parent
9fe789f88a
commit
7bb5ee0169
@@ -697,21 +697,20 @@ static int setup_attrs(struct acpi_power_meter_resource *resource)
|
|||||||
goto skip_unsafe_cap;
|
goto skip_unsafe_cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resource->caps.configurable_cap) {
|
if (resource->caps.configurable_cap)
|
||||||
res = register_attrs(resource, rw_cap_attrs);
|
res = register_attrs(resource, rw_cap_attrs);
|
||||||
if (res)
|
else
|
||||||
goto error;
|
|
||||||
} else {
|
|
||||||
res = register_attrs(resource, ro_cap_attrs);
|
res = register_attrs(resource, ro_cap_attrs);
|
||||||
if (res)
|
|
||||||
goto error;
|
if (res)
|
||||||
}
|
goto error;
|
||||||
|
|
||||||
res = register_attrs(resource, misc_cap_attrs);
|
res = register_attrs(resource, misc_cap_attrs);
|
||||||
if (res)
|
if (res)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
skip_unsafe_cap:
|
|
||||||
|
|
||||||
|
skip_unsafe_cap:
|
||||||
if (resource->caps.flags & POWER_METER_CAN_TRIP) {
|
if (resource->caps.flags & POWER_METER_CAN_TRIP) {
|
||||||
res = register_attrs(resource, trip_attrs);
|
res = register_attrs(resource, trip_attrs);
|
||||||
if (res)
|
if (res)
|
||||||
|
Reference in New Issue
Block a user