From: Breno Leitao <leitao@linux.vnet.ibm.com>
To: ram.vepa@neterion.com, santosh.rastapur@neterion.com,
sivakumar.subramani@neterion.com, sreenivasa.honnur@neterion.com
Cc: netdev <netdev@vger.kernel.org>, Lorandi <rafaello@br.ibm.com>
Subject: [PATCH 1/1 net-next]: s2io: Fix log messages using dev->name
Date: Tue, 26 Aug 2008 11:18:22 -0300 [thread overview]
Message-ID: <48B410AE.2040802@linux.vnet.ibm.com> (raw)
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);
reply other threads:[~2008-08-26 14:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48B410AE.2040802@linux.vnet.ibm.com \
--to=leitao@linux.vnet.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=rafaello@br.ibm.com \
--cc=ram.vepa@neterion.com \
--cc=santosh.rastapur@neterion.com \
--cc=sivakumar.subramani@neterion.com \
--cc=sreenivasa.honnur@neterion.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.