@@ -551,7 +551,12 @@ int __ethtool_get_link_ksettings(struct net_device *dev,
551551 * legacy %ethtool_cmd API, unless it's not supported either.
552552 * TODO: remove when ethtool_ops::get_settings disappears internally
553553 */
554- err = __ethtool_get_settings (dev , & cmd );
554+ if (!dev -> ethtool_ops -> get_settings )
555+ return - EOPNOTSUPP ;
556+
557+ memset (& cmd , 0 , sizeof (cmd ));
558+ cmd .cmd = ETHTOOL_GSET ;
559+ err = dev -> ethtool_ops -> get_settings (dev , & cmd );
555560 if (err < 0 )
556561 return err ;
557562
@@ -729,30 +734,6 @@ static int ethtool_set_link_ksettings(struct net_device *dev,
729734 return dev -> ethtool_ops -> set_link_ksettings (dev , & link_ksettings );
730735}
731736
732- /* Internal kernel helper to query a device ethtool_cmd settings.
733- *
734- * Note about transition to ethtool_link_settings API: We do not need
735- * (or want) this function to support "dev" instances that implement
736- * the ethtool_link_settings API as we will update the drivers calling
737- * this function to call __ethtool_get_link_ksettings instead, before
738- * the first drivers implement ethtool_ops::get_link_ksettings.
739- *
740- * TODO 1: at least make this function static when no driver is using it
741- * TODO 2: remove when ethtool_ops::get_settings disappears internally
742- */
743- int __ethtool_get_settings (struct net_device * dev , struct ethtool_cmd * cmd )
744- {
745- ASSERT_RTNL ();
746-
747- if (!dev -> ethtool_ops -> get_settings )
748- return - EOPNOTSUPP ;
749-
750- memset (cmd , 0 , sizeof (struct ethtool_cmd ));
751- cmd -> cmd = ETHTOOL_GSET ;
752- return dev -> ethtool_ops -> get_settings (dev , cmd );
753- }
754- EXPORT_SYMBOL (__ethtool_get_settings );
755-
756737static void
757738warn_incomplete_ethtool_legacy_settings_conversion (const char * details )
758739{
@@ -796,16 +777,18 @@ static int ethtool_get_settings(struct net_device *dev, void __user *useraddr)
796777 /* send a sensible cmd tag back to user */
797778 cmd .cmd = ETHTOOL_GSET ;
798779 } else {
799- int err ;
800- /* TODO: return -EOPNOTSUPP when
801- * ethtool_ops::get_settings disappears internally
802- */
803-
804780 /* driver doesn't support %ethtool_link_ksettings
805781 * API. revert to legacy %ethtool_cmd API, unless it's
806782 * not supported either.
807783 */
808- err = __ethtool_get_settings (dev , & cmd );
784+ int err ;
785+
786+ if (!dev -> ethtool_ops -> get_settings )
787+ return - EOPNOTSUPP ;
788+
789+ memset (& cmd , 0 , sizeof (cmd ));
790+ cmd .cmd = ETHTOOL_GSET ;
791+ err = dev -> ethtool_ops -> get_settings (dev , & cmd );
809792 if (err < 0 )
810793 return err ;
811794 }
0 commit comments