Re: [PATCH net-next v5 1/6] net: dsa: motorcomm: refactor registration path for upcoming switch families
From: Kyle Switch
Date: Sat Sep 05 2026 - 22:09:13 EST
On 9/5/26 01:03, David Yang wrote:
On Fri, Sep 4, 2026 at 5:54 PM Kyle Switch <kyle.switch@xxxxxxxxxxxxxx> wrote:Ans: okay,will be fixed in next version.
+ .name = "YT921X",nit: We usually stylize it with "YT921x".
+ if (major == YT9215_MAJOR || major == YT9218_MAJOR)Redundant if you use both indexed assignment and lookup routine, since
+ 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];
you know the index already.
static const struct of_device_id yt921x_of_match[] = {Redundant if you use both runtime identification and the match data.
- { .compatible = "motorcomm,yt9215" },
- {}
+ {
+ .compatible = "motorcomm,yt9215",
+ .data = &yt92xx_series_info_table[YT921X],
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?
Ans: okay, will be fixed in next version.
+enum yt92xx_mode {nit: Use prefix/suffix like YT92XX_MODE_YT921X or YT921X_SERIES to
+ YT921X,
+ YT922X,
+ YT_MAX,
+};
avoid too broad names and future name collision.
Ans: okay.struct yt921x_priv {nit: Better to use const struct yt92xx_series *series for simplicity.
struct dsa_switch ds;
+ const struct yt92xx_series_info *series_info;
const struct yt921x_info *info;