From: antoine.tenart@free-electrons.com (Antoine Tenart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/9] net: mvmdio: add xmdio support
Date: Wed, 7 Jun 2017 18:13:33 +0200 [thread overview]
Message-ID: <20170607161333.GA22888@kwain> (raw)
In-Reply-To: <e423ea96-12df-6a19-ce94-149ace2e2272@gmail.com>
Hi Florian,
On Wed, Jun 07, 2017 at 08:48:06AM -0700, Florian Fainelli wrote:
> On 06/07/2017 01:38 AM, Antoine Tenart wrote:
>
> > + if (of_device_is_compatible(np, "marvell,orion-mdio")) {
> > + ops->is_done = smi_is_done;
> > + ops->is_read_valid = smi_is_read_valid;
> > + ops->start_read = smi_start_read_op;
> > + ops->read = smi_read_op;
> > + ops->write = smi_write_op;
> > +
> > + dev->poll_interval_min = MVMDIO_SMI_POLL_INTERVAL_MIN;
> > + dev->poll_interval_max = MVMDIO_SMI_POLL_INTERVAL_MAX;
> > + } else if (of_device_is_compatible(np, "marvell,xmdio")) {
> > + ops->is_done = xsmi_is_done;
> > + ops->is_read_valid = xsmi_is_read_valid;
> > + ops->start_read = xsmi_start_read_op;
> > + ops->read = xsmi_read_op;
> > + ops->write = xsmi_write_op;
> > +
> > + dev->poll_interval_min = MVMDIO_XSMI_POLL_INTERVAL_MIN;
> > + dev->poll_interval_max = MVMDIO_XSMI_POLL_INTERVAL_MAX;
> > + } else {
> > + return -EINVAL;
> > + }
>
> Instead of doing this, you could have the ops structure declared e.g: a
> static global variables in the driver and reference them from the
> of_device_id .data field, something like:
Good idea, I'll update the series using static global variables for ops
and poll intervals and reference them in the .data field.
Thanks!
Antoine
--
Antoine T?nart, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170607/b292725a/attachment-0001.sig>
next prev parent reply other threads:[~2017-06-07 16:13 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-07 8:38 [PATCH 0/9] net: mvmdio: add xSMI support Antoine Tenart
2017-06-07 8:38 ` [PATCH 1/9] net: mvmdio: reorder headers alphabetically Antoine Tenart
2017-06-07 19:24 ` Florian Fainelli
2017-06-07 8:38 ` [PATCH 2/9] net: mvmdio: use tabs for defines Antoine Tenart
2017-06-07 19:24 ` Florian Fainelli
2017-06-07 8:38 ` [PATCH 3/9] net: mvmdio: use GENMASK for masks Antoine Tenart
2017-06-07 19:24 ` Florian Fainelli
2017-06-07 8:38 ` [PATCH 4/9] net: mvmdio: move the read valid check into its own function Antoine Tenart
2017-06-07 10:00 ` Sergei Shtylyov
2017-06-07 14:43 ` Antoine Tenart
2017-06-07 8:38 ` [PATCH 5/9] net: mvmdio: introduce an ops structure Antoine Tenart
2017-06-07 19:28 ` Florian Fainelli
2017-06-07 8:38 ` [PATCH 6/9] net: mvmdio: put the poll intervals in the private structure Antoine Tenart
2017-06-07 19:25 ` Florian Fainelli
2017-06-07 8:38 ` [PATCH 7/9] net: mvmdio: add xmdio support Antoine Tenart
2017-06-07 12:12 ` Andrew Lunn
2017-06-07 14:42 ` Antoine Tenart
2017-06-07 15:48 ` Florian Fainelli
2017-06-07 15:56 ` Russell King - ARM Linux
2017-06-07 16:13 ` Antoine Tenart [this message]
2017-06-07 8:38 ` [PATCH 8/9] dt-bindings: orion-mdio: document the new xmdio compatible Antoine Tenart
2017-06-07 8:38 ` [PATCH 9/9] arm64: marvell: dts: add xmdio nodes for 7k/8k Antoine Tenart
2017-06-07 8:43 ` Gregory CLEMENT
2017-06-07 19:09 ` David Miller
2017-06-08 8:45 ` Antoine Tenart
2017-06-08 8:51 ` Antoine Tenart
2017-06-08 8:55 ` Gregory CLEMENT
2017-06-08 9:03 ` Antoine Tenart
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=20170607161333.GA22888@kwain \
--to=antoine.tenart@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.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).