From: Nicolas Pitre <nico@cam.org>
To: Eric Miao <eric.y.miao@gmail.com>
Cc: linux-arm-kernel <linux-arm-kernel@lists.arm.linux.org.uk>,
linux-netdev <netdev@vger.kernel.org>,
Magnus Damm <magnus.damm@gmail.com>,
Eric Miao <eric.miao@marvell.com>
Subject: Re: [PATCH 03/10] smc91x: favor the use of SMC91X_USE_* instead of SMC_CAN_USE_*
Date: Thu, 26 Jun 2008 19:54:17 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.1.10.0806261953070.2979@xanadu.home> (raw)
In-Reply-To: <1214300867-15495-4-git-send-email-eric.y.miao@gmail.com>
On Tue, 24 Jun 2008, Eric Miao wrote:
> From: Eric Miao <eric.miao@marvell.com>
>
> Let's simplify the logic and avoid confusion, the use of SMC91X_USE_*
> is favored than SMC_CAN_USE_*, if platform data isn't given, convert
> the hardcoded SMC_CAN_USE_* to SMC91X_USE_*.
>
> Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Nicolas Pitre <nico@cam.org>
> ---
> drivers/net/smc91x.c | 12 +++---------
> drivers/net/smc91x.h | 13 +++----------
> 2 files changed, 6 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
> index 70a19ad..b57ee44 100644
> --- a/drivers/net/smc91x.c
> +++ b/drivers/net/smc91x.c
> @@ -2136,20 +2136,14 @@ static int smc_drv_probe(struct platform_device *pdev)
>
> lp = netdev_priv(ndev);
>
> -#ifdef SMC_DYNAMIC_BUS_CONFIG
> if (pd)
> memcpy(&lp->cfg, pd, sizeof(lp->cfg));
> else {
> - lp->cfg.flags = SMC91X_USE_8BIT;
> - lp->cfg.flags |= SMC91X_USE_16BIT;
> - lp->cfg.flags |= SMC91X_USE_32BIT;
> + lp->cfg.flags |= (SMC_CAN_USE_8BIT) ? SMC91X_USE_8BIT : 0;
> + lp->cfg.flags |= (SMC_CAN_USE_16BIT) ? SMC91X_USE_16BIT : 0;
> + lp->cfg.flags |= (SMC_CAN_USE_32BIT) ? SMC91X_USE_32BIT : 0;
> }
>
> - lp->cfg.flags &= ~(SMC_CAN_USE_8BIT ? 0 : SMC91X_USE_8BIT);
> - lp->cfg.flags &= ~(SMC_CAN_USE_16BIT ? 0 : SMC91X_USE_16BIT);
> - lp->cfg.flags &= ~(SMC_CAN_USE_32BIT ? 0 : SMC91X_USE_32BIT);
> -#endif
> -
> ndev->dma = (unsigned char)-1;
>
> ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
> index 97a3c52..6a90400 100644
> --- a/drivers/net/smc91x.h
> +++ b/drivers/net/smc91x.h
> @@ -441,7 +441,6 @@ static inline void LPD7_SMC_outsw (unsigned char* a, int r,
> #define RPC_LSA_DEFAULT RPC_LED_100_10
> #define RPC_LSB_DEFAULT RPC_LED_TX_RX
>
> -#define SMC_DYNAMIC_BUS_CONFIG
> #endif
>
>
> @@ -491,15 +490,9 @@ struct smc_local {
> struct smc91x_platdata cfg;
> };
>
> -#ifdef SMC_DYNAMIC_BUS_CONFIG
> -#define SMC_8BIT(p) (((p)->cfg.flags & SMC91X_USE_8BIT) && SMC_CAN_USE_8BIT)
> -#define SMC_16BIT(p) (((p)->cfg.flags & SMC91X_USE_16BIT) && SMC_CAN_USE_16BIT)
> -#define SMC_32BIT(p) (((p)->cfg.flags & SMC91X_USE_32BIT) && SMC_CAN_USE_32BIT)
> -#else
> -#define SMC_8BIT(p) SMC_CAN_USE_8BIT
> -#define SMC_16BIT(p) SMC_CAN_USE_16BIT
> -#define SMC_32BIT(p) SMC_CAN_USE_32BIT
> -#endif
> +#define SMC_8BIT(p) ((p)->cfg.flags & SMC91X_USE_8BIT)
> +#define SMC_16BIT(p) ((p)->cfg.flags & SMC91X_USE_16BIT)
> +#define SMC_32BIT(p) ((p)->cfg.flags & SMC91X_USE_32BIT)
>
> #ifdef SMC_USE_PXA_DMA
> /*
> --
> 1.5.4.3
>
Nicolas
prev parent reply other threads:[~2008-06-26 23:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-24 9:47 [PATCH 03/10] smc91x: favor the use of SMC91X_USE_* instead of SMC_CAN_USE_* Eric Miao
2008-06-26 23:54 ` Nicolas Pitre [this message]
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=alpine.LFD.1.10.0806261953070.2979@xanadu.home \
--to=nico@cam.org \
--cc=eric.miao@marvell.com \
--cc=eric.y.miao@gmail.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=magnus.damm@gmail.com \
--cc=netdev@vger.kernel.org \
/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