aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath5k/led.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-12-02 10:27:06 +0100
committerJohn W. Linville <linville@tuxdriver.com>2010-12-02 15:17:50 -0500
commit8efa5d7d6ad307ae2d220def37ca89594062c40d (patch)
treec56eac029c47751932a9b7c5a1432b53fbae3361 /drivers/net/wireless/ath/ath5k/led.c
parent4aa5d783c9e1c72e4950ff34f388077ccecac74a (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.c5
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 67aa52e9bf9..1f5a991aa0a 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,
led->led_dev.default_trigger = trigger;
led->led_dev.brightness_set = ath5k_led_brightness_set;
- err = led_classdev_register(&sc->pdev->dev, &led->led_dev);
+ err = led_classdev_register(sc->dev, &led->led_dev);
if (err) {
ATH5K_WARN(sc, "could not register LED %s\n", name);
led->sc = NULL;
@@ -165,6 +165,9 @@ int ath5k_init_leds(struct ath5k_softc *sc)
char name[ATH5K_LED_MAX_NAME_LEN + 1];
const struct pci_device_id *match;
+ if (!sc->pdev)
+ return 0;
+
match = pci_match_id(&ath5k_led_devices[0], pdev);
if (match) {
__set_bit(ATH_STAT_LEDSOFT, sc->status);