diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 84f61cec6319..36ed50d4b276 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -267,7 +267,7 @@ static struct attribute *hwmon_genattr(struct device *dev, struct device_attribute *dattr; struct attribute *a; umode_t mode; - char *name; + const char *name; bool is_string = is_string_attr(type, attr); /* The attribute is invisible if there is no template string */ @@ -289,7 +289,7 @@ static struct attribute *hwmon_genattr(struct device *dev, return ERR_PTR(-ENOMEM); if (type == hwmon_chip) { - name = (char *)template; + name = template; } else { scnprintf(hattr->name, sizeof(hattr->name), template, index + hwmon_attr_base(type));