diff mbox series

[v2,1/1] igc: Remove unneeded check for copper media type

Message ID 20200610124308.41422-1-sasha.neftin@intel.com
State Accepted
Delegated to: Jeff Kirsher
Headers show
Series [v2,1/1] igc: Remove unneeded check for copper media type | expand

Commit Message

Sasha Neftin June 10, 2020, 12:43 p.m. UTC
PHY of the i225 device support only copper mode.
There is no point to check media type in the
igc_power_up_link() method.

v1->v2:
Address community comment and correct the title

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Andre Guedes June 10, 2020, 6:40 p.m. UTC | #1
Hi Sasha,

> PHY of the i225 device support only copper mode.
> There is no point to check media type in the
> igc_power_up_link() method.

A quick grep shows that we have many checks like this in the igc code. How
about we extend this patch to remove all of them at once?

Regards,

Andre
Sasha Neftin June 11, 2020, 4:33 a.m. UTC | #2
On 6/10/2020 21:40, Andre Guedes wrote:
> Hi Sasha,
> 
>> PHY of the i225 device support only copper mode.
>> There is no point to check media type in the
>> igc_power_up_link() method.
> 
> A quick grep shows that we have many checks like this in the igc code. How
> about we extend this patch to remove all of them at once?
yes I know. we will do clean up per logic impact. For example, "force 
speed" mode not supported, need to clean up all logic, not only "copper 
media type".
> 
> Regards,
> 
> Andre
> 
Hello Andre,
Thanks,
Sasha
Brown, Aaron F June 24, 2020, 1:18 a.m. UTC | #3
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Sasha Neftin
> Sent: Wednesday, June 10, 2020 5:43 AM
> To: intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH v2 1/1] igc: Remove unneeded check for
> copper media type
> 
> PHY of the i225 device support only copper mode.
> There is no point to check media type in the
> igc_power_up_link() method.
> 
> v1->v2:
> Address community comment and correct the title
> 
> Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
> ---
>  drivers/net/ethernet/intel/igc/igc_main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 

Tested-by: Aaron Brown <aaron.f.brown@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index af5e1686f7f2..83c94fa58c40 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -115,8 +115,7 @@  static void igc_power_up_link(struct igc_adapter *adapter)
 {
 	igc_reset_phy(&adapter->hw);
 
-	if (adapter->hw.phy.media_type == igc_media_type_copper)
-		igc_power_up_phy_copper(&adapter->hw);
+	igc_power_up_phy_copper(&adapter->hw);
 
 	igc_setup_link(&adapter->hw);
 }