Message ID | 20211117210451.26415-19-ansuelsmth@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Multiple cleanup and feature for qca8k | expand |
On Wed, Nov 17, 2021 at 10:04:50PM +0100, Ansuel Smith wrote: > Drop of_platform include and device_get_match_data instead of the OF > variant. > > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> > --- Why? Any ACPI device coming?
On Fri, Nov 19, 2021 at 04:21:36AM +0200, Vladimir Oltean wrote: > On Wed, Nov 17, 2021 at 10:04:50PM +0100, Ansuel Smith wrote: > > Drop of_platform include and device_get_match_data instead of the OF > > variant. > > > > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> > > --- > > Why? Any ACPI device coming? No ACPI device coming. Notice we could drop an extra include. Is using device API wrong for OF only drivers? Just asking will drop if it can cause any problem or confusion.
On Fri, Nov 19, 2021 at 03:32:06AM +0100, Ansuel Smith wrote: > On Fri, Nov 19, 2021 at 04:21:36AM +0200, Vladimir Oltean wrote: > > On Wed, Nov 17, 2021 at 10:04:50PM +0100, Ansuel Smith wrote: > > > Drop of_platform include and device_get_match_data instead of the OF > > > variant. > > > > > > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> > > > --- > > > > Why? Any ACPI device coming? > > No ACPI device coming. Notice we could drop an extra include. > Is using device API wrong for OF only drivers? > Just asking will drop if it can cause any problem or confusion. No problem, just that this patch is a bit weak on the justification side. People usually don't make changes just for the fun of it.
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; }
Drop of_platform include and device_get_match_data instead of the OF variant. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> --- drivers/net/dsa/qca/qca8k.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)