Commit 9c2a6105 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

staging: agnx, probe cleanup

- switch printks to dev_*
- remove useless comments
- remove useless prints (for info we can obtain from lspci or /sys)
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f9c51375
...@@ -455,47 +455,39 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, ...@@ -455,47 +455,39 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
{ {
struct ieee80211_hw *dev; struct ieee80211_hw *dev;
struct agnx_priv *priv; struct agnx_priv *priv;
u32 mem_addr0, mem_len0; u32 mem_len0, mem_len1;
u32 mem_addr1, mem_len1;
int err; int err;
DECLARE_MAC_BUF(mac); DECLARE_MAC_BUF(mac);
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) { if (err) {
printk(KERN_ERR PFX "Can't enable new PCI device\n"); dev_err(&pdev->dev, "can't enable pci device\n");
return err; return err;
} }
/* get pci resource */
mem_addr0 = pci_resource_start(pdev, 0);
mem_len0 = pci_resource_len(pdev, 0); mem_len0 = pci_resource_len(pdev, 0);
mem_addr1 = pci_resource_start(pdev, 1);
mem_len1 = pci_resource_len(pdev, 1); mem_len1 = pci_resource_len(pdev, 1);
printk(KERN_DEBUG PFX "Memaddr0 is %x, length is %x\n", mem_addr0, mem_len0);
printk(KERN_DEBUG PFX "Memaddr1 is %x, length is %x\n", mem_addr1, mem_len1);
err = pci_request_regions(pdev, "agnx-pci"); err = pci_request_regions(pdev, "agnx-pci");
if (err) { if (err) {
printk(KERN_ERR PFX "Can't obtain PCI resource\n"); dev_err(&pdev->dev, "can't reserve PCI resources\n");
return err; return err;
} }
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) || if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) ||
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) { pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
printk(KERN_ERR PFX "No suitable DMA available\n"); dev_err(&pdev->dev, "no suitable DMA available\n");
goto err_free_reg; goto err_free_reg;
} }
pci_set_master(pdev); pci_set_master(pdev);
printk(KERN_DEBUG PFX "pdev->irq is %d\n", pdev->irq);
dev = ieee80211_alloc_hw(sizeof(*priv), &agnx_ops); dev = ieee80211_alloc_hw(sizeof(*priv), &agnx_ops);
if (!dev) { if (!dev) {
printk(KERN_ERR PFX "ieee80211 alloc failed\n"); dev_err(&pdev->dev, "ieee80211 alloc failed\n");
err = -ENOMEM; err = -ENOMEM;
goto err_free_reg; goto err_free_reg;
} }
/* init priv */
priv = dev->priv; priv = dev->priv;
memset(priv, 0, sizeof(*priv)); memset(priv, 0, sizeof(*priv));
priv->mode = NL80211_IFTYPE_MONITOR; priv->mode = NL80211_IFTYPE_MONITOR;
...@@ -504,17 +496,15 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, ...@@ -504,17 +496,15 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
spin_lock_init(&priv->lock); spin_lock_init(&priv->lock);
priv->init_status = AGNX_UNINIT; priv->init_status = AGNX_UNINIT;
/* Map mem #1 and #2 */
priv->ctl = pci_iomap(pdev, 0, mem_len0); priv->ctl = pci_iomap(pdev, 0, mem_len0);
/* printk(KERN_DEBUG PFX"MEM1 mapped address is 0x%p\n", priv->ctl); */ /* dev_dbg(&pdev->dev, "MEM1 mapped address is 0x%p\n", priv->ctl); */
if (!priv->ctl) { if (!priv->ctl) {
printk(KERN_ERR PFX "Can't map device memory\n"); dev_err(&pdev->dev, "can't map device memory\n");
goto err_free_dev; goto err_free_dev;
} }
priv->data = pci_iomap(pdev, 1, mem_len1); priv->data = pci_iomap(pdev, 1, mem_len1);
printk(KERN_DEBUG PFX "MEM2 mapped address is 0x%p\n", priv->data);
if (!priv->data) { if (!priv->data) {
printk(KERN_ERR PFX "Can't map device memory\n"); dev_err(&pdev->dev, "can't map device memory\n");
goto err_iounmap2; goto err_iounmap2;
} }
...@@ -555,15 +545,15 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, ...@@ -555,15 +545,15 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
err = ieee80211_register_hw(dev); err = ieee80211_register_hw(dev);
if (err) { if (err) {
printk(KERN_ERR PFX "Can't register hardware\n"); dev_err(&pdev->dev, "can't register hardware\n");
goto err_iounmap; goto err_iounmap;
} }
agnx_hw_reset(priv); agnx_hw_reset(priv);
dev_info(&pdev->dev, "%s: hwaddr %s, Rev 0x%02x\n",
printk(PFX "%s: hwaddr %s, Rev 0x%02x\n", wiphy_name(dev->wiphy), wiphy_name(dev->wiphy),
print_mac(mac, dev->wiphy->perm_addr), priv->revid); print_mac(mac, dev->wiphy->perm_addr), priv->revid);
return 0; return 0;
err_iounmap: err_iounmap:
......
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