aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-10-27 19:51:55 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-28 06:26:03 -0400
commit090b17952826eb3c5d712b6d4f90a292fe4acc93 (patch)
tree4a92eea9d1fcadf99d760e5ea8bab3737316b06c /drivers/net/igb/igb_main.c
parent330a6d6a7c75e11ca6da52092cfa96cda45d3386 (diff)
igb: add pci_dev in few spots to clean up use of dev_err/info/warn
This patch relpaces several references to adapter->pdev->dev with just pdev->dev. This allows for cleanup of several multiline dev_err/info calls. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r--drivers/net/igb/igb_main.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index b2c0c979628c..264ff005710b 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1173,6 +1173,7 @@ void igb_reinit_locked(struct igb_adapter *adapter)
1173 1173
1174void igb_reset(struct igb_adapter *adapter) 1174void igb_reset(struct igb_adapter *adapter)
1175{ 1175{
1176 struct pci_dev *pdev = adapter->pdev;
1176 struct e1000_hw *hw = &adapter->hw; 1177 struct e1000_hw *hw = &adapter->hw;
1177 struct e1000_mac_info *mac = &hw->mac; 1178 struct e1000_mac_info *mac = &hw->mac;
1178 struct e1000_fc_info *fc = &hw->fc; 1179 struct e1000_fc_info *fc = &hw->fc;
@@ -1275,7 +1276,7 @@ void igb_reset(struct igb_adapter *adapter)
1275 wr32(E1000_WUC, 0); 1276 wr32(E1000_WUC, 0);
1276 1277
1277 if (hw->mac.ops.init_hw(hw)) 1278 if (hw->mac.ops.init_hw(hw))
1278 dev_err(&adapter->pdev->dev, "Hardware Error\n"); 1279 dev_err(&pdev->dev, "Hardware Error\n");
1279 1280
1280 igb_update_mng_vlan(adapter); 1281 igb_update_mng_vlan(adapter);
1281 1282
@@ -3704,17 +3705,18 @@ static struct net_device_stats *igb_get_stats(struct net_device *netdev)
3704static int igb_change_mtu(struct net_device *netdev, int new_mtu) 3705static int igb_change_mtu(struct net_device *netdev, int new_mtu)
3705{ 3706{
3706 struct igb_adapter *adapter = netdev_priv(netdev); 3707 struct igb_adapter *adapter = netdev_priv(netdev);
3708 struct pci_dev *pdev = adapter->pdev;
3707 int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; 3709 int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
3708 u32 rx_buffer_len, i; 3710 u32 rx_buffer_len, i;
3709 3711
3710 if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) || 3712 if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
3711 (max_frame > MAX_JUMBO_FRAME_SIZE)) { 3713 (max_frame > MAX_JUMBO_FRAME_SIZE)) {
3712 dev_err(&adapter->pdev->dev, "Invalid MTU setting\n"); 3714 dev_err(&pdev->dev, "Invalid MTU setting\n");
3713 return -EINVAL; 3715 return -EINVAL;
3714 } 3716 }
3715 3717
3716 if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) { 3718 if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
3717 dev_err(&adapter->pdev->dev, "MTU > 9216 not supported.\n"); 3719 dev_err(&pdev->dev, "MTU > 9216 not supported.\n");
3718 return -EINVAL; 3720 return -EINVAL;
3719 } 3721 }
3720 3722
@@ -3739,7 +3741,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
3739 if (netif_running(netdev)) 3741 if (netif_running(netdev))
3740 igb_down(adapter); 3742 igb_down(adapter);
3741 3743
3742 dev_info(&adapter->pdev->dev, "changing MTU from %d to %d\n", 3744 dev_info(&pdev->dev, "changing MTU from %d to %d\n",
3743 netdev->mtu, new_mtu); 3745 netdev->mtu, new_mtu);
3744 netdev->mtu = new_mtu; 3746 netdev->mtu = new_mtu;
3745 3747
@@ -4053,6 +4055,7 @@ static int __igb_notify_dca(struct device *dev, void *data)
4053{ 4055{
4054 struct net_device *netdev = dev_get_drvdata(dev); 4056 struct net_device *netdev = dev_get_drvdata(dev);
4055 struct igb_adapter *adapter = netdev_priv(netdev); 4057 struct igb_adapter *adapter = netdev_priv(netdev);
4058 struct pci_dev *pdev = adapter->pdev;
4056 struct e1000_hw *hw = &adapter->hw; 4059 struct e1000_hw *hw = &adapter->hw;
4057 unsigned long event = *(unsigned long *)data; 4060 unsigned long event = *(unsigned long *)data;
4058 4061
@@ -4061,12 +4064,9 @@ static int __igb_notify_dca(struct device *dev, void *data)
4061 /* if already enabled, don't do it again */ 4064 /* if already enabled, don't do it again */
4062 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 4065 if (adapter->flags & IGB_FLAG_DCA_ENABLED)
4063 break; 4066 break;
4064 /* Always use CB2 mode, difference is masked
4065 * in the CB driver. */
4066 wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_CB2);
4067 if (dca_add_requester(dev) == 0) { 4067 if (dca_add_requester(dev) == 0) {
4068 adapter->flags |= IGB_FLAG_DCA_ENABLED; 4068 adapter->flags |= IGB_FLAG_DCA_ENABLED;
4069 dev_info(&adapter->pdev->dev, "DCA enabled\n"); 4069 dev_info(&pdev->dev, "DCA enabled\n");
4070 igb_setup_dca(adapter); 4070 igb_setup_dca(adapter);
4071 break; 4071 break;
4072 } 4072 }
@@ -4076,7 +4076,7 @@ static int __igb_notify_dca(struct device *dev, void *data)
4076 /* without this a class_device is left 4076 /* without this a class_device is left
4077 * hanging around in the sysfs model */ 4077 * hanging around in the sysfs model */
4078 dca_remove_requester(dev); 4078 dca_remove_requester(dev);
4079 dev_info(&adapter->pdev->dev, "DCA disabled\n"); 4079 dev_info(&pdev->dev, "DCA disabled\n");
4080 adapter->flags &= ~IGB_FLAG_DCA_ENABLED; 4080 adapter->flags &= ~IGB_FLAG_DCA_ENABLED;
4081 wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_DISABLE); 4081 wr32(E1000_DCA_CTRL, E1000_DCA_CTRL_DCA_MODE_DISABLE);
4082 } 4082 }
@@ -4471,7 +4471,7 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
4471 retval = igb_set_vf_vlan(adapter, msgbuf, vf); 4471 retval = igb_set_vf_vlan(adapter, msgbuf, vf);
4472 break; 4472 break;
4473 default: 4473 default:
4474 dev_err(&adapter->pdev->dev, "Unhandled Msg %08x\n", msgbuf[0]); 4474 dev_err(&pdev->dev, "Unhandled Msg %08x\n", msgbuf[0]);
4475 retval = -1; 4475 retval = -1;
4476 break; 4476 break;
4477 } 4477 }
@@ -5472,6 +5472,7 @@ static void igb_restore_vlan(struct igb_adapter *adapter)
5472 5472
5473int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx) 5473int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx)
5474{ 5474{
5475 struct pci_dev *pdev = adapter->pdev;
5475 struct e1000_mac_info *mac = &adapter->hw.mac; 5476 struct e1000_mac_info *mac = &adapter->hw.mac;
5476 5477
5477 mac->autoneg = 0; 5478 mac->autoneg = 0;
@@ -5495,8 +5496,7 @@ int igb_set_spd_dplx(struct igb_adapter *adapter, u16 spddplx)
5495 break; 5496 break;
5496 case SPEED_1000 + DUPLEX_HALF: /* not supported */ 5497 case SPEED_1000 + DUPLEX_HALF: /* not supported */
5497 default: 5498 default:
5498 dev_err(&adapter->pdev->dev, 5499 dev_err(&pdev->dev, "Unsupported Speed/Duplex configuration\n");
5499 "Unsupported Speed/Duplex configuration\n");
5500 return -EINVAL; 5500 return -EINVAL;
5501 } 5501 }
5502 return 0; 5502 return 0;