From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, Nicolas Ferre <nicolas.ferre@atmel.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] net: macb: remove #if defined(CONFIG_ARCH_AT91) sections
Date: Thu, 5 Mar 2015 20:44:18 +0100 [thread overview]
Message-ID: <20150305194418.GY3989@piout.net> (raw)
In-Reply-To: <1425572842-6084-4-git-send-email-boris.brezillon@free-electrons.com>
On 05/03/2015 at 17:27:22 +0100, Boris Brezillon wrote :
> @@ -2388,21 +2392,20 @@ static int macb_probe(struct platform_device *pdev)
> bp->phy_interface = err;
> }
>
> + config = 0;
> if (bp->phy_interface == PHY_INTERFACE_MODE_RGMII)
> - macb_or_gem_writel(bp, USRIO, GEM_BIT(RGMII));
> - else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII)
> -#if defined(CONFIG_ARCH_AT91)
> - macb_or_gem_writel(bp, USRIO, (MACB_BIT(RMII) |
> - MACB_BIT(CLKEN)));
> -#else
> - macb_or_gem_writel(bp, USRIO, 0);
> -#endif
> - else
> -#if defined(CONFIG_ARCH_AT91)
> - macb_or_gem_writel(bp, USRIO, MACB_BIT(CLKEN));
> -#else
> - macb_or_gem_writel(bp, USRIO, MACB_BIT(MII));
> -#endif
> + config = GEM_BIT(RGMII);
> + else if (bp->phy_interface == PHY_INTERFACE_MODE_RMII &&
> + (bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII))
> + config = MACB_BIT(RMII);
> + else if (bp->phy_interface == PHY_INTERFACE_MODE_MII &&
I'm not sure you should check for PHY_INTERFACE_MODE_MII here as this
may change the previous behaviour.
> + !(bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII))
> + config = MACB_BIT(MII);
> +
> + if (bp->caps & MACB_CAPS_USRIO_HAS_CLKEN)
> + config |= MACB_BIT(CLKEN);
> +
> + macb_or_gem_writel(bp, USRIO, config);
>
> err = register_netdev(dev);
> if (err) {
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2015-03-05 19:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-05 16:27 [PATCH 0/3] net: macb: rework at91 specific handling Boris Brezillon
2015-03-05 16:27 ` [PATCH 1/3] net/macb: Update DT bindings documentation Boris Brezillon
2015-03-05 16:27 ` [PATCH 2/3] ARM: at91/dt: fix macb compatible strings Boris Brezillon
[not found] ` <1425572842-6084-1-git-send-email-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2015-03-05 16:27 ` [PATCH 3/3] net: macb: remove #if defined(CONFIG_ARCH_AT91) sections Boris Brezillon
2015-03-05 19:44 ` Alexandre Belloni [this message]
2015-03-06 11:25 ` Boris Brezillon
2015-03-05 19:42 ` [PATCH 0/3] net: macb: rework at91 specific handling Alexandre Belloni
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=20150305194418.GY3989@piout.net \
--to=alexandre.belloni@free-electrons.com \
--cc=boris.brezillon@free-electrons.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=pawel.moll@arm.com \
--cc=plagnioj@jcrosoft.com \
--cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).