From: Andrew Lunn <andrew@lunn.ch>
To: Potin Lai <potin.lai@quantatw.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Joel Stanley <joel@jms.id.au>,
Andrew Jeffery <andrew@aj.id.au>,
Patrick Williams <patrick@stwcx.xyz>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] net: mdio: aspeed: Introduce read write function for c22 and c45
Date: Wed, 6 Apr 2022 14:17:33 +0200 [thread overview]
Message-ID: <Yk2E3X7MaJhWi32O@lunn.ch> (raw)
In-Reply-To: <20220406012002.15128-3-potin.lai@quantatw.com>
> +static int aspeed_mdio_read(struct mii_bus *bus, int addr, int regnum)
> +{
> + dev_dbg(&bus->dev, "%s: addr: %d, regnum: %d\n", __func__, addr,
> + regnum);
> +
> + if (regnum & MII_ADDR_C45)
> + return aspeed_mdio_read_c45(bus, addr, regnum);
> +
> + return aspeed_mdio_read_c22(bus, addr, regnum);
> +}
> +
> static int aspeed_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)
> {
> dev_dbg(&bus->dev, "%s: addr: %d, regnum: %d, val: 0x%x\n",
> __func__, addr, regnum, val);
>
> - /* Just clause 22 for the moment */
> if (regnum & MII_ADDR_C45)
> - return -EOPNOTSUPP;
> + return aspeed_mdio_write_c45(bus, addr, regnum, val);
>
> - return aspeed_mdio_op(bus, ASPEED_MDIO_CTRL_ST_C22, MDIO_C22_OP_WRITE,
> - addr, regnum, val);
> + return aspeed_mdio_write_c22(bus, addr, regnum, val);
> }
Hi Portin
Nice structure. This will helper with future cleanup where C22 and C45
will be completely separated, and the c45 variants will be directly
passed dev_ad and reg, rather than have to extract them from regnum.
A few process issues.
Please read the netdev FAQ. The subject list should indicate the tree,
and there should be an patch 0/3 which explains the big picture of
what the patchset does. 0/3 will then be used for the merge commit.
Andrew
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
parent reply other threads:[~2022-04-06 12:19 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20220406012002.15128-3-potin.lai@quantatw.com>]
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=Yk2E3X7MaJhWi32O@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew@aj.id.au \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=joel@jms.id.au \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=patrick@stwcx.xyz \
--cc=potin.lai@quantatw.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).