diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 36ed50d4b276..c22dc1e07911 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -278,10 +278,10 @@ static struct attribute *hwmon_genattr(struct device *dev, if (!mode) return ERR_PTR(-ENOENT); - if ((mode & S_IRUGO) && ((is_string && !ops->read_string) || + if ((mode & 0444) && ((is_string && !ops->read_string) || (!is_string && !ops->read))) return ERR_PTR(-EINVAL); - if ((mode & S_IWUGO) && !ops->write) + if ((mode & 0222) && !ops->write) return ERR_PTR(-EINVAL); hattr = devm_kzalloc(dev, sizeof(*hattr), GFP_KERNEL);