Skip to content

Commit

Permalink
igb: Add switch case for supported hardware to igb_ptp_remove.
Browse files Browse the repository at this point in the history
PTP initialization is only done on supported parts, so remove needs
same checks or it will cause crashes on systems with igb devices that
don't support PTP.  This patch adds those checks to the exit function.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Carolyn Wyborny authored and Jeff Kirsher committed Jun 20, 2012
1 parent f00b0da commit d3eef8c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/net/ethernet/intel/igb/igb_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,17 @@ void igb_ptp_init(struct igb_adapter *adapter)

void igb_ptp_remove(struct igb_adapter *adapter)
{
cancel_delayed_work_sync(&adapter->overflow_work);
switch (adapter->hw.mac.type) {
case e1000_i211:
case e1000_i210:
case e1000_i350:
case e1000_82580:
case e1000_82576:
cancel_delayed_work_sync(&adapter->overflow_work);
break;
default:
return;
}

if (adapter->ptp_clock) {
ptp_clock_unregister(adapter->ptp_clock);
Expand Down

0 comments on commit d3eef8c

Please sign in to comment.