diff options
author | Sven Hartge <sven@svenhartge.de> | 2008-10-23 09:03:44 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-10-27 15:12:02 -0400 |
commit | 07b5f6a6fd0ce47390f7fbec966cd5c70127e597 (patch) | |
tree | eb8f4eac27042d469afe52c1dde7b686a0c2e29b /drivers | |
parent | 404b12c10d2f4d77649a193af2ec69f77b852926 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/via-velocity.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 2dced383bcfb..3590ea5a902d 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -521,7 +521,7 @@ static void __devexit velocity_remove1(struct pci_dev *pdev) | |||
521 | * we don't duplicate code for each option. | 521 | * we don't duplicate code for each option. |
522 | */ | 522 | */ |
523 | 523 | ||
524 | static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, char *devname) | 524 | static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, const char *devname) |
525 | { | 525 | { |
526 | if (val == -1) | 526 | if (val == -1) |
527 | *opt = def; | 527 | *opt = def; |
@@ -550,7 +550,7 @@ static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, | |||
550 | * we don't duplicate code for each option. | 550 | * we don't duplicate code for each option. |
551 | */ | 551 | */ |
552 | 552 | ||
553 | static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, char *devname) | 553 | static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, const char *devname) |
554 | { | 554 | { |
555 | (*opt) &= (~flag); | 555 | (*opt) &= (~flag); |
556 | if (val == -1) | 556 | if (val == -1) |
@@ -576,7 +576,7 @@ static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 fla | |||
576 | * for the current device | 576 | * for the current device |
577 | */ | 577 | */ |
578 | 578 | ||
579 | static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname) | 579 | static void __devinit velocity_get_options(struct velocity_opt *opts, int index, const char *devname) |
580 | { | 580 | { |
581 | 581 | ||
582 | velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname); | 582 | 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 | |||
863 | static int first = 1; | 863 | static int first = 1; |
864 | struct net_device *dev; | 864 | struct net_device *dev; |
865 | int i; | 865 | int i; |
866 | const char *drv_string; | ||
866 | const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data]; | 867 | const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data]; |
867 | struct velocity_info *vptr; | 868 | struct velocity_info *vptr; |
868 | struct mac_regs __iomem * regs; | 869 | struct mac_regs __iomem * regs; |
@@ -935,7 +936,9 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi | |||
935 | dev->dev_addr[i] = readb(®s->PAR[i]); | 936 | dev->dev_addr[i] = readb(®s->PAR[i]); |
936 | 937 | ||
937 | 938 | ||
938 | velocity_get_options(&vptr->options, velocity_nics, dev->name); | 939 | drv_string = dev_driver_string(&pdev->dev); |
940 | |||
941 | velocity_get_options(&vptr->options, velocity_nics, drv_string); | ||
939 | 942 | ||
940 | /* | 943 | /* |
941 | * Mask out the options cannot be set to the chip | 944 | * Mask out the options cannot be set to the chip |