diff options
author | Kyle McMartin <kyle@mcmartin.ca> | 2012-04-02 14:19:03 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2012-05-20 22:41:49 -0400 |
commit | 9fe789f88ae5488d8b8af1c4c962e619ed05bb2e (patch) | |
tree | 8a065996910000782e7618b497229a8797208d4f /drivers/hwmon/acpi_power_meter.c | |
parent | f49d6a7ed2406b0c9b1c134f2e9aa4426a5266f0 (diff) |
acpi_power_meter: drop meter_rw_attrs, use common meter_attrs
We always register these two together, so move meter_rw_attrs into
meter_ro_attrs and use the same for both since we no longer have two
register_attr paths.
Signed-off-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/acpi_power_meter.c')
-rw-r--r-- | drivers/hwmon/acpi_power_meter.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c index 954e21f4dd18..c3f3058a7099 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c | |||
@@ -477,16 +477,12 @@ static ssize_t show_name(struct device *dev, | |||
477 | } | 477 | } |
478 | 478 | ||
479 | /* Sensor descriptions. If you add a sensor, update NUM_SENSORS above! */ | 479 | /* Sensor descriptions. If you add a sensor, update NUM_SENSORS above! */ |
480 | static struct sensor_template meter_ro_attrs[] = { | 480 | static struct sensor_template meter_attrs[] = { |
481 | RO_SENSOR_TEMPLATE(POWER_AVERAGE_NAME, show_power, 0), | 481 | RO_SENSOR_TEMPLATE(POWER_AVERAGE_NAME, show_power, 0), |
482 | RO_SENSOR_TEMPLATE("power1_accuracy", show_accuracy, 0), | 482 | RO_SENSOR_TEMPLATE("power1_accuracy", show_accuracy, 0), |
483 | RO_SENSOR_TEMPLATE("power1_average_interval_min", show_val, 0), | 483 | RO_SENSOR_TEMPLATE("power1_average_interval_min", show_val, 0), |
484 | RO_SENSOR_TEMPLATE("power1_average_interval_max", show_val, 1), | 484 | RO_SENSOR_TEMPLATE("power1_average_interval_max", show_val, 1), |
485 | RO_SENSOR_TEMPLATE("power1_is_battery", show_val, 5), | 485 | RO_SENSOR_TEMPLATE("power1_is_battery", show_val, 5), |
486 | {}, | ||
487 | }; | ||
488 | |||
489 | static struct sensor_template meter_rw_attrs[] = { | ||
490 | RW_SENSOR_TEMPLATE(POWER_AVG_INTERVAL_NAME, show_avg_interval, | 486 | RW_SENSOR_TEMPLATE(POWER_AVG_INTERVAL_NAME, show_avg_interval, |
491 | set_avg_interval, 0), | 487 | set_avg_interval, 0), |
492 | {}, | 488 | {}, |
@@ -689,10 +685,7 @@ static int setup_attrs(struct acpi_power_meter_resource *resource) | |||
689 | return res; | 685 | return res; |
690 | 686 | ||
691 | if (resource->caps.flags & POWER_METER_CAN_MEASURE) { | 687 | if (resource->caps.flags & POWER_METER_CAN_MEASURE) { |
692 | res = register_attrs(resource, meter_ro_attrs); | 688 | res = register_attrs(resource, meter_attrs); |
693 | if (res) | ||
694 | goto error; | ||
695 | res = register_attrs(resource, meter_rw_attrs); | ||
696 | if (res) | 689 | if (res) |
697 | goto error; | 690 | goto error; |
698 | } | 691 | } |