From: Sylvain Lemieux <slemieux.tyco@gmail.com>
To: andrew@lunn.ch, vivien.didelot@savoirfairelinux.com
Cc: netdev@vger.kernel.org
Subject: [PATCH] net: dsa: mv88e6xxx: fix mdio bus name when using devicetree
Date: Mon, 1 May 2017 10:54:04 -0400 [thread overview]
Message-ID: <20170501145404.18581-1-slemieux.tyco@gmail.com> (raw)
From: Liam Beguin <lbeguin@tycoint.com>
mv88e6xxx_mdio_register automatically generates mdio buses for each switch
discovered in the devicetree. When switch nodes are embedded in other nodes,
this can cause sysfs naming collisions since full_name may be truncated.
Only use devicetree node name instead of the full devicetree path
as the mdio bus name.
Signed-off-by: Liam Beguin <lbeguin@tycoint.com>
Signed-off-by: Alexandre Messier <amessier@tycoint.com>
Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 3354f99df378..80b4387d573e 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2688,8 +2688,8 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
mdio_bus->external = external;
if (np) {
- bus->name = np->full_name;
- snprintf(bus->id, MII_BUS_ID_SIZE, "%s", np->full_name);
+ bus->name = np->name;
+ snprintf(bus->id, MII_BUS_ID_SIZE, "%s", np->name);
} else {
bus->name = "mv88e6xxx SMI";
snprintf(bus->id, MII_BUS_ID_SIZE, "mv88e6xxx-%d", index++);
--
2.11.0
next reply other threads:[~2017-05-01 14:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-01 14:54 Sylvain Lemieux [this message]
2017-05-01 15:20 ` [PATCH] net: dsa: mv88e6xxx: fix mdio bus name when using devicetree Andrew Lunn
2017-05-02 14:26 ` Sylvain Lemieux
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=20170501145404.18581-1-slemieux.tyco@gmail.com \
--to=slemieux.tyco@gmail.com \
--cc=andrew@lunn.ch \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.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).