[net-next PATCH 18/19] net: dsa: qca8k: use device_get_match_data instead of the OF variant

From: Ansuel Smith
Date: Wed Nov 17 2021 - 16:07:47 EST


Drop of_platform include and device_get_match_data instead of the OF
variant.

Signed-off-by: Ansuel Smith <ansuelsmth@xxxxxxxxx>
---
drivers/net/dsa/qca/qca8k.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/dsa/qca/qca8k.c b/drivers/net/dsa/qca/qca8k.c
index cae58753bb1f..260cdac53990 100644
--- a/drivers/net/dsa/qca/qca8k.c
+++ b/drivers/net/dsa/qca/qca8k.c
@@ -14,7 +14,6 @@
#include <net/dsa.h>
#include <linux/of_net.h>
#include <linux/of_mdio.h>
-#include <linux/of_platform.h>
#include <linux/if_bridge.h>
#include <linux/mdio.h>
#include <linux/phylink.h>
@@ -929,7 +928,7 @@ qca8k_setup_of_pws_reg(struct qca8k_priv *priv)
* Should be applied by default but we set this just to make sure.
*/
if (priv->switch_id == QCA8K_ID_QCA8327) {
- data = of_device_get_match_data(priv->dev);
+ data = device_get_match_data(priv->dev);

/* Set the correct package of 148 pin for QCA8327 */
if (data->reduced_package)
@@ -1071,7 +1070,7 @@ static int qca8k_read_switch_id(struct qca8k_priv *priv)
int ret;

/* get the switches ID from the compatible */
- data = of_device_get_match_data(priv->dev);
+ data = device_get_match_data(priv->dev);
if (!data)
return -ENODEV;

@@ -1674,7 +1673,7 @@ qca8k_get_strings(struct dsa_switch *ds, int port, u32 stringset, uint8_t *data)
if (stringset != ETH_SS_STATS)
return;

- match_data = of_device_get_match_data(priv->dev);
+ match_data = device_get_match_data(priv->dev);

for (i = 0; i < match_data->mib_count; i++)
strncpy(data + i * ETH_GSTRING_LEN, ar8327_mib[i].name,
@@ -1692,7 +1691,7 @@ qca8k_get_ethtool_stats(struct dsa_switch *ds, int port,
u32 hi = 0;
int ret;

- match_data = of_device_get_match_data(priv->dev);
+ match_data = device_get_match_data(priv->dev);

for (i = 0; i < match_data->mib_count; i++) {
mib = &ar8327_mib[i];
@@ -1723,7 +1722,7 @@ qca8k_get_sset_count(struct dsa_switch *ds, int port, int sset)
if (sset != ETH_SS_STATS)
return 0;

- match_data = of_device_get_match_data(priv->dev);
+ match_data = device_get_match_data(priv->dev);

return match_data->mib_count;
}
--
2.32.0