public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn•ch>
To: Marek Vasut <marex@denx•de>
Cc: netdev@vger•kernel.org, "David S . Miller" <davem@davemloft•net>,
	Lukas Wunner <lukas@wunner•de>, Petr Stetiar <ynezz@true•cz>,
	YueHaibing <yuehaibing@huawei•com>
Subject: Re: [PATCH V5 13/19] net: ks8851: Split out SPI specific code from probe() and remove()
Date: Thu, 14 May 2020 03:31:03 +0200	[thread overview]
Message-ID: <20200514013103.GH527401@lunn.ch> (raw)
In-Reply-To: <20200514000747.159320-14-marex@denx.de>

On Thu, May 14, 2020 at 02:07:41AM +0200, Marek Vasut wrote:
> 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 <ynezz@true•cz>
> Cc: YueHaibing <yuehaibing@huawei•com>
> ---
> 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

  reply	other threads:[~2020-05-14  1:31 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14  0:07 [PATCH V5 00/19] net: ks8851: Unify KS8851 SPI and MLL drivers Marek Vasut
2020-05-14  0:07 ` [PATCH V5 01/19] net: ks8851: Factor out spi->dev in probe()/remove() Marek Vasut
2020-05-14  0:49   ` Andrew Lunn
2020-05-14  0:07 ` [PATCH V5 02/19] net: ks8851: Rename ndev to netdev in probe Marek Vasut
2020-05-14  0:50   ` Andrew Lunn
2020-05-14  0:07 ` [PATCH V5 03/19] net: ks8851: Replace dev_err() with netdev_err() in IRQ handler Marek Vasut
2020-05-14  0:07 ` [PATCH V5 04/19] net: ks8851: Pass device node into ks8851_init_mac() Marek Vasut
2020-05-14  0:51   ` Andrew Lunn
2020-05-14  0:07 ` [PATCH V5 05/19] net: ks8851: Use devm_alloc_etherdev() Marek Vasut
2020-05-14  0:07 ` [PATCH V5 06/19] net: ks8851: Use dev_{get,set}_drvdata() Marek Vasut
2020-05-14  0:54   ` Andrew Lunn
2020-05-14  0:07 ` [PATCH V5 07/19] net: ks8851: Remove ks8851_rdreg32() Marek Vasut
2020-05-14  0:07 ` [PATCH V5 08/19] net: ks8851: Use 16-bit writes to program MAC address Marek Vasut
2020-05-14  0:55   ` Andrew Lunn
2020-05-14  0:07 ` [PATCH V5 09/19] net: ks8851: Use 16-bit read of RXFC register Marek Vasut
2020-05-14  0:07 ` [PATCH V5 10/19] net: ks8851: Factor out bus lock handling Marek Vasut
2020-05-14  1:19   ` Andrew Lunn
2020-05-14  1:37     ` Marek Vasut
2020-05-14  2:07       ` Andrew Lunn
2020-05-14  0:07 ` [PATCH V5 11/19] net: ks8851: Factor out SKB receive function Marek Vasut
2020-05-14  0:07 ` [PATCH V5 12/19] net: ks8851: Split out SPI specific entries in struct ks8851_net Marek Vasut
2020-05-14  1:25   ` Andrew Lunn
2020-05-14  0:07 ` [PATCH V5 13/19] net: ks8851: Split out SPI specific code from probe() and remove() Marek Vasut
2020-05-14  1:31   ` Andrew Lunn [this message]
2020-05-14  1:34     ` Marek Vasut
2020-05-14  0:07 ` [PATCH V5 14/19] net: ks8851: Factor out TX work flush function Marek Vasut
2020-05-14  1:33   ` Andrew Lunn
2020-05-14  0:07 ` [PATCH V5 15/19] net: ks8851: Permit overridding interrupt enable register Marek Vasut
2020-05-14  1:35   ` Andrew Lunn
2020-05-14  0:07 ` [PATCH V5 16/19] net: ks8851: Implement register, FIFO, lock accessor callbacks Marek Vasut
2020-05-14  1:38   ` Andrew Lunn
2020-05-14  0:07 ` [PATCH V5 17/19] net: ks8851: Separate SPI operations into separate file Marek Vasut
2020-05-14  0:07 ` [PATCH V5 18/19] net: ks8851: Implement Parallel bus operations Marek Vasut
2020-05-14  1:57   ` Andrew Lunn
2020-05-14  2:26     ` Marek Vasut
2020-05-14 13:15       ` Andrew Lunn
2020-05-14 14:00         ` Marek Vasut
2020-05-14 14:07           ` Andrew Lunn
2020-05-14 14:14             ` Marek Vasut
2020-05-14 14:22               ` Andrew Lunn
2020-05-14 14:33                 ` Marek Vasut
2020-05-14  0:07 ` [PATCH V5 19/19] net: ks8851: Remove ks8851_mll.c Marek Vasut
2020-05-14  1:48 ` [PATCH V5 00/19] net: ks8851: Unify KS8851 SPI and MLL drivers Jakub Kicinski

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=20200514013103.GH527401@lunn.ch \
    --to=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=lukas@wunner$(echo .)de \
    --cc=marex@denx$(echo .)de \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=ynezz@true$(echo .)cz \
    --cc=yuehaibing@huawei$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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