Re: [PATCH v11 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Gyungoh Yoo <hidden>
Date: 2015-02-27 09:04:04
Also in:
linux-devicetree, lkml
From: Gyungoh Yoo <hidden>
Date: 2015-02-27 09:04:04
Also in:
linux-devicetree, lkml
On Fri, Feb 27, 2015 at 09:58:38AM +0100, Oliver Neukum wrote:
On Fri, 2015-02-27 at 15:42 +0900, gyungoh@gmail.com wrote:quoted
+static ssize_t sky81452_bl_store_enable(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + struct regmap *regmap = bl_get_data(to_backlight_device(dev)); + unsigned long value; + int ret; + + ret = kstrtoul(buf, 16, &value); + if (IS_ERR_VALUE(ret)) + return ret;No range checking?
It doesn't need it. below regmap_update_bits() is masking the value.
quoted
+ + ret = regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, + value << CTZ(SKY81452_EN)); + if (IS_ERR_VALUE(ret)) + return ret; + + return count; +}Regards Oliver