diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-12-02 04:27:06 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-02 15:17:50 -0500 |
commit | 8efa5d7d6ad307ae2d220def37ca89594062c40d (patch) | |
tree | c56eac029c47751932a9b7c5a1432b53fbae3361 /drivers/net/wireless/ath/ath5k/led.c | |
parent | 4aa5d783c9e1c72e4950ff34f388077ccecac74a (diff) |
ath5k: Check if pci pdev struct is initialized in common functions.
To be able to support other busses than PCI check if pci device
structure is initialized.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/led.c')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/led.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c index 67aa52e9bf94..1f5a991aa0a9 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; |
@@ -165,6 +165,9 @@ int ath5k_init_leds(struct ath5k_softc *sc) | |||
165 | char name[ATH5K_LED_MAX_NAME_LEN + 1]; | 165 | char name[ATH5K_LED_MAX_NAME_LEN + 1]; |
166 | const struct pci_device_id *match; | 166 | const struct pci_device_id *match; |
167 | 167 | ||
168 | if (!sc->pdev) | ||
169 | return 0; | ||
170 | |||
168 | match = pci_match_id(&ath5k_led_devices[0], pdev); | 171 | match = pci_match_id(&ath5k_led_devices[0], pdev); |
169 | if (match) { | 172 | if (match) { |
170 | __set_bit(ATH_STAT_LEDSOFT, sc->status); | 173 | __set_bit(ATH_STAT_LEDSOFT, sc->status); |