diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2014-10-23 19:32:25 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-01 11:22:05 -0400 |
commit | 01f7ab34325e76301915d5a4604834c5e2a91e74 (patch) | |
tree | 558a078e259ee03f1089691da847343298200df5 /arch | |
parent | 8a5f1efbb1a13cd2e2a1c2d1ae3773821e8b1d67 (diff) |
MIPS: SEAD3: Collect LED platform device registration in a single file.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Bryan Wu <cooloney@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: linux-leds@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8203/
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/mti-sead3/leds-sead3.c | 19 | ||||
-rw-r--r-- | arch/mips/mti-sead3/sead3-leds.c | 18 |
2 files changed, 15 insertions, 22 deletions
diff --git a/arch/mips/mti-sead3/leds-sead3.c b/arch/mips/mti-sead3/leds-sead3.c index 3abe47b316aa..3346c31f4f02 100644 --- a/arch/mips/mti-sead3/leds-sead3.c +++ b/arch/mips/mti-sead3/leds-sead3.c | |||
@@ -15,8 +15,6 @@ | |||
15 | 15 | ||
16 | #define DRVNAME "sead3-led" | 16 | #define DRVNAME "sead3-led" |
17 | 17 | ||
18 | static struct platform_device *pdev; | ||
19 | |||
20 | static void sead3_pled_set(struct led_classdev *led_cdev, | 18 | static void sead3_pled_set(struct led_classdev *led_cdev, |
21 | enum led_brightness value) | 19 | enum led_brightness value) |
22 | { | 20 | { |
@@ -75,26 +73,11 @@ static struct platform_driver sead3_led_driver = { | |||
75 | 73 | ||
76 | static int __init sead3_led_init(void) | 74 | static int __init sead3_led_init(void) |
77 | { | 75 | { |
78 | int ret; | 76 | return platform_driver_register(&sead3_led_driver); |
79 | |||
80 | ret = platform_driver_register(&sead3_led_driver); | ||
81 | if (ret < 0) | ||
82 | goto out; | ||
83 | |||
84 | pdev = platform_device_register_simple(DRVNAME, -1, NULL, 0); | ||
85 | if (IS_ERR(pdev)) { | ||
86 | ret = PTR_ERR(pdev); | ||
87 | platform_driver_unregister(&sead3_led_driver); | ||
88 | goto out; | ||
89 | } | ||
90 | |||
91 | out: | ||
92 | return ret; | ||
93 | } | 77 | } |
94 | 78 | ||
95 | static void __exit sead3_led_exit(void) | 79 | static void __exit sead3_led_exit(void) |
96 | { | 80 | { |
97 | platform_device_unregister(pdev); | ||
98 | platform_driver_unregister(&sead3_led_driver); | 81 | platform_driver_unregister(&sead3_led_driver); |
99 | } | 82 | } |
100 | 83 | ||
diff --git a/arch/mips/mti-sead3/sead3-leds.c b/arch/mips/mti-sead3/sead3-leds.c index c427c5778186..c6fa3e44cb8a 100644 --- a/arch/mips/mti-sead3/sead3-leds.c +++ b/arch/mips/mti-sead3/sead3-leds.c | |||
@@ -70,10 +70,20 @@ static struct platform_device fled_device = { | |||
70 | .resource = fled_resources | 70 | .resource = fled_resources |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static int __init led_init(void) | 73 | static struct platform_device sead3_led_device = { |
74 | .name = "sead3-led", | ||
75 | .id = -1, | ||
76 | }; | ||
77 | |||
78 | struct platform_device *sead3_led_devices[] = { | ||
79 | &pled_device, | ||
80 | &fled_device, | ||
81 | &sead3_led_device, | ||
82 | }; | ||
83 | |||
84 | static int __init sead3_led_init(void) | ||
74 | { | 85 | { |
75 | platform_device_register(&pled_device); | 86 | return platform_add_devices(sead3_led_devices, ARRAY_SIZE(sead3_led_devices)); |
76 | return platform_device_register(&fled_device); | ||
77 | } | 87 | } |
78 | 88 | ||
79 | device_initcall(led_init); | 89 | device_initcall(sead3_led_init); |