提交 967faf3b 编写于 作者: J Joe Perches 提交者: David S. Miller

mii: Convert printks to netdev_info

Add a bit more data to the output.
Convert string speeds to integer.
Object size reduced a tiny bit.
$ size drivers/net/mii.o*
   text	   data	    bss	    dec	    hex	filename
   4155	     56	   1000	   5211	   145b	drivers/net/mii.o.new
   4184	     56	   1000	   5240	   1478	drivers/net/mii.o.old
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7542db8b
...@@ -354,7 +354,7 @@ unsigned int mii_check_media (struct mii_if_info *mii, ...@@ -354,7 +354,7 @@ unsigned int mii_check_media (struct mii_if_info *mii,
if (!new_carrier) { if (!new_carrier) {
netif_carrier_off(mii->dev); netif_carrier_off(mii->dev);
if (ok_to_print) if (ok_to_print)
printk(KERN_INFO "%s: link down\n", mii->dev->name); netdev_info(mii->dev, "link down\n");
return 0; /* duplex did not change */ return 0; /* duplex did not change */
} }
...@@ -381,12 +381,12 @@ unsigned int mii_check_media (struct mii_if_info *mii, ...@@ -381,12 +381,12 @@ unsigned int mii_check_media (struct mii_if_info *mii,
duplex = 1; duplex = 1;
if (ok_to_print) if (ok_to_print)
printk(KERN_INFO "%s: link up, %sMbps, %s-duplex, lpa 0x%04X\n", netdev_info(mii->dev, "link up, %uMbps, %s-duplex, lpa 0x%04X\n",
mii->dev->name, lpa2 & (LPA_1000FULL | LPA_1000HALF) ? 1000 :
lpa2 & (LPA_1000FULL | LPA_1000HALF) ? "1000" : media & (ADVERTISE_100FULL | ADVERTISE_100HALF) ?
media & (ADVERTISE_100FULL | ADVERTISE_100HALF) ? "100" : "10", 100 : 10,
duplex ? "full" : "half", duplex ? "full" : "half",
lpa); lpa);
if ((init_media) || (mii->full_duplex != duplex)) { if ((init_media) || (mii->full_duplex != duplex)) {
mii->full_duplex = duplex; mii->full_duplex = duplex;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册