[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150227090345.GA4891@jack-ThinkPad-T520>
Date: Fri, 27 Feb 2015 18:03:45 +0900
From: Gyungoh Yoo <gyungoh@...il.com>
To: Oliver Neukum <oneukum@...e.de>
Cc: sameo@...ux.intel.com, lee.jones@...aro.org, robh+dt@...nel.org,
jg1.han@...sung.com, pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
trivial@...nel.org, broonie@...nel.org, florian.vaussard@...l.ch,
andrew@...n.ch, antonynpavlov@...il.com, hytszk@...il.com,
plagnioj@...osoft.com, tomi.valkeinen@...com,
jack.yoo@...worksinc.com, linux-fbdev@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
treding@...dia.com, p.zabel@...gutronix.de, arno@...isbad.org,
kuninori.morimoto.gx@...esas.com
Subject: Re: [PATCH v11 2/6] backlight: Add support Skyworks SKY81452
backlight driver
On Fri, Feb 27, 2015 at 09:58:38AM +0100, Oliver Neukum wrote:
> On Fri, 2015-02-27 at 15:42 +0900, gyungoh@...il.com wrote:
> > +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.
>
> > +
> > + ret = regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN,
> > + value << CTZ(SKY81452_EN));
> > + if (IS_ERR_VALUE(ret))
> > + return ret;
> > +
> > + return count;
> > +}
>
> Regards
> Oliver
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists