From: Antony Pavlov <antonynpavlov@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: net: phy: fixed link
Date: Mon, 8 Aug 2016 19:32:03 +0300 [thread overview]
Message-ID: <20160808193203.13ab931dc3ea505a3cdb2b09@gmail.com> (raw)
Hi Sascha!
I have just took a look on Lukas'
'net: phy: fixed-link: read link parameters from devicetree' patch.
I see two problems with current 'of_phy_register_fixed_link()' implementation
unrelated to Lukas' changes.
Please see current of_phy_register_fixed_link() implementation:
static struct phy_device *of_phy_register_fixed_link(struct device_node *np,
struct eth_device *edev)
{
struct phy_device *phydev;
phydev = phy_device_create(NULL, 0, 0);
phydev->dev.parent = &edev->dev;
phydev->registered = 1;
phydev->speed = 1000;
phydev->duplex = 1;
phydev->pause = phydev->asym_pause = 0;
phydev->link = 1;
return phydev;
}
1. (a trivial think) the line
phydev->link = 1;
is redundant because phy_device_create() has already set it.
2. (not so trivial think) the line
phydev->registered = 1;
Why we want to set phydev->registered here? Can we use phy_register_device() instead?
Any sugesstions?
--
Best regards,
Antony Pavlov
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2016-08-08 16:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-08 16:32 Antony Pavlov [this message]
2016-08-18 7:28 ` Sascha Hauer
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=20160808193203.13ab931dc3ea505a3cdb2b09@gmail.com \
--to=antonynpavlov@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/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