diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-09-02 20:02:18 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-09-08 16:31:04 -0400 |
commit | 580171f7cd08687cdf1b263aabb35608b3c37433 (patch) | |
tree | f11b817d537e100df257256cb6937d9b73640d33 /drivers/net/wireless/ath | |
parent | db6be53cbaf118fdad5bdca211a19ca5354c9462 (diff) |
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: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ahb.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/pci.c | 12 |
2 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c index 5618fc25d52f..7dc6301ae201 100644 --- a/drivers/net/wireless/ath/ath9k/ahb.c +++ b/drivers/net/wireless/ath/ath9k/ahb.c | |||
@@ -120,16 +120,14 @@ static int ath_ahb_probe(struct platform_device *pdev) | |||
120 | sc->irq = irq; | 120 | sc->irq = irq; |
121 | 121 | ||
122 | ret = ath_init_device(AR5416_AR9100_DEVID, sc); | 122 | ret = ath_init_device(AR5416_AR9100_DEVID, sc); |
123 | if (ret != 0) { | 123 | if (ret) { |
124 | dev_err(&pdev->dev, "failed to attach device, err=%d\n", ret); | 124 | dev_err(&pdev->dev, "failed to initialize device\n"); |
125 | ret = -ENODEV; | ||
126 | goto err_free_hw; | 125 | goto err_free_hw; |
127 | } | 126 | } |
128 | 127 | ||
129 | ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc); | 128 | ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc); |
130 | if (ret) { | 129 | if (ret) { |
131 | dev_err(&pdev->dev, "request_irq failed, err=%d\n", ret); | 130 | dev_err(&pdev->dev, "request_irq failed\n"); |
132 | ret = -EIO; | ||
133 | goto err_detach; | 131 | goto err_detach; |
134 | } | 132 | } |
135 | 133 | ||
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index 17862ccc3400..bc4bc2c2d378 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c | |||
@@ -179,17 +179,17 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
179 | sc->mem = mem; | 179 | sc->mem = mem; |
180 | sc->bus_ops = &ath_pci_bus_ops; | 180 | sc->bus_ops = &ath_pci_bus_ops; |
181 | 181 | ||
182 | if (ath_init_device(id->device, sc) != 0) { | 182 | ret = ath_init_device(id->device, sc); |
183 | ret = -ENODEV; | 183 | if (ret) { |
184 | dev_err(&pdev->dev, "failed to initialize device\n"); | ||
184 | goto bad3; | 185 | goto bad3; |
185 | } | 186 | } |
186 | 187 | ||
187 | /* setup interrupt service routine */ | 188 | /* setup interrupt service routine */ |
188 | 189 | ||
189 | if (request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath", sc)) { | 190 | ret = request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath", sc); |
190 | printk(KERN_ERR "%s: request_irq failed\n", | 191 | if (ret) { |
191 | wiphy_name(hw->wiphy)); | 192 | dev_err(&pdev->dev, "request_irq failed\n"); |
192 | ret = -EIO; | ||
193 | goto bad4; | 193 | goto bad4; |
194 | } | 194 | } |
195 | 195 | ||