diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-07 17:25:10 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-07 17:25:10 -0700 |
commit | 43c40df2c7fedce640a6c39fcdf58764f6bbac5c (patch) | |
tree | bb55c6ad7db5d91f6066d2c4e36d270522ff27d0 /drivers/input | |
parent | 7385d6fd88dd7981cdef8aa91e46570e5ba068c8 (diff) | |
parent | e661c8978e4833d4148d08b405a2f3175d6f97d9 (diff) |
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/input')
-rw-r--r-- | drivers/input/keyboard/lm8323.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index 0b42118cbf8f..cb32e2b506b7 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c @@ -558,6 +558,12 @@ static ssize_t lm8323_pwm_store_time(struct device *dev, } static DEVICE_ATTR(time, 0644, lm8323_pwm_show_time, lm8323_pwm_store_time); +static struct attribute *lm8323_pwm_attrs[] = { + &dev_attr_time.attr, + NULL +}; +ATTRIBUTE_GROUPS(lm8323_pwm); + static int init_pwm(struct lm8323_chip *lm, int id, struct device *dev, const char *name) { @@ -580,16 +586,11 @@ static int init_pwm(struct lm8323_chip *lm, int id, struct device *dev, if (name) { pwm->cdev.name = name; pwm->cdev.brightness_set = lm8323_pwm_set_brightness; + pwm->cdev.groups = lm8323_pwm_groups; if (led_classdev_register(dev, &pwm->cdev) < 0) { dev_err(dev, "couldn't register PWM %d\n", id); return -1; } - if (device_create_file(pwm->cdev.dev, - &dev_attr_time) < 0) { - dev_err(dev, "couldn't register time attribute\n"); - led_classdev_unregister(&pwm->cdev); - return -1; - } pwm->enabled = true; } @@ -753,11 +754,8 @@ fail3: device_remove_file(&client->dev, &dev_attr_disable_kp); fail2: while (--pwm >= 0) - if (lm->pwm[pwm].enabled) { - device_remove_file(lm->pwm[pwm].cdev.dev, - &dev_attr_time); + if (lm->pwm[pwm].enabled) led_classdev_unregister(&lm->pwm[pwm].cdev); - } fail1: input_free_device(idev); kfree(lm); @@ -777,10 +775,8 @@ static int lm8323_remove(struct i2c_client *client) device_remove_file(&lm->client->dev, &dev_attr_disable_kp); for (i = 0; i < 3; i++) - if (lm->pwm[i].enabled) { - device_remove_file(lm->pwm[i].cdev.dev, &dev_attr_time); + if (lm->pwm[i].enabled) led_classdev_unregister(&lm->pwm[i].cdev); - } kfree(lm); |