Message ID | 20220129220221.2823127-5-colin.foster@in-advantage.com (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | add support for VSC7512 control over SPI | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net-next |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/subject_prefix | success | Link |
netdev/cover_letter | success | Series has a cover letter |
netdev/patch_count | success | Link |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | fail | Errors and warnings before: 0 this patch: 1 |
netdev/cc_maintainers | success | CCed 12 of 12 maintainers |
netdev/build_clang | fail | Errors and warnings before: 0 this patch: 2 |
netdev/module_param | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/verify_fixes | success | No Fixes tag |
netdev/build_allmodconfig_warn | fail | Errors and warnings before: 0 this patch: 1 |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 51 lines checked |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
On Sat, Jan 29, 2022 at 02:02:16PM -0800, Colin Foster wrote: > @@ -257,15 +260,14 @@ static int mscc_miim_probe(struct platform_device *pdev) > } > } > > - ret = mscc_miim_setup(dev, &bus, "mscc_miim", mii_regmap, 0); > + ret = mscc_miim_setup(&pdev->dev, &bus, "mscc_miim", mii_regmap, 0, > + phy_regmap, 0); > if (ret < 0) { > dev_err(dev, "Unable to setup the MDIO bus\n"); > return ret; > } > > miim = bus->priv; You left this variable set but not used. Please delete it. > - miim->phy_regs = phy_regmap; > - miim->phy_reset_offset = 0; > > ret = of_mdiobus_register(bus, dev->of_node); > if (ret < 0) {
Hi Vladimir, On Mon, Jan 31, 2022 at 05:13:19PM +0000, Vladimir Oltean wrote: > On Sat, Jan 29, 2022 at 02:02:16PM -0800, Colin Foster wrote: > > @@ -257,15 +260,14 @@ static int mscc_miim_probe(struct platform_device *pdev) > > } > > } > > > > - ret = mscc_miim_setup(dev, &bus, "mscc_miim", mii_regmap, 0); > > + ret = mscc_miim_setup(&pdev->dev, &bus, "mscc_miim", mii_regmap, 0, > > + phy_regmap, 0); > > if (ret < 0) { > > dev_err(dev, "Unable to setup the MDIO bus\n"); > > return ret; > > } > > > > miim = bus->priv; > > You left this variable set but not used. Please delete it. Correct. Good catch. There were a couple of these in v6 that kernel-test-robot is happy to point out to me :-) Already fixed in my v7 branch. > > > - miim->phy_regs = phy_regmap; > > - miim->phy_reset_offset = 0; > > > > ret = of_mdiobus_register(bus, dev->of_node); > > if (ret < 0) {
diff --git a/drivers/net/dsa/ocelot/seville_vsc9953.c b/drivers/net/dsa/ocelot/seville_vsc9953.c index 8c1c9da61602..c6264e9f4c37 100644 --- a/drivers/net/dsa/ocelot/seville_vsc9953.c +++ b/drivers/net/dsa/ocelot/seville_vsc9953.c @@ -1021,7 +1021,8 @@ static int vsc9953_mdio_bus_alloc(struct ocelot *ocelot) rc = mscc_miim_setup(dev, &bus, "VSC9953 internal MDIO bus", ocelot->targets[GCB], - ocelot->map[GCB][GCB_MIIM_MII_STATUS & REG_MASK]); + ocelot->map[GCB][GCB_MIIM_MII_STATUS & REG_MASK], + NULL, 0); if (rc) { dev_err(dev, "failed to setup MDIO bus\n"); diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c index 6b14f3cf3891..07baf8390744 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -188,7 +188,8 @@ static const struct regmap_config mscc_miim_regmap_config = { }; int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name, - struct regmap *mii_regmap, int status_offset) + struct regmap *mii_regmap, int status_offset, + struct regmap *phy_regmap, int phy_offset) { struct mscc_miim_dev *miim; struct mii_bus *bus; @@ -210,6 +211,8 @@ int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name, miim->regs = mii_regmap; miim->mii_status_offset = status_offset; + miim->phy_regs = phy_regmap; + miim->phy_reset_offset = phy_offset; *pbus = bus; @@ -257,15 +260,14 @@ static int mscc_miim_probe(struct platform_device *pdev) } } - ret = mscc_miim_setup(dev, &bus, "mscc_miim", mii_regmap, 0); + ret = mscc_miim_setup(&pdev->dev, &bus, "mscc_miim", mii_regmap, 0, + phy_regmap, 0); if (ret < 0) { dev_err(dev, "Unable to setup the MDIO bus\n"); return ret; } miim = bus->priv; - miim->phy_regs = phy_regmap; - miim->phy_reset_offset = 0; ret = of_mdiobus_register(bus, dev->of_node); if (ret < 0) { diff --git a/include/linux/mdio/mdio-mscc-miim.h b/include/linux/mdio/mdio-mscc-miim.h index 5b4ed2c3cbb9..5a95e43f73f9 100644 --- a/include/linux/mdio/mdio-mscc-miim.h +++ b/include/linux/mdio/mdio-mscc-miim.h @@ -14,6 +14,7 @@ int mscc_miim_setup(struct device *device, struct mii_bus **bus, const char *name, struct regmap *mii_regmap, - int status_offset); + int status_offset, struct regmap *phy_regmap, + int phy_offset); #endif
The ocelot-ext driver requires the phys to be externally controlled by an optional parameter. This commit exposes that variable so it can be utilized. Signed-off-by: Colin Foster <colin.foster@in-advantage.com> --- drivers/net/dsa/ocelot/seville_vsc9953.c | 3 ++- drivers/net/mdio/mdio-mscc-miim.c | 10 ++++++---- include/linux/mdio/mdio-mscc-miim.h | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-)