diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-12-15 14:52:16 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-12-15 14:52:16 -0300 |
commit | 8d91c1e411f55d7ea91b1183a2e9f8088fb4d5be (patch) | |
tree | e9891aa6c295060d065adffd610c4f49ecf884f3 /drivers/leds/leds-fsg.c | |
parent | a71852147516bc1cb5b0b3cbd13639bfd4022dc8 (diff) |
Linux-libre 4.3.2-gnu
Diffstat (limited to 'drivers/leds/leds-fsg.c')
-rw-r--r-- | drivers/leds/leds-fsg.c | 52 |
1 files changed, 12 insertions, 40 deletions
diff --git a/drivers/leds/leds-fsg.c b/drivers/leds/leds-fsg.c index 2b4dc738d..257a813c7 100644 --- a/drivers/leds/leds-fsg.c +++ b/drivers/leds/leds-fsg.c @@ -156,63 +156,35 @@ static int fsg_led_probe(struct platform_device *pdev) latch_value = 0xffff; *latch_address = latch_value; - ret = led_classdev_register(&pdev->dev, &fsg_wlan_led); + ret = devm_led_classdev_register(&pdev->dev, &fsg_wlan_led); if (ret < 0) - goto failwlan; + return ret; - ret = led_classdev_register(&pdev->dev, &fsg_wan_led); + ret = devm_led_classdev_register(&pdev->dev, &fsg_wan_led); if (ret < 0) - goto failwan; + return ret; - ret = led_classdev_register(&pdev->dev, &fsg_sata_led); + ret = devm_led_classdev_register(&pdev->dev, &fsg_sata_led); if (ret < 0) - goto failsata; + return ret; - ret = led_classdev_register(&pdev->dev, &fsg_usb_led); + ret = devm_led_classdev_register(&pdev->dev, &fsg_usb_led); if (ret < 0) - goto failusb; + return ret; - ret = led_classdev_register(&pdev->dev, &fsg_sync_led); + ret = devm_led_classdev_register(&pdev->dev, &fsg_sync_led); if (ret < 0) - goto failsync; + return ret; - ret = led_classdev_register(&pdev->dev, &fsg_ring_led); + ret = devm_led_classdev_register(&pdev->dev, &fsg_ring_led); if (ret < 0) - goto failring; - - return ret; - - failring: - led_classdev_unregister(&fsg_sync_led); - failsync: - led_classdev_unregister(&fsg_usb_led); - failusb: - led_classdev_unregister(&fsg_sata_led); - failsata: - led_classdev_unregister(&fsg_wan_led); - failwan: - led_classdev_unregister(&fsg_wlan_led); - failwlan: + return ret; return ret; } -static int fsg_led_remove(struct platform_device *pdev) -{ - led_classdev_unregister(&fsg_wlan_led); - led_classdev_unregister(&fsg_wan_led); - led_classdev_unregister(&fsg_sata_led); - led_classdev_unregister(&fsg_usb_led); - led_classdev_unregister(&fsg_sync_led); - led_classdev_unregister(&fsg_ring_led); - - return 0; -} - - static struct platform_driver fsg_led_driver = { .probe = fsg_led_probe, - .remove = fsg_led_remove, .driver = { .name = "fsg-led", }, |