diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-12-02 09:27:06 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-02 20:17:50 (GMT) |
commit | 8efa5d7d6ad307ae2d220def37ca89594062c40d (patch) | |
tree | c56eac029c47751932a9b7c5a1432b53fbae3361 /drivers/net/wireless/ath/ath5k/led.c | |
parent | 4aa5d783c9e1c72e4950ff34f388077ccecac74a (diff) | |
download | linux-8efa5d7d6ad307ae2d220def37ca89594062c40d.tar.xz |
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 67aa52e..1f5a991 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); |