Commit e13d9786 authored by Kim, Milo's avatar Kim, Milo Committed by Linus Torvalds

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: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bbe64532
...@@ -297,11 +297,11 @@ static void lm3530_brightness_set(struct led_classdev *led_cdev, ...@@ -297,11 +297,11 @@ static void lm3530_brightness_set(struct led_classdev *led_cdev,
static ssize_t lm3530_mode_get(struct device *dev, static ssize_t lm3530_mode_get(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct i2c_client *client = container_of( struct led_classdev *led_cdev = dev_get_drvdata(dev);
dev->parent, struct i2c_client, dev); struct lm3530_data *drvdata;
struct lm3530_data *drvdata = i2c_get_clientdata(client);
int i, len = 0; int i, len = 0;
drvdata = container_of(led_cdev, struct lm3530_data, led_dev);
for (i = 0; i < ARRAY_SIZE(mode_map); i++) for (i = 0; i < ARRAY_SIZE(mode_map); i++)
if (drvdata->mode == mode_map[i].mode_val) if (drvdata->mode == mode_map[i].mode_val)
len += sprintf(buf + len, "[%s] ", mode_map[i].mode); len += sprintf(buf + len, "[%s] ", mode_map[i].mode);
...@@ -316,12 +316,11 @@ static ssize_t lm3530_mode_get(struct device *dev, ...@@ -316,12 +316,11 @@ static ssize_t lm3530_mode_get(struct device *dev,
static ssize_t lm3530_mode_set(struct device *dev, struct device_attribute static ssize_t lm3530_mode_set(struct device *dev, struct device_attribute
*attr, const char *buf, size_t size) *attr, const char *buf, size_t size)
{ {
int err; struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct i2c_client *client = container_of( struct lm3530_data *drvdata;
dev->parent, struct i2c_client, dev); int mode, err;
struct lm3530_data *drvdata = i2c_get_clientdata(client);
int mode;
drvdata = container_of(led_cdev, struct lm3530_data, led_dev);
mode = lm3530_get_mode_from_str(buf); mode = lm3530_get_mode_from_str(buf);
if (mode < 0) { if (mode < 0) {
dev_err(dev, "Invalid mode\n"); dev_err(dev, "Invalid mode\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment