From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>,
hauke@hauke-m.de, zajec5@gmail.com, davem@davemloft.net
Subject: [PATCH net-next 5/5] net: dsa: bcm_sf2: Utilize BRCM_PSEUDO_PHY_ADDR
Date: Wed, 10 Jun 2015 18:08:01 -0700 [thread overview]
Message-ID: <1433984881-28781-6-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1433984881-28781-1-git-send-email-f.fainelli@gmail.com>
Utilize the newly introduced BRCM_PSEUDO_PHY_ADDR constant from
brcmphy.h instead of open-coding the Broadcom Ethernet switches
pseudo-PHY address (30).
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 103fde3da476..972982f8bea7 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -24,6 +24,7 @@
#include <net/dsa.h>
#include <linux/ethtool.h>
#include <linux/if_bridge.h>
+#include <linux/brcmphy.h>
#include "bcm_sf2.h"
#include "bcm_sf2_regs.h"
@@ -697,7 +698,7 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
/* Include the pseudo-PHY address and the broadcast PHY address to
* divert reads towards our workaround
*/
- ds->phys_mii_mask |= ((1 << 30) | (1 << 0));
+ ds->phys_mii_mask |= ((1 << BRCM_PSEUDO_PHY_ADDR) | (1 << 0));
rev = reg_readl(priv, REG_SWITCH_REVISION);
priv->hw_params.top_rev = (rev >> SWITCH_TOP_REV_SHIFT) &
@@ -782,7 +783,7 @@ static int bcm_sf2_sw_phy_read(struct dsa_switch *ds, int addr, int regnum)
*/
switch (addr) {
case 0:
- case 30:
+ case BRCM_PSEUDO_PHY_ADDR:
return bcm_sf2_sw_indir_rw(ds, 1, addr, regnum, 0);
default:
return 0xffff;
@@ -797,7 +798,7 @@ static int bcm_sf2_sw_phy_write(struct dsa_switch *ds, int addr, int regnum,
*/
switch (addr) {
case 0:
- case 30:
+ case BRCM_PSEUDO_PHY_ADDR:
bcm_sf2_sw_indir_rw(ds, 0, addr, regnum, val);
break;
}
--
2.1.0
next prev parent reply other threads:[~2015-06-11 1:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-11 1:07 [PATCH net-next 0/5] net: phy: broadcom: define pseudo-PHY address Florian Fainelli
2015-06-11 1:07 ` [PATCH net-next 1/5] net: phy: broadcom: include phy.h for brcmphy.h Florian Fainelli
2015-06-11 1:07 ` [PATCH net-next 2/5] net: phy: broadcom: define Broadcom pseudo-PHY address in brcmphy.h Florian Fainelli
2015-06-11 1:07 ` [PATCH net-next 3/5] b44: Utilize BRCM_PSEUDO_PHY_ADDR Florian Fainelli
2015-06-11 1:08 ` [PATCH net-next 4/5] bgmac: " Florian Fainelli
2015-06-11 1:08 ` Florian Fainelli [this message]
2015-06-11 5:02 ` [PATCH net-next 0/5] net: phy: broadcom: define pseudo-PHY address Rafał Miłecki
2015-06-11 6:34 ` 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=1433984881-28781-6-git-send-email-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=davem@davemloft.net \
--cc=hauke@hauke-m.de \
--cc=netdev@vger.kernel.org \
--cc=zajec5@gmail.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 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).