aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2012-03-23 18:02:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-23 19:58:35 -0400
commite13d97865942e9dcf4fdd39d9fb9c5ae31e7c3d1 (patch)
treecaf4b82c3b535e9b52e59370a6d104d86205958b
parentbbe6453204c568723679212f6d0653b92b3d6244 (diff)
leds-lm3530: replace i2c_client with led_classdev
To get members of lm3530_data, use 'struct led_classdev' rather than 'struct i2c_client'. [akpm@linux-foundation.org: fix 80-column fixes more nicely] Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/leds/leds-lm3530.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/leds/leds-lm3530.c b/drivers/leds/leds-lm3530.c
index 2c32a8c45f89..ce79523a4d10 100644
--- a/drivers/leds/leds-lm3530.c
+++ b/drivers/leds/leds-lm3530.c
@@ -297,11 +297,11 @@ static void lm3530_brightness_set(struct led_classdev *led_cdev,
297static ssize_t lm3530_mode_get(struct device *dev, 297static ssize_t lm3530_mode_get(struct device *dev,
298 struct device_attribute *attr, char *buf) 298 struct device_attribute *attr, char *buf)
299{ 299{
300 struct i2c_client *client = container_of( 300 struct led_classdev *led_cdev = dev_get_drvdata(dev);
301 dev->parent, struct i2c_client, dev); 301 struct lm3530_data *drvdata;
302 struct lm3530_data *drvdata = i2c_get_clientdata(client);
303 int i, len = 0; 302 int i, len = 0;
304 303
304 drvdata = container_of(led_cdev, struct lm3530_data, led_dev);
305 for (i = 0; i < ARRAY_SIZE(mode_map); i++) 305 for (i = 0; i < ARRAY_SIZE(mode_map); i++)
306 if (drvdata->mode == mode_map[i].mode_val) 306 if (drvdata->mode == mode_map[i].mode_val)
307 len += sprintf(buf + len, "[%s] ", mode_map[i].mode); 307 len += sprintf(buf + len, "[%s] ", mode_map[i].mode);
@@ -316,12 +316,11 @@ static ssize_t lm3530_mode_get(struct device *dev,
316static ssize_t lm3530_mode_set(struct device *dev, struct device_attribute 316static ssize_t lm3530_mode_set(struct device *dev, struct device_attribute
317 *attr, const char *buf, size_t size) 317 *attr, const char *buf, size_t size)
318{ 318{
319 int err; 319 struct led_classdev *led_cdev = dev_get_drvdata(dev);
320 struct i2c_client *client = container_of( 320 struct lm3530_data *drvdata;
321 dev->parent, struct i2c_client, dev); 321 int mode, err;
322 struct lm3530_data *drvdata = i2c_get_clientdata(client);
323 int mode;
324 322
323 drvdata = container_of(led_cdev, struct lm3530_data, led_dev);
325 mode = lm3530_get_mode_from_str(buf); 324 mode = lm3530_get_mode_from_str(buf);
326 if (mode < 0) { 325 if (mode < 0) {
327 dev_err(dev, "Invalid mode\n"); 326 dev_err(dev, "Invalid mode\n");