netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 net-next]: s2io: Fix log messages using dev->name
@ 2008-08-26 14:18 Breno Leitao
  0 siblings, 0 replies; only message in thread
From: Breno Leitao @ 2008-08-26 14:18 UTC (permalink / raw)
  To: ram.vepa, santosh.rastapur, sivakumar.subramani,
	sreenivasa.honnur
  Cc: netdev, Lorandi

s2io driver is printing dev->name before its assignment (by
dev_alloc_name()), so "eth%d" is printed instead of "eth0", "eth1", etc.
Here is an example gotten from dmesg: 

eth%d: Enabling MSIX failed
eth%d: MSI-X requested but failed to enable

This patch calls dev_alloc_name() earlier, before any message being
printed, hence dev->name is translated from "eth%d" to "eth0", for
example, and all those prints become correct. 

Signed-off-by: Breno Leitão <leitao@linux.vnet.ibm.com>
---

diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index a2b0730..42a860d 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -7796,6 +7796,10 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
 		return -ENODEV;
 	}
 
+	ret = dev_alloc_name(dev, dev->name);
+	if (ret < 0)
+		goto dev_alloc_failed;
+
 	pci_set_master(pdev);
 	pci_set_drvdata(pdev, dev);
 	SET_NETDEV_DEV(dev, &pdev->dev);
@@ -8223,6 +8227,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
       bar0_remap_failed:
       mem_alloc_failed:
 	free_shared_mem(sp);
+      dev_alloc_failed:
 	pci_disable_device(pdev);
 	pci_release_regions(pdev);
 	pci_set_drvdata(pdev, NULL);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-26 14:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-26 14:18 [PATCH 1/1 net-next]: s2io: Fix log messages using dev->name Breno Leitao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).