netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
To: jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
	arnd.bergmann-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	masami.hiramatsu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	Jassi Brar
	<jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCHv3 2/3] net: socionext: Add Synquacer NetSec driver
Date: Thu, 21 Dec 2017 15:00:46 +0100	[thread overview]
Message-ID: <20171221140046.GE15416@lunn.ch> (raw)
In-Reply-To: <1513858275-14246-1-git-send-email-jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

> +static int netsec_register_mdio(struct netsec_priv *priv, u32 phy_addr)
> +{
> +	struct mii_bus *bus;
> +	int ret;
> +
> +	bus = devm_mdiobus_alloc(priv->dev);
> +	if (!bus)
> +		return -ENOMEM;
> +
> +	snprintf(bus->id, MII_BUS_ID_SIZE, "%s", dev_name(priv->dev));
> +	bus->priv = priv;
> +	bus->name = "SNI NETSEC MDIO";
> +	bus->read = netsec_phy_read;
> +	bus->write = netsec_phy_write;
> +	bus->parent = priv->dev;
> +	priv->mii_bus = bus;
> +
> +	if (dev_of_node(priv->dev)) {
> +		struct device_node *parent = dev_of_node(priv->dev);
> +		struct device_node *child_node, *mdio_node = NULL;
> +
> +		for_each_child_of_node(parent, child_node) {
> +			if (of_device_is_compatible(child_node,
> +						    "socionext,snq-mdio")) {

Just use of_get_child_by_name(parent, "mdio");

     Andrew
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-12-21 14:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21 12:09 [PATCHv3 0/3] Socionext Synquacer NETSEC driver jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w
     [not found] ` <1513858196-14137-1-git-send-email-jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-21 12:10   ` [PATCHv3 1/3] dt-bindings: net: Add DT bindings for Socionext Netsec jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w
     [not found]     ` <1513858254-14197-1-git-send-email-jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-21 13:55       ` Andrew Lunn
     [not found]         ` <20171221135541.GC15416-g2DYL2Zd6BY@public.gmane.org>
2017-12-26 19:34           ` Florian Fainelli
2017-12-27  8:28             ` Andrew Lunn
2017-12-21 12:11   ` [PATCHv3 2/3] net: socionext: Add Synquacer NetSec driver jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w
     [not found]     ` <1513858275-14246-1-git-send-email-jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-21 12:43       ` Ard Biesheuvel
     [not found]         ` <CAKv+Gu9AaA09Eo9X6cK9wzi-huKhfkgO5Hgzf5PyMgdPtWJ56g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-21 13:58           ` Andrew Lunn
2017-12-21 14:00       ` Andrew Lunn [this message]
2017-12-21 12:11   ` [PATCHv3 3/3] MAINTAINERS: Add entry for Socionext ethernet driver jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w

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=20171221140046.GE15416@lunn.ch \
    --to=andrew-g2dyl2zd6by@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=arnd.bergmann-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=masami.hiramatsu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).