Thread (43 messages) flat view 43 messages, 3 authors, 2020-05-14

Re: [PATCH V5 13/19] net: ks8851: Split out SPI specific code from probe() and remove()

From: Andrew Lunn <andrew@lunn.ch>
Date: 2020-05-14 01:31:06

On Thu, May 14, 2020 at 02:07:41AM +0200, Marek Vasut wrote:
quoted hunk ↗ jump to hunk
Factor out common code into ks8851_probe_common() and
ks8851_remove_common() to permit both SPI and parallel
bus driver variants to use the common code path for
both probing and removal.

There should be no functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Petr Stetiar <redacted>
Cc: YueHaibing <redacted>
---
V2: - Add RB from Andrew
    - Rework on top of locking patches, drop RB
V3: No change
V4: No change
V5: Pass message enable as parameter to common probe function,
    so the MODULE_* bits can be per-driver
---
 drivers/net/ethernet/micrel/ks8851.c | 86 ++++++++++++++++------------
 1 file changed, 48 insertions(+), 38 deletions(-)
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index 440ddd5cafbd..791b2f14dd9d 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -1431,27 +1431,15 @@ static int ks8851_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(ks8851_pm_ops, ks8851_suspend, ks8851_resume);
 
-static int ks8851_probe(struct spi_device *spi)
+static int ks8851_probe_common(struct net_device *netdev, struct device *dev,
+			       int msg_en)
 {
 
-	dev_info(dev, "message enable is %d\n", msg_enable);
+	dev_info(dev, "message enable is %d\n", msg_en);
 
 	/* set the default message enable */
-	ks->msg_enable = netif_msg_init(msg_enable, (NETIF_MSG_DRV |
-						     NETIF_MSG_PROBE |
-						     NETIF_MSG_LINK));
+	ks->msg_enable = netif_msg_init(msg_en, NETIF_MSG_DRV |
+						NETIF_MSG_PROBE |
+						NETIF_MSG_LINK);
It would of been nice to keep the name msg_en, then these changes
would not be needed. Or is there something not visible in this patch
which means the variable name it not usable?

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help