Commit 580171f7 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

ath9k: propagate errors on ath_init_device() and request_irq()

We've cleaned up ath_init_device() and its children enough
to pass meaninful errors back from probe. When this fails
it means our device could not be initialized and a meaninful
error will have been passed.

Do the same for request_irq() and also synchronize the error
messages while at it.
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent db6be53c
...@@ -120,16 +120,14 @@ static int ath_ahb_probe(struct platform_device *pdev) ...@@ -120,16 +120,14 @@ static int ath_ahb_probe(struct platform_device *pdev)
sc->irq = irq; sc->irq = irq;
ret = ath_init_device(AR5416_AR9100_DEVID, sc); ret = ath_init_device(AR5416_AR9100_DEVID, sc);
if (ret != 0) { if (ret) {
dev_err(&pdev->dev, "failed to attach device, err=%d\n", ret); dev_err(&pdev->dev, "failed to initialize device\n");
ret = -ENODEV;
goto err_free_hw; goto err_free_hw;
} }
ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc); ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc);
if (ret) { if (ret) {
dev_err(&pdev->dev, "request_irq failed, err=%d\n", ret); dev_err(&pdev->dev, "request_irq failed\n");
ret = -EIO;
goto err_detach; goto err_detach;
} }
......
...@@ -179,17 +179,17 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -179,17 +179,17 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
sc->mem = mem; sc->mem = mem;
sc->bus_ops = &ath_pci_bus_ops; sc->bus_ops = &ath_pci_bus_ops;
if (ath_init_device(id->device, sc) != 0) { ret = ath_init_device(id->device, sc);
ret = -ENODEV; if (ret) {
dev_err(&pdev->dev, "failed to initialize device\n");
goto bad3; goto bad3;
} }
/* setup interrupt service routine */ /* setup interrupt service routine */
if (request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath", sc)) { ret = request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath", sc);
printk(KERN_ERR "%s: request_irq failed\n", if (ret) {
wiphy_name(hw->wiphy)); dev_err(&pdev->dev, "request_irq failed\n");
ret = -EIO;
goto bad4; goto bad4;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment