netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: netdev <netdev@vger.kernel.org>
Cc: Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Pavel Machek <pavel@ucw.cz>, Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH RFC RFT net-next 01/10] net: dsa: mv88e6xxx: Remove legacy probe support
Date: Wed, 30 Jan 2019 01:37:49 +0100	[thread overview]
Message-ID: <20190130003758.23852-2-andrew@lunn.ch> (raw)
In-Reply-To: <20190130003758.23852-1-andrew@lunn.ch>

Remove the legacy method of probing the mv88e6xxx driver, now that all
the mainline boards have been converted to use mdio based probing for
a number of cycles.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 71 +-------------------------------
 1 file changed, 1 insertion(+), 70 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 8dca2c949e73..df8d54208c3c 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -4587,56 +4587,6 @@ static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds,
 	return chip->info->tag_protocol;
 }
 
-#if IS_ENABLED(CONFIG_NET_DSA_LEGACY)
-static const char *mv88e6xxx_drv_probe(struct device *dsa_dev,
-				       struct device *host_dev, int sw_addr,
-				       void **priv)
-{
-	struct mv88e6xxx_chip *chip;
-	struct mii_bus *bus;
-	int err;
-
-	bus = dsa_host_dev_to_mii_bus(host_dev);
-	if (!bus)
-		return NULL;
-
-	chip = mv88e6xxx_alloc_chip(dsa_dev);
-	if (!chip)
-		return NULL;
-
-	/* Legacy SMI probing will only support chips similar to 88E6085 */
-	chip->info = &mv88e6xxx_table[MV88E6085];
-
-	err = mv88e6xxx_smi_init(chip, bus, sw_addr);
-	if (err)
-		goto free;
-
-	err = mv88e6xxx_detect(chip);
-	if (err)
-		goto free;
-
-	mutex_lock(&chip->reg_lock);
-	err = mv88e6xxx_switch_reset(chip);
-	mutex_unlock(&chip->reg_lock);
-	if (err)
-		goto free;
-
-	mv88e6xxx_phy_init(chip);
-
-	err = mv88e6xxx_mdios_register(chip, NULL);
-	if (err)
-		goto free;
-
-	*priv = chip;
-
-	return chip->info->name;
-free:
-	devm_kfree(dsa_dev, chip);
-
-	return NULL;
-}
-#endif
-
 static int mv88e6xxx_port_mdb_prepare(struct dsa_switch *ds, int port,
 				      const struct switchdev_obj_port_mdb *mdb)
 {
@@ -4675,9 +4625,6 @@ static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port,
 }
 
 static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
-#if IS_ENABLED(CONFIG_NET_DSA_LEGACY)
-	.probe			= mv88e6xxx_drv_probe,
-#endif
 	.get_tag_protocol	= mv88e6xxx_get_tag_protocol,
 	.setup			= mv88e6xxx_setup,
 	.adjust_link		= mv88e6xxx_adjust_link,
@@ -4722,10 +4669,6 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
 	.get_ts_info		= mv88e6xxx_get_ts_info,
 };
 
-static struct dsa_switch_driver mv88e6xxx_switch_drv = {
-	.ops			= &mv88e6xxx_switch_ops,
-};
-
 static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
 {
 	struct device *dev = chip->dev;
@@ -4951,19 +4894,7 @@ static struct mdio_driver mv88e6xxx_driver = {
 	},
 };
 
-static int __init mv88e6xxx_init(void)
-{
-	register_switch_driver(&mv88e6xxx_switch_drv);
-	return mdio_driver_register(&mv88e6xxx_driver);
-}
-module_init(mv88e6xxx_init);
-
-static void __exit mv88e6xxx_cleanup(void)
-{
-	mdio_driver_unregister(&mv88e6xxx_driver);
-	unregister_switch_driver(&mv88e6xxx_switch_drv);
-}
-module_exit(mv88e6xxx_cleanup);
+mdio_module_driver(mv88e6xxx_driver);
 
 MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>");
 MODULE_DESCRIPTION("Driver for Marvell 88E6XXX ethernet switch chips");
-- 
2.20.1


  reply	other threads:[~2019-01-30  0:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30  0:37 [PATCH RFC RFT net-next 00/10] Modernize mv88e6060 and remove legacy probe Andrew Lunn
2019-01-30  0:37 ` Andrew Lunn [this message]
2019-01-30  0:37 ` [PATCH RFC RFT net-next 02/10] net: dsa: mv88e6060: Replace ds with priv Andrew Lunn
2019-01-30  0:37 ` [PATCH RFC RFT net-next 03/10] net: dsa: mv88e6060: Replace REG_WRITE macro Andrew Lunn
2019-01-30  9:24   ` Pavel Machek
2019-01-30 15:42     ` Andrew Lunn
2019-01-30  0:37 ` [PATCH RFC RFT net-next 04/10] net: dsa: mv88e6060: Replace REG_READ macro Andrew Lunn
2019-01-30  0:37 ` [PATCH RFC RFT net-next 05/10] net: dsa: mv88e6060: Support probing as an mdio device Andrew Lunn
2019-01-30  0:37 ` [PATCH RFC RFT net-next 06/10] net: dsa: mv88e6060: Remove support for legacy probing Andrew Lunn
2019-01-30  0:37 ` [PATCH RFC RFT net-next 07/10] net: dsa: mv88e6060: Add SPDX header Andrew Lunn
2019-01-30  0:37 ` [PATCH RFC RFT net-next 08/10] net: dsa: Remove legacy probing support Andrew Lunn
2019-01-30  0:37 ` [PATCH RFC RFT net-next 09/10] arch: arm: dts: Remove disabled marvell,dsa properties Andrew Lunn
2019-01-30  0:37 ` [PATCH RFC RFT net-next 10/10] bt-bindings: net: DSA: Remove legacy binding Andrew Lunn
2019-01-30  9:27 ` [PATCH RFC RFT net-next 00/10] Modernize mv88e6060 and remove legacy probe Pavel Machek
2019-02-06 11:31 ` Gregory CLEMENT
2019-02-06 12:58   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190130003758.23852-2-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).