diff options
author | Ivo van Doorn <IvDoorn@gmail.com> | 2008-06-03 14:30:01 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-14 12:17:55 -0400 |
commit | 475433be3d8f4d840e2930eef96671b7f8d11053 (patch) | |
tree | 0eab68260c952e08ef5767cadafaba4c1189efff /drivers/net/wireless/rt2x00/rt2400pci.c | |
parent | 2b08da3fb595432f87b5206c1c77dcb72300cacf (diff) |
rt2x00: Move led initialization into function
Reduce code duplication by moving led structure initialization
into a per-driver function.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2400pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index cfb720f35b2c..94226b47d1d9 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -277,6 +277,17 @@ static int rt2400pci_blink_set(struct led_classdev *led_cdev, | |||
277 | 277 | ||
278 | return 0; | 278 | return 0; |
279 | } | 279 | } |
280 | |||
281 | static void rt2400pci_init_led(struct rt2x00_dev *rt2x00dev, | ||
282 | struct rt2x00_led *led, | ||
283 | enum led_type type) | ||
284 | { | ||
285 | led->rt2x00dev = rt2x00dev; | ||
286 | led->type = type; | ||
287 | led->led_dev.brightness_set = rt2400pci_brightness_set; | ||
288 | led->led_dev.blink_set = rt2400pci_blink_set; | ||
289 | led->flags = LED_INITIALIZED; | ||
290 | } | ||
280 | #endif /* CONFIG_RT2400PCI_LEDS */ | 291 | #endif /* CONFIG_RT2400PCI_LEDS */ |
281 | 292 | ||
282 | /* | 293 | /* |
@@ -1298,23 +1309,10 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1298 | #ifdef CONFIG_RT2400PCI_LEDS | 1309 | #ifdef CONFIG_RT2400PCI_LEDS |
1299 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_LED_MODE); | 1310 | value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_LED_MODE); |
1300 | 1311 | ||
1301 | rt2x00dev->led_radio.rt2x00dev = rt2x00dev; | 1312 | rt2400pci_init_led(rt2x00dev, &rt2x00dev->led_radio, LED_TYPE_RADIO); |
1302 | rt2x00dev->led_radio.type = LED_TYPE_RADIO; | 1313 | if (value == LED_MODE_TXRX_ACTIVITY) |
1303 | rt2x00dev->led_radio.led_dev.brightness_set = | 1314 | rt2400pci_init_led(rt2x00dev, &rt2x00dev->led_qual, |
1304 | rt2400pci_brightness_set; | 1315 | LED_TYPE_ACTIVITY); |
1305 | rt2x00dev->led_radio.led_dev.blink_set = | ||
1306 | rt2400pci_blink_set; | ||
1307 | rt2x00dev->led_radio.flags = LED_INITIALIZED; | ||
1308 | |||
1309 | if (value == LED_MODE_TXRX_ACTIVITY) { | ||
1310 | rt2x00dev->led_qual.rt2x00dev = rt2x00dev; | ||
1311 | rt2x00dev->led_qual.type = LED_TYPE_ACTIVITY; | ||
1312 | rt2x00dev->led_qual.led_dev.brightness_set = | ||
1313 | rt2400pci_brightness_set; | ||
1314 | rt2x00dev->led_qual.led_dev.blink_set = | ||
1315 | rt2400pci_blink_set; | ||
1316 | rt2x00dev->led_qual.flags = LED_INITIALIZED; | ||
1317 | } | ||
1318 | #endif /* CONFIG_RT2400PCI_LEDS */ | 1316 | #endif /* CONFIG_RT2400PCI_LEDS */ |
1319 | 1317 | ||
1320 | /* | 1318 | /* |