From: Kyle Switch <kyle.switch@motor-comm.com>
To: David Yang <mmyangfl@gmail.com>
Cc: andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, linux@armlinux.org.uk, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, ming.xu@motor-comm.com,
xiaolin.xu@motor-comm.com, jianmin.wang@motor-comm.com,
wei.zhang@gl-inet.com, sijia.huang@gl-inet.com
Subject: Re: [PATCH net-next v5 1/6] net: dsa: motorcomm: refactor registration path for upcoming switch families
Date: Sun, 6 Sep 2026 10:08:50 +0800 [thread overview]
Message-ID: <27a16f29-14a9-40d0-941b-f07d5b63ec4a@motor-comm.com> (raw)
In-Reply-To: <CAAXyoMN-RX1aY_isyajES5LgiDMp7_YTbM=jiS6d-8o2kKQXqg@mail.gmail.com>
On 9/5/26 01:03, David Yang wrote:
> On Fri, Sep 4, 2026 at 5:54 PM Kyle Switch <kyle.switch@motor-comm.com> wrote:
>> + .name = "YT921X",
> nit: We usually stylize it with "YT921x".
Ans: okay,will be fixed in next version.
>
>> + if (major == YT9215_MAJOR || major == YT9218_MAJOR)
>> + mode = YT921X;
>> +
>> + for (i = 0; i < ARRAY_SIZE(yt92xx_series_info_table); ++i)
>> + if (yt92xx_series_info_table[i].mode == mode)
>> + return &yt92xx_series_info_table[i];
> Redundant if you use both indexed assignment and lookup routine, since
> you know the index already.
>
>> static const struct of_device_id yt921x_of_match[] = {
>> - { .compatible = "motorcomm,yt9215" },
>> - {}
>> + {
>> + .compatible = "motorcomm,yt9215",
>> + .data = &yt92xx_series_info_table[YT921X],
> Redundant if you use both runtime identification and the match data.
> Also I'm concerned with early IO operations, although I didn't see any
> incorrectness here.
Ans: we have considered this issue before. in the next version, we
will consider whether to do it via chip_detect() or using indexed
assignment. From your suggestion, what are the side effects of each
approach and which of the two approaches do you recommend?
>
>> +enum yt92xx_mode {
>> + YT921X,
>> + YT922X,
>> + YT_MAX,
>> +};
> nit: Use prefix/suffix like YT92XX_MODE_YT921X or YT921X_SERIES to
> avoid too broad names and future name collision.
Ans: okay, will be fixed in next version.
>> struct yt921x_priv {
>> struct dsa_switch ds;
>>
>> + const struct yt92xx_series_info *series_info;
>> const struct yt921x_info *info;
> nit: Better to use const struct yt92xx_series *series for simplicity.
Ans: okay.
prev parent reply other threads:[~2026-09-06 2:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 9:54 [PATCH net-next v5 1/6] net: dsa: motorcomm: refactor registration path for upcoming switch families Kyle Switch
2026-09-04 9:54 ` [PATCH net-next v5 2/6] net: dsa: motorcomm: use max_ports from series_info for port bounds checking Kyle Switch
2026-09-04 13:32 ` Andrew Lunn
2026-09-06 1:47 ` Kyle Switch
2026-09-04 9:54 ` [PATCH net-next v5 3/6] net: dsa: motorcomm: relocate MIB polling initialization to dsa_setup() Kyle Switch
2026-09-04 13:37 ` Andrew Lunn
2026-09-06 1:56 ` Kyle Switch
2026-09-04 13:48 ` Andrew Lunn
2026-09-06 1:54 ` Kyle Switch
2026-09-04 17:13 ` David Yang
2026-09-06 2:12 ` Kyle Switch
2026-09-04 9:54 ` [PATCH net-next v5 4/6] net: dsa: motorcomm: introduce mib_init to control MIB polling initialization Kyle Switch
2026-09-04 13:45 ` Andrew Lunn
2026-09-06 2:00 ` Kyle Switch
2026-09-04 9:54 ` [PATCH net-next v5 5/6] net: dsa: tag_922x: add support for Motorcomm YT922x tags Kyle Switch
2026-09-04 17:22 ` David Yang
2026-09-04 13:14 ` [PATCH net-next v5 1/6] net: dsa: motorcomm: refactor registration path for upcoming switch families Andrew Lunn
2026-09-04 17:03 ` David Yang
2026-09-06 2:08 ` Kyle Switch [this message]
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=27a16f29-14a9-40d0-941b-f07d5b63ec4a@motor-comm.com \
--to=kyle.switch@motor-comm.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jianmin.wang@motor-comm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=ming.xu@motor-comm.com \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=sijia.huang@gl-inet.com \
--cc=wei.zhang@gl-inet.com \
--cc=xiaolin.xu@motor-comm.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