via-velocity: use driver string instead of dev->name before register_netdev()
This patch corrects a message bug in the via-velocity driver which bothered me for some time. The messages printed during device init look like the following: [ 8.486422] eth%d: set value of parameter Wake On Lan options to 0 ^^! [ 8.487340] eth0: VIA Networking Velocity Family Gigabit Ethernet Adapter Note the unresolved format string. dev->name is unavailable before register_netdev, so use dev_driver_string(&pdev->dev), which is also consistent with other drivers. "char *devname" parameters had to be converted to "const char *devname" to be consistent with dev_driver_string return value. Signed-off-by: Sven Hartge <sven@svenhartge.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
parent
404b12c10d
commit
07b5f6a6fd
|
@ -521,7 +521,7 @@ static void __devexit velocity_remove1(struct pci_dev *pdev)
|
||||||
* we don't duplicate code for each option.
|
* we don't duplicate code for each option.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, char *devname)
|
static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, const char *devname)
|
||||||
{
|
{
|
||||||
if (val == -1)
|
if (val == -1)
|
||||||
*opt = def;
|
*opt = def;
|
||||||
|
@ -550,7 +550,7 @@ static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max,
|
||||||
* we don't duplicate code for each option.
|
* we don't duplicate code for each option.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, char *devname)
|
static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, const char *devname)
|
||||||
{
|
{
|
||||||
(*opt) &= (~flag);
|
(*opt) &= (~flag);
|
||||||
if (val == -1)
|
if (val == -1)
|
||||||
|
@ -576,7 +576,7 @@ static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 fla
|
||||||
* for the current device
|
* for the current device
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname)
|
static void __devinit velocity_get_options(struct velocity_opt *opts, int index, const char *devname)
|
||||||
{
|
{
|
||||||
|
|
||||||
velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname);
|
velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname);
|
||||||
|
@ -863,6 +863,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
|
||||||
static int first = 1;
|
static int first = 1;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
int i;
|
int i;
|
||||||
|
const char *drv_string;
|
||||||
const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data];
|
const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data];
|
||||||
struct velocity_info *vptr;
|
struct velocity_info *vptr;
|
||||||
struct mac_regs __iomem * regs;
|
struct mac_regs __iomem * regs;
|
||||||
|
@ -935,7 +936,9 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi
|
||||||
dev->dev_addr[i] = readb(®s->PAR[i]);
|
dev->dev_addr[i] = readb(®s->PAR[i]);
|
||||||
|
|
||||||
|
|
||||||
velocity_get_options(&vptr->options, velocity_nics, dev->name);
|
drv_string = dev_driver_string(&pdev->dev);
|
||||||
|
|
||||||
|
velocity_get_options(&vptr->options, velocity_nics, drv_string);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mask out the options cannot be set to the chip
|
* Mask out the options cannot be set to the chip
|
||||||
|
|
Loading…
Reference in a new issue