Skip to content

Commit

Permalink
hwmon: Constify str parameter of hwmon_ops->read_string
Browse files Browse the repository at this point in the history
The read_string callback is supposed to retrieve a pointer to a
constant string.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Jean Delvare authored and Guenter Roeck committed Apr 2, 2017
1 parent b3ee278 commit 5ba6bcb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/hwmon/hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static ssize_t hwmon_attr_show_string(struct device *dev,
char *buf)
{
struct hwmon_device_attribute *hattr = to_hwmon_attr(devattr);
char *s;
const char *s;
int ret;

ret = hattr->ops->read_string(dev, hattr->type, hattr->attr,
Expand Down
2 changes: 1 addition & 1 deletion include/linux/hwmon.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ struct hwmon_ops {
int (*read)(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val);
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,
u32 attr, int channel, long val);
};
Expand Down

0 comments on commit 5ba6bcb

Please sign in to comment.