All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joachim Eastwood <manabian@gmail.com>
To: peppe.cavallaro@st.com, davem@davemloft.net
Cc: Joachim Eastwood <manabian@gmail.com>, netdev@vger.kernel.org
Subject: [PATCH net-next 16/17] stmmac: remove setup/free glue callbacks
Date: Wed, 29 Jul 2015 00:09:03 +0200	[thread overview]
Message-ID: <1438121344-5304-17-git-send-email-manabian@gmail.com> (raw)
In-Reply-To: <1438121344-5304-1-git-send-email-manabian@gmail.com>

As all dwmac-* drivers have been converted to have a proper probe
function the setup callback can now be removed. Also remove the
free callback that wasn't used by any driver.

New dwmac-* drivers should implement standard probe and remove
functions to preform any needed setup and teardown.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
 Documentation/networking/stmmac.txt                   | 8 ++------
 drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c   | 7 -------
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 ---
 include/linux/stmmac.h                                | 2 --
 4 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt
index de5c42342ec3..2903b1cf4d70 100644
--- a/Documentation/networking/stmmac.txt
+++ b/Documentation/networking/stmmac.txt
@@ -135,8 +135,6 @@ struct plat_stmmacenet_data {
 	int maxmtu;
 	void (*fix_mac_speed)(void *priv, unsigned int speed);
 	void (*bus_setup)(void __iomem *ioaddr);
-	void *(*setup)(struct platform_device *pdev);
-	void (*free)(struct platform_device *pdev, void *priv);
 	int (*init)(struct platform_device *pdev, void *priv);
 	void (*exit)(struct platform_device *pdev, void *priv);
 	void *bsp_priv;
@@ -177,12 +175,10 @@ Where:
  o bus_setup: perform HW setup of the bus. For example, on some ST platforms
 	     this field is used to configure the AMBA  bridge to generate more
 	     efficient STBus traffic.
- o setup/init/exit: callbacks used for calling a custom initialization;
+ o init/exit: callbacks used for calling a custom initialization;
 	     this is sometime necessary on some platforms (e.g. ST boxes)
 	     where the HW needs to have set some PIO lines or system cfg
-	     registers. setup should return a pointer to private data,
-	     which will be stored in bsp_priv, and then passed to init and
-	     exit callbacks. init/exit callbacks should not use or modify
+	     registers.  init/exit callbacks should not use or modify
 	     platform data.
  o bsp_priv: another private pointer.
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
index f4fe9f1a33b4..b1e5f24708c9 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
@@ -46,13 +46,6 @@ static int dwmac_generic_probe(struct platform_device *pdev)
 		plat_dat->unicast_filter_entries = 1;
 	}
 
-	/* Custom setup (if needed) */
-	if (plat_dat->setup) {
-		plat_dat->bsp_priv = plat_dat->setup(pdev);
-		if (IS_ERR(plat_dat->bsp_priv))
-			return PTR_ERR(plat_dat->bsp_priv);
-	}
-
 	/* Custom initialisation (if needed) */
 	if (plat_dat->init) {
 		ret = plat_dat->init(pdev, plat_dat->bsp_priv);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 55e569b330b2..1cb660405f35 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -300,9 +300,6 @@ int stmmac_pltfr_remove(struct platform_device *pdev)
 	if (priv->plat->exit)
 		priv->plat->exit(pdev, priv->plat->bsp_priv);
 
-	if (priv->plat->free)
-		priv->plat->free(pdev, priv->plat->bsp_priv);
-
 	return ret;
 }
 EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index b43cd56b78e9..eead8ab93c0a 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -119,8 +119,6 @@ struct plat_stmmacenet_data {
 	int rx_fifo_size;
 	void (*fix_mac_speed)(void *priv, unsigned int speed);
 	void (*bus_setup)(void __iomem *ioaddr);
-	void *(*setup)(struct platform_device *pdev);
-	void (*free)(struct platform_device *pdev, void *priv);
 	int (*init)(struct platform_device *pdev, void *priv);
 	void (*exit)(struct platform_device *pdev, void *priv);
 	void *bsp_priv;
-- 
1.8.0

  parent reply	other threads:[~2015-07-28 22:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 22:08 [PATCH net-next 00/17] stmmac clean up for 4.3 part2 Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 01/17] stmmac: fix ptr_ret.cocci warning Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 02/17] stmmac: dwmac-ipq806x: move ipq806x_gmac_fix_mac_speed function Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 03/17] stmmac: dwmac-ipq806x: turn setup callback into a probe function Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 04/17] stmmac: dwmac-socfpga: move socfpga_dwmac_probe function Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 05/17] stmmac: dwmac-socfpga: turn setup callback into a probe function Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 06/17] stmmac: dwmac-sunxi: move sun7i_gmac_setup function Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 07/17] stmmac: dwmac-sunxi: turn setup callback into a probe function Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 08/17] stmmac: dwmac-sti: " Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 10/17] stmmac: move stmmac_pltfr_probe into dwmac-generic Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 11/17] stmmac: let dwmac-* drivers handle their own match data Joachim Eastwood
2015-07-28 22:08 ` [PATCH net-next 12/17] stmmac: dwmac-sti: use custom of match structure Joachim Eastwood
     [not found] ` <1438121344-5304-1-git-send-email-manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-07-28 22:08   ` [PATCH net-next 09/17] stmmac: dwmac-rk: create a new probe function Joachim Eastwood
2015-07-28 22:09   ` [PATCH net-next 13/17] stmmac: dwmac-rk: make rk_gmac_ops structs static const Joachim Eastwood
2015-07-28 22:09 ` [PATCH net-next 14/17] stmmac: dwmac-rk: use rk_gmac_ops as of match data Joachim Eastwood
2015-07-28 22:09 ` [PATCH net-next 15/17] stmmac: remove unused stmmac_of_data struct Joachim Eastwood
2015-07-28 22:09 ` Joachim Eastwood [this message]
2015-07-28 22:09 ` [PATCH net-next 17/17] stmmac: dwmac-sti: refactor the init glue callbacks Joachim Eastwood
2015-07-29  7:13 ` [PATCH net-next 00/17] stmmac clean up for 4.3 part2 David Miller

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=1438121344-5304-17-git-send-email-manabian@gmail.com \
    --to=manabian@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.