summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lm3530.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-07 17:25:10 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-07 17:25:10 -0700
commit43c40df2c7fedce640a6c39fcdf58764f6bbac5c (patch)
treebb55c6ad7db5d91f6066d2c4e36d270522ff27d0 /drivers/leds/leds-lm3530.c
parent7385d6fd88dd7981cdef8aa91e46570e5ba068c8 (diff)
parente661c8978e4833d4148d08b405a2f3175d6f97d9 (diff)
downloadlinux-stable-43c40df2c7fedce640a6c39fcdf58764f6bbac5c.tar.gz
linux-stable-43c40df2c7fedce640a6c39fcdf58764f6bbac5c.tar.bz2
linux-stable-43c40df2c7fedce640a6c39fcdf58764f6bbac5c.zip
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED updates from Bryan Wu: "This cycle we got: - a fix of attribute-creation race for the whole leds subsystem - new drivers (HID:GT683R, leds-ipaq-micro) - other fixing and clean up" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (23 commits) leds: ipaq-micro: fix sparse non static symbol warning leds: add driver for the iPAQ micro Documentation: dts: tcs6507: Fix wrong statement about #gpio-cells leds: convert blink timer to workqueue leds:pca963x: Update for PCA9635 and correct statement about MODE2 OUTDRV default leds:pca963x: Always initialize MODE2 register leds:pca963x: Add support for PCA9635 LED driver chip HID: gt683r: move mode attribute to led-class devices HID: gt683r: fix race condition HID: add support for MSI GT683R led panels leds: lp55xx-common: fix attribute-creation race leds: lp55xx-common: fix sysfs entry leak input: lm8323: fix attribute-creation race leds: wm831x-status: fix attribute-creation race leds: ss4200: fix attribute-creation race leds: ns2: fix attribute-creation race leds: netxbig: fix attribute-creation race leds: max8997: fix attribute-creation race leds: lm3642: fix attribute-creation race leds: lm355x: fix attribute-creation race ...
Diffstat (limited to 'drivers/leds/leds-lm3530.c')
-rw-r--r--drivers/leds/leds-lm3530.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/leds/leds-lm3530.c b/drivers/leds/leds-lm3530.c
index 652368c2ea9a..91325de3cd33 100644
--- a/drivers/leds/leds-lm3530.c
+++ b/drivers/leds/leds-lm3530.c
@@ -400,6 +400,12 @@ static ssize_t lm3530_mode_set(struct device *dev, struct device_attribute
}
static DEVICE_ATTR(mode, 0644, lm3530_mode_get, lm3530_mode_set);
+static struct attribute *lm3530_attrs[] = {
+ &dev_attr_mode.attr,
+ NULL
+};
+ATTRIBUTE_GROUPS(lm3530);
+
static int lm3530_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@@ -436,6 +442,7 @@ static int lm3530_probe(struct i2c_client *client,
drvdata->led_dev.name = LM3530_LED_DEV;
drvdata->led_dev.brightness_set = lm3530_brightness_set;
drvdata->led_dev.max_brightness = MAX_BRIGHTNESS;
+ drvdata->led_dev.groups = lm3530_groups;
i2c_set_clientdata(client, drvdata);
@@ -461,26 +468,13 @@ static int lm3530_probe(struct i2c_client *client,
return err;
}
- err = device_create_file(drvdata->led_dev.dev, &dev_attr_mode);
- if (err < 0) {
- dev_err(&client->dev, "File device creation failed: %d\n", err);
- err = -ENODEV;
- goto err_create_file;
- }
-
return 0;
-
-err_create_file:
- led_classdev_unregister(&drvdata->led_dev);
- return err;
}
static int lm3530_remove(struct i2c_client *client)
{
struct lm3530_data *drvdata = i2c_get_clientdata(client);
- device_remove_file(drvdata->led_dev.dev, &dev_attr_mode);
-
lm3530_led_disable(drvdata);
led_classdev_unregister(&drvdata->led_dev);
return 0;