提交 5ba6bcbc 编写于 作者: J Jean Delvare 提交者: Guenter Roeck

hwmon: Constify str parameter of hwmon_ops->read_string

The read_string callback is supposed to retrieve a pointer to a
constant string.
Signed-off-by: NJean Delvare <jdelvare@suse.de>
Reviewed-by: NPeter Huewe <peterhuewe@gmx.de>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 b3ee2785
...@@ -186,7 +186,7 @@ static ssize_t hwmon_attr_show_string(struct device *dev, ...@@ -186,7 +186,7 @@ static ssize_t hwmon_attr_show_string(struct device *dev,
char *buf) char *buf)
{ {
struct hwmon_device_attribute *hattr = to_hwmon_attr(devattr); struct hwmon_device_attribute *hattr = to_hwmon_attr(devattr);
char *s; const char *s;
int ret; int ret;
ret = hattr->ops->read_string(dev, hattr->type, hattr->attr, ret = hattr->ops->read_string(dev, hattr->type, hattr->attr,
......
...@@ -337,7 +337,7 @@ struct hwmon_ops { ...@@ -337,7 +337,7 @@ struct hwmon_ops {
int (*read)(struct device *dev, enum hwmon_sensor_types type, int (*read)(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val); u32 attr, int channel, long *val);
int (*read_string)(struct device *dev, enum hwmon_sensor_types type, int (*read_string)(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, char **str); u32 attr, int channel, const char **str);
int (*write)(struct device *dev, enum hwmon_sensor_types type, int (*write)(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long val); u32 attr, int channel, long val);
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册