Loading drivers/misc/apds990x.c +7 −7 Original line number Original line Diff line number Diff line Loading @@ -841,7 +841,7 @@ static ssize_t apds990x_prox_enable_store(struct device *dev, static DEVICE_ATTR(prox0_raw_en, S_IRUGO | S_IWUSR, apds990x_prox_enable_show, static DEVICE_ATTR(prox0_raw_en, S_IRUGO | S_IWUSR, apds990x_prox_enable_show, apds990x_prox_enable_store); apds990x_prox_enable_store); static const char reporting_modes[][9] = {"trigger", "periodic"}; static const char *reporting_modes[] = {"trigger", "periodic"}; static ssize_t apds990x_prox_reporting_mode_show(struct device *dev, static ssize_t apds990x_prox_reporting_mode_show(struct device *dev, struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf) Loading @@ -856,13 +856,13 @@ static ssize_t apds990x_prox_reporting_mode_store(struct device *dev, const char *buf, size_t len) const char *buf, size_t len) { { struct apds990x_chip *chip = dev_get_drvdata(dev); struct apds990x_chip *chip = dev_get_drvdata(dev); int ret; if (sysfs_streq(buf, reporting_modes[0])) ret = sysfs_match_string(reporting_modes, buf); chip->prox_continuous_mode = 0; if (ret < 0) else if (sysfs_streq(buf, reporting_modes[1])) return ret; chip->prox_continuous_mode = 1; else chip->prox_continuous_mode = ret; return -EINVAL; return len; return len; } } Loading Loading
drivers/misc/apds990x.c +7 −7 Original line number Original line Diff line number Diff line Loading @@ -841,7 +841,7 @@ static ssize_t apds990x_prox_enable_store(struct device *dev, static DEVICE_ATTR(prox0_raw_en, S_IRUGO | S_IWUSR, apds990x_prox_enable_show, static DEVICE_ATTR(prox0_raw_en, S_IRUGO | S_IWUSR, apds990x_prox_enable_show, apds990x_prox_enable_store); apds990x_prox_enable_store); static const char reporting_modes[][9] = {"trigger", "periodic"}; static const char *reporting_modes[] = {"trigger", "periodic"}; static ssize_t apds990x_prox_reporting_mode_show(struct device *dev, static ssize_t apds990x_prox_reporting_mode_show(struct device *dev, struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf) Loading @@ -856,13 +856,13 @@ static ssize_t apds990x_prox_reporting_mode_store(struct device *dev, const char *buf, size_t len) const char *buf, size_t len) { { struct apds990x_chip *chip = dev_get_drvdata(dev); struct apds990x_chip *chip = dev_get_drvdata(dev); int ret; if (sysfs_streq(buf, reporting_modes[0])) ret = sysfs_match_string(reporting_modes, buf); chip->prox_continuous_mode = 0; if (ret < 0) else if (sysfs_streq(buf, reporting_modes[1])) return ret; chip->prox_continuous_mode = 1; else chip->prox_continuous_mode = ret; return -EINVAL; return len; return len; } } Loading