diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/led.c')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/led.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c index 67aa52e9bf94..576edf2965dc 100644 --- a/drivers/net/wireless/ath/ath5k/led.c +++ b/drivers/net/wireless/ath/ath5k/led.c | |||
@@ -133,7 +133,7 @@ ath5k_register_led(struct ath5k_softc *sc, struct ath5k_led *led, | |||
133 | led->led_dev.default_trigger = trigger; | 133 | led->led_dev.default_trigger = trigger; |
134 | led->led_dev.brightness_set = ath5k_led_brightness_set; | 134 | led->led_dev.brightness_set = ath5k_led_brightness_set; |
135 | 135 | ||
136 | err = led_classdev_register(&sc->pdev->dev, &led->led_dev); | 136 | err = led_classdev_register(sc->dev, &led->led_dev); |
137 | if (err) { | 137 | if (err) { |
138 | ATH5K_WARN(sc, "could not register LED %s\n", name); | 138 | ATH5K_WARN(sc, "could not register LED %s\n", name); |
139 | led->sc = NULL; | 139 | led->sc = NULL; |
@@ -161,11 +161,20 @@ int ath5k_init_leds(struct ath5k_softc *sc) | |||
161 | { | 161 | { |
162 | int ret = 0; | 162 | int ret = 0; |
163 | struct ieee80211_hw *hw = sc->hw; | 163 | struct ieee80211_hw *hw = sc->hw; |
164 | #ifndef CONFIG_ATHEROS_AR231X | ||
164 | struct pci_dev *pdev = sc->pdev; | 165 | struct pci_dev *pdev = sc->pdev; |
166 | #endif | ||
165 | char name[ATH5K_LED_MAX_NAME_LEN + 1]; | 167 | char name[ATH5K_LED_MAX_NAME_LEN + 1]; |
166 | const struct pci_device_id *match; | 168 | const struct pci_device_id *match; |
167 | 169 | ||
170 | if (!sc->pdev) | ||
171 | return 0; | ||
172 | |||
173 | #ifdef CONFIG_ATHEROS_AR231X | ||
174 | match = NULL; | ||
175 | #else | ||
168 | match = pci_match_id(&ath5k_led_devices[0], pdev); | 176 | match = pci_match_id(&ath5k_led_devices[0], pdev); |
177 | #endif | ||
169 | if (match) { | 178 | if (match) { |
170 | __set_bit(ATH_STAT_LEDSOFT, sc->status); | 179 | __set_bit(ATH_STAT_LEDSOFT, sc->status); |
171 | sc->led_pin = ATH_PIN(match->driver_data); | 180 | sc->led_pin = ATH_PIN(match->driver_data); |