diff options
Diffstat (limited to 'drivers/hwmon/ibmpex.c')
| -rw-r--r-- | drivers/hwmon/ibmpex.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/hwmon/ibmpex.c b/drivers/hwmon/ibmpex.c index b2ab83c9fd9a..228c5f6c6f38 100644 --- a/drivers/hwmon/ibmpex.c +++ b/drivers/hwmon/ibmpex.c @@ -66,7 +66,7 @@ struct ibmpex_bmc_data { struct device *hwmon_dev; struct device *bmc_device; struct mutex lock; - char valid; + bool valid; unsigned long last_updated; /* In jiffies */ struct ipmi_addr address; @@ -239,7 +239,7 @@ static void ibmpex_update_device(struct ibmpex_bmc_data *data) } data->last_updated = jiffies; - data->valid = 1; + data->valid = true; out: mutex_unlock(&data->lock); @@ -256,12 +256,7 @@ static struct ibmpex_bmc_data *get_bmc_data(int iface) return NULL; } -static ssize_t name_show(struct device *dev, struct device_attribute *devattr, - char *buf) -{ - return sprintf(buf, "%s\n", DRVNAME); -} -static SENSOR_DEVICE_ATTR_RO(name, name, 0); +static DEVICE_STRING_ATTR_RO(name, 0444, DRVNAME); static ssize_t ibmpex_show_sensor(struct device *dev, struct device_attribute *devattr, @@ -415,8 +410,7 @@ static int ibmpex_find_sensors(struct ibmpex_bmc_data *data) if (err) goto exit_remove; - err = device_create_file(data->bmc_device, - &sensor_dev_attr_name.dev_attr); + err = device_create_file(data->bmc_device, &dev_attr_name.attr); if (err) goto exit_remove; @@ -425,7 +419,7 @@ static int ibmpex_find_sensors(struct ibmpex_bmc_data *data) exit_remove: device_remove_file(data->bmc_device, &sensor_dev_attr_reset_high_low.dev_attr); - device_remove_file(data->bmc_device, &sensor_dev_attr_name.dev_attr); + device_remove_file(data->bmc_device, &dev_attr_name.attr); for (i = 0; i < data->num_sensors; i++) for (j = 0; j < PEX_NUM_SENSOR_FUNCS; j++) { if (!data->sensors[i].attr[j].dev_attr.attr.name) @@ -502,6 +496,7 @@ static void ibmpex_register_bmc(int iface, struct device *dev) return; out_register: + list_del(&data->list); hwmon_device_unregister(data->hwmon_dev); out_user: ipmi_destroy_user(data->user); @@ -515,7 +510,7 @@ static void ibmpex_bmc_delete(struct ibmpex_bmc_data *data) device_remove_file(data->bmc_device, &sensor_dev_attr_reset_high_low.dev_attr); - device_remove_file(data->bmc_device, &sensor_dev_attr_name.dev_attr); + device_remove_file(data->bmc_device, &dev_attr_name.attr); for (i = 0; i < data->num_sensors; i++) for (j = 0; j < PEX_NUM_SENSOR_FUNCS; j++) { if (!data->sensors[i].attr[j].dev_attr.attr.name) @@ -545,7 +540,7 @@ static void ibmpex_bmc_gone(int iface) static void ibmpex_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) { - struct ibmpex_bmc_data *data = (struct ibmpex_bmc_data *)user_msg_data; + struct ibmpex_bmc_data *data = user_msg_data; if (msg->msgid != data->tx_msgid) { dev_err(data->bmc_device, |
