Commit d26979f1 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Jakub Kicinski

net: stmmac: replace the has_integrated_pcs field with a flag

struct plat_stmmacenet_data contains several boolean fields that could be
easily replaced with a common integer 'flags' bitfield and bit defines.

Start the process with the has_integrated_pcs field.
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
Link: https://lore.kernel.org/r/20230710090001.303225-2-brgl@bgdev.plReviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent bec9ce34
...@@ -786,7 +786,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) ...@@ -786,7 +786,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
plat_dat->tso_en = of_property_read_bool(np, "snps,tso"); plat_dat->tso_en = of_property_read_bool(np, "snps,tso");
if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))
plat_dat->rx_clk_runs_in_lpi = 1; plat_dat->rx_clk_runs_in_lpi = 1;
plat_dat->has_integrated_pcs = data->has_integrated_pcs; if (data->has_integrated_pcs)
plat_dat->flags |= STMMAC_FLAG_HAS_INTEGRATED_PCS;
if (ethqos->serdes_phy) { if (ethqos->serdes_phy) {
plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup; plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup;
......
...@@ -5798,7 +5798,8 @@ static void stmmac_common_interrupt(struct stmmac_priv *priv) ...@@ -5798,7 +5798,8 @@ static void stmmac_common_interrupt(struct stmmac_priv *priv)
} }
/* PCS link status */ /* PCS link status */
if (priv->hw->pcs && !priv->plat->has_integrated_pcs) { if (priv->hw->pcs &&
!(priv->plat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS)) {
if (priv->xstats.pcs_link) if (priv->xstats.pcs_link)
netif_carrier_on(priv->dev); netif_carrier_on(priv->dev);
else else
......
...@@ -204,6 +204,8 @@ struct dwmac4_addrs { ...@@ -204,6 +204,8 @@ struct dwmac4_addrs {
u32 mtl_low_cred_offset; u32 mtl_low_cred_offset;
}; };
#define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0)
struct plat_stmmacenet_data { struct plat_stmmacenet_data {
int bus_id; int bus_id;
int phy_addr; int phy_addr;
...@@ -293,6 +295,6 @@ struct plat_stmmacenet_data { ...@@ -293,6 +295,6 @@ struct plat_stmmacenet_data {
bool sph_disable; bool sph_disable;
bool serdes_up_after_phy_linkup; bool serdes_up_after_phy_linkup;
const struct dwmac4_addrs *dwmac4_addrs; const struct dwmac4_addrs *dwmac4_addrs;
bool has_integrated_pcs; unsigned int flags;
}; };
#endif #endif
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