Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295192
b: refs/heads/master
c: e13d978
h: refs/heads/master
v: v3
  • Loading branch information
Kim, Milo authored and Linus Torvalds committed Mar 23, 2012
1 parent da774bd commit 0dc23f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbe6453204c568723679212f6d0653b92b3d6244
refs/heads/master: e13d97865942e9dcf4fdd39d9fb9c5ae31e7c3d1
15 changes: 7 additions & 8 deletions trunk/drivers/leds/leds-lm3530.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,11 @@ static void lm3530_brightness_set(struct led_classdev *led_cdev,
static ssize_t lm3530_mode_get(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct i2c_client *client = container_of(
dev->parent, struct i2c_client, dev);
struct lm3530_data *drvdata = i2c_get_clientdata(client);
struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct lm3530_data *drvdata;
int i, len = 0;

drvdata = container_of(led_cdev, struct lm3530_data, led_dev);
for (i = 0; i < ARRAY_SIZE(mode_map); i++)
if (drvdata->mode == mode_map[i].mode_val)
len += sprintf(buf + len, "[%s] ", mode_map[i].mode);
Expand All @@ -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
*attr, const char *buf, size_t size)
{
int err;
struct i2c_client *client = container_of(
dev->parent, struct i2c_client, dev);
struct lm3530_data *drvdata = i2c_get_clientdata(client);
int mode;
struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct lm3530_data *drvdata;
int mode, err;

drvdata = container_of(led_cdev, struct lm3530_data, led_dev);
mode = lm3530_get_mode_from_str(buf);
if (mode < 0) {
dev_err(dev, "Invalid mode\n");
Expand Down

0 comments on commit 0dc23f4

Please sign in to comment.