aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/davinci_emac.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2011-05-26 00:37:32 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-26 14:30:51 -0400
commit240b26284ac84f06ed0bc89c363f022e21b84b98 (patch)
treec2dba9d29f5f9322093edb5b98f5cf881fc62f76 /drivers/net/davinci_emac.c
parent12e6c419b48c4d1803918e5d952ebee07bae7465 (diff)
net: davinci_emac: fix dev_err use at probe
Use platform device rather than net device in dev_err calls before net device has been registered to avoid messages such as (null): DaVinci EMAC: Failed to get EMAC clock Also replace remaining printks in probe with dev_{err,warn}. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/davinci_emac.c')
-rw-r--r--drivers/net/davinci_emac.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 807b6bb200eb..29a4f06fbfcf 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -1772,7 +1772,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
1772 /* obtain emac clock from kernel */ 1772 /* obtain emac clock from kernel */
1773 emac_clk = clk_get(&pdev->dev, NULL); 1773 emac_clk = clk_get(&pdev->dev, NULL);
1774 if (IS_ERR(emac_clk)) { 1774 if (IS_ERR(emac_clk)) {
1775 printk(KERN_ERR "DaVinci EMAC: Failed to get EMAC clock\n"); 1775 dev_err(&pdev->dev, "failed to get EMAC clock\n");
1776 return -EBUSY; 1776 return -EBUSY;
1777 } 1777 }
1778 emac_bus_frequency = clk_get_rate(emac_clk); 1778 emac_bus_frequency = clk_get_rate(emac_clk);
@@ -1780,7 +1780,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
1780 1780
1781 ndev = alloc_etherdev(sizeof(struct emac_priv)); 1781 ndev = alloc_etherdev(sizeof(struct emac_priv));
1782 if (!ndev) { 1782 if (!ndev) {
1783 printk(KERN_ERR "DaVinci EMAC: Error allocating net_device\n"); 1783 dev_err(&pdev->dev, "error allocating net_device\n");
1784 clk_put(emac_clk); 1784 clk_put(emac_clk);
1785 return -ENOMEM; 1785 return -ENOMEM;
1786 } 1786 }
@@ -1795,7 +1795,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
1795 1795
1796 pdata = pdev->dev.platform_data; 1796 pdata = pdev->dev.platform_data;
1797 if (!pdata) { 1797 if (!pdata) {
1798 printk(KERN_ERR "DaVinci EMAC: No platform data\n"); 1798 dev_err(&pdev->dev, "no platform data\n");
1799 return -ENODEV; 1799 return -ENODEV;
1800 } 1800 }
1801 1801
@@ -1814,7 +1814,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
1814 /* Get EMAC platform data */ 1814 /* Get EMAC platform data */
1815 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1815 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1816 if (!res) { 1816 if (!res) {
1817 dev_err(emac_dev, "DaVinci EMAC: Error getting res\n"); 1817 dev_err(&pdev->dev,"error getting res\n");
1818 rc = -ENOENT; 1818 rc = -ENOENT;
1819 goto probe_quit; 1819 goto probe_quit;
1820 } 1820 }
@@ -1822,14 +1822,14 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
1822 priv->emac_base_phys = res->start + pdata->ctrl_reg_offset; 1822 priv->emac_base_phys = res->start + pdata->ctrl_reg_offset;
1823 size = res->end - res->start + 1; 1823 size = res->end - res->start + 1;
1824 if (!request_mem_region(res->start, size, ndev->name)) { 1824 if (!request_mem_region(res->start, size, ndev->name)) {
1825 dev_err(emac_dev, "DaVinci EMAC: failed request_mem_region() for regs\n"); 1825 dev_err(&pdev->dev, "failed request_mem_region() for regs\n");
1826 rc = -ENXIO; 1826 rc = -ENXIO;
1827 goto probe_quit; 1827 goto probe_quit;
1828 } 1828 }
1829 1829
1830 priv->remap_addr = ioremap(res->start, size); 1830 priv->remap_addr = ioremap(res->start, size);
1831 if (!priv->remap_addr) { 1831 if (!priv->remap_addr) {
1832 dev_err(emac_dev, "Unable to map IO\n"); 1832 dev_err(&pdev->dev, "unable to map IO\n");
1833 rc = -ENOMEM; 1833 rc = -ENOMEM;
1834 release_mem_region(res->start, size); 1834 release_mem_region(res->start, size);
1835 goto probe_quit; 1835 goto probe_quit;
@@ -1863,7 +1863,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
1863 1863
1864 priv->dma = cpdma_ctlr_create(&dma_params); 1864 priv->dma = cpdma_ctlr_create(&dma_params);
1865 if (!priv->dma) { 1865 if (!priv->dma) {
1866 dev_err(emac_dev, "DaVinci EMAC: Error initializing DMA\n"); 1866 dev_err(&pdev->dev, "error initializing DMA\n");
1867 rc = -ENOMEM; 1867 rc = -ENOMEM;
1868 goto no_dma; 1868 goto no_dma;
1869 } 1869 }
@@ -1879,7 +1879,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
1879 1879
1880 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1880 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
1881 if (!res) { 1881 if (!res) {
1882 dev_err(emac_dev, "DaVinci EMAC: Error getting irq res\n"); 1882 dev_err(&pdev->dev, "error getting irq res\n");
1883 rc = -ENOENT; 1883 rc = -ENOENT;
1884 goto no_irq_res; 1884 goto no_irq_res;
1885 } 1885 }
@@ -1888,8 +1888,8 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
1888 if (!is_valid_ether_addr(priv->mac_addr)) { 1888 if (!is_valid_ether_addr(priv->mac_addr)) {
1889 /* Use random MAC if none passed */ 1889 /* Use random MAC if none passed */
1890 random_ether_addr(priv->mac_addr); 1890 random_ether_addr(priv->mac_addr);
1891 printk(KERN_WARNING "%s: using random MAC addr: %pM\n", 1891 dev_warn(&pdev->dev, "using random MAC addr: %pM\n",
1892 __func__, priv->mac_addr); 1892 priv->mac_addr);
1893 } 1893 }
1894 1894
1895 ndev->netdev_ops = &emac_netdev_ops; 1895 ndev->netdev_ops = &emac_netdev_ops;
@@ -1902,7 +1902,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
1902 SET_NETDEV_DEV(ndev, &pdev->dev); 1902 SET_NETDEV_DEV(ndev, &pdev->dev);
1903 rc = register_netdev(ndev); 1903 rc = register_netdev(ndev);
1904 if (rc) { 1904 if (rc) {
1905 dev_err(emac_dev, "DaVinci EMAC: Error in register_netdev\n"); 1905 dev_err(&pdev->dev, "error in register_netdev\n");
1906 rc = -ENODEV; 1906 rc = -ENODEV;
1907 goto netdev_reg_err; 1907 goto netdev_reg_err;
1908 } 1908 }