Commit b4b97079 authored by Vincent Mailhol's avatar Vincent Mailhol Committed by Marc Kleine-Budde

can: flexcan: export flexcan_ethtool_ops and remove flexcan_set_ethtool_ops()

The function flexcan_set_ethtool_ops() does one thing: populate
net_device::ethtool_ops. Instead, it is possible to directly assign
this field and remove one function call and slightly reduce the object
size. To do so, export flexcan_ethtool_ops so it becomes visible to
flexcan-core.c.
Signed-off-by: default avatarVincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://lore.kernel.org/all/20220727104939.279022-4-mailhol.vincent@wanadoo.frSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 0ccb3e0b
...@@ -2113,7 +2113,7 @@ static int flexcan_probe(struct platform_device *pdev) ...@@ -2113,7 +2113,7 @@ static int flexcan_probe(struct platform_device *pdev)
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
dev->netdev_ops = &flexcan_netdev_ops; dev->netdev_ops = &flexcan_netdev_ops;
flexcan_set_ethtool_ops(dev); dev->ethtool_ops = &flexcan_ethtool_ops;
dev->irq = irq; dev->irq = irq;
dev->flags |= IFF_ECHO; dev->flags |= IFF_ECHO;
......
...@@ -100,15 +100,10 @@ static int flexcan_get_sset_count(struct net_device *netdev, int sset) ...@@ -100,15 +100,10 @@ static int flexcan_get_sset_count(struct net_device *netdev, int sset)
} }
} }
static const struct ethtool_ops flexcan_ethtool_ops = { const struct ethtool_ops flexcan_ethtool_ops = {
.get_ringparam = flexcan_get_ringparam, .get_ringparam = flexcan_get_ringparam,
.get_strings = flexcan_get_strings, .get_strings = flexcan_get_strings,
.get_priv_flags = flexcan_get_priv_flags, .get_priv_flags = flexcan_get_priv_flags,
.set_priv_flags = flexcan_set_priv_flags, .set_priv_flags = flexcan_set_priv_flags,
.get_sset_count = flexcan_get_sset_count, .get_sset_count = flexcan_get_sset_count,
}; };
void flexcan_set_ethtool_ops(struct net_device *netdev)
{
netdev->ethtool_ops = &flexcan_ethtool_ops;
}
...@@ -114,7 +114,7 @@ struct flexcan_priv { ...@@ -114,7 +114,7 @@ struct flexcan_priv {
void (*write)(u32 val, void __iomem *addr); void (*write)(u32 val, void __iomem *addr);
}; };
void flexcan_set_ethtool_ops(struct net_device *dev); extern const struct ethtool_ops flexcan_ethtool_ops;
static inline bool static inline bool
flexcan_supports_rx_mailbox(const struct flexcan_priv *priv) flexcan_supports_rx_mailbox(const struct flexcan_priv *priv)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment