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>
This commit is contained in:

committed by
John W. Linville

parent
4aa5d783c9
commit
8efa5d7d6a
@@ -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);
|
||||
|
Reference in New Issue
Block a user