netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: mscc: ocelot: remove duplicate ocelot_port_dev_check
@ 2020-10-11  9:20 Vladimir Oltean
  2020-10-14  0:06 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2020-10-11  9:20 UTC (permalink / raw)
  To: davem, kuba; +Cc: alexandre.belloni, netdev, UNGLinuxDriver

A helper for checking whether a net_device belongs to mscc_ocelot
already existed and did not need to be rewritten. Use it.

Fixes: 319e4dd11a20 ("net: mscc: ocelot: introduce conversion helpers between port and netdev")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/mscc/ocelot_net.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c
index d3c03942546d..b34da11acf65 100644
--- a/drivers/net/ethernet/mscc/ocelot_net.c
+++ b/drivers/net/ethernet/mscc/ocelot_net.c
@@ -669,7 +669,8 @@ struct net_device *ocelot_port_to_netdev(struct ocelot *ocelot, int port)
 	return priv->dev;
 }
 
-static bool ocelot_port_dev_check(const struct net_device *dev)
+/* Checks if the net_device instance given to us originates from our driver */
+static bool ocelot_netdevice_dev_check(const struct net_device *dev)
 {
 	return dev->netdev_ops == &ocelot_port_netdev_ops;
 }
@@ -678,7 +679,7 @@ int ocelot_netdev_to_port(struct net_device *dev)
 {
 	struct ocelot_port_private *priv;
 
-	if (!dev || !ocelot_port_dev_check(dev))
+	if (!dev || !ocelot_netdevice_dev_check(dev))
 		return -EINVAL;
 
 	priv = netdev_priv(dev);
@@ -907,12 +908,6 @@ static int ocelot_port_obj_del(struct net_device *dev,
 	return ret;
 }
 
-/* Checks if the net_device instance given to us originate from our driver. */
-static bool ocelot_netdevice_dev_check(const struct net_device *dev)
-{
-	return dev->netdev_ops == &ocelot_port_netdev_ops;
-}
-
 static int ocelot_netdevice_port_event(struct net_device *dev,
 				       unsigned long event,
 				       struct netdev_notifier_changeupper_info *info)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: mscc: ocelot: remove duplicate ocelot_port_dev_check
  2020-10-11  9:20 [PATCH net-next] net: mscc: ocelot: remove duplicate ocelot_port_dev_check Vladimir Oltean
@ 2020-10-14  0:06 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2020-10-14  0:06 UTC (permalink / raw)
  To: Vladimir Oltean; +Cc: davem, alexandre.belloni, netdev, UNGLinuxDriver

On Sun, 11 Oct 2020 12:20:41 +0300 Vladimir Oltean wrote:
> A helper for checking whether a net_device belongs to mscc_ocelot
> already existed and did not need to be rewritten. Use it.
> 
> Fixes: 319e4dd11a20 ("net: mscc: ocelot: introduce conversion helpers between port and netdev")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Applied, thank you!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-14  0:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-11  9:20 [PATCH net-next] net: mscc: ocelot: remove duplicate ocelot_port_dev_check Vladimir Oltean
2020-10-14  0:06 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).