aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500pci.c
diff options
context:
space:
mode:
authorIvo van Doorn <IvDoorn@gmail.com>2008-06-03 14:30:01 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:17:55 -0400
commit475433be3d8f4d840e2930eef96671b7f8d11053 (patch)
tree0eab68260c952e08ef5767cadafaba4c1189efff /drivers/net/wireless/rt2x00/rt2500pci.c
parent2b08da3fb595432f87b5206c1c77dcb72300cacf (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/rt2500pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index b08932d7bf20..c8cf8c1d095f 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -277,6 +277,17 @@ static int rt2500pci_blink_set(struct led_classdev *led_cdev,
277 277
278 return 0; 278 return 0;
279} 279}
280
281static void rt2500pci_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 = rt2500pci_brightness_set;
288 led->led_dev.blink_set = rt2500pci_blink_set;
289 led->flags = LED_INITIALIZED;
290}
280#endif /* CONFIG_RT2500PCI_LEDS */ 291#endif /* CONFIG_RT2500PCI_LEDS */
281 292
282/* 293/*
@@ -1476,23 +1487,10 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
1476#ifdef CONFIG_RT2500PCI_LEDS 1487#ifdef CONFIG_RT2500PCI_LEDS
1477 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_LED_MODE); 1488 value = rt2x00_get_field16(eeprom, EEPROM_ANTENNA_LED_MODE);
1478 1489
1479 rt2x00dev->led_radio.rt2x00dev = rt2x00dev; 1490 rt2500pci_init_led(rt2x00dev, &rt2x00dev->led_radio, LED_TYPE_RADIO);
1480 rt2x00dev->led_radio.type = LED_TYPE_RADIO; 1491 if (value == LED_MODE_TXRX_ACTIVITY)
1481 rt2x00dev->led_radio.led_dev.brightness_set = 1492 rt2500pci_init_led(rt2x00dev, &rt2x00dev->led_qual,
1482 rt2500pci_brightness_set; 1493 LED_TYPE_ACTIVITY);
1483 rt2x00dev->led_radio.led_dev.blink_set =
1484 rt2500pci_blink_set;
1485 rt2x00dev->led_radio.flags = LED_INITIALIZED;
1486
1487 if (value == LED_MODE_TXRX_ACTIVITY) {
1488 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
1489 rt2x00dev->led_qual.type = LED_TYPE_ACTIVITY;
1490 rt2x00dev->led_qual.led_dev.brightness_set =
1491 rt2500pci_brightness_set;
1492 rt2x00dev->led_qual.led_dev.blink_set =
1493 rt2500pci_blink_set;
1494 rt2x00dev->led_qual.flags = LED_INITIALIZED;
1495 }
1496#endif /* CONFIG_RT2500PCI_LEDS */ 1494#endif /* CONFIG_RT2500PCI_LEDS */
1497 1495
1498 /* 1496 /*