Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian Marangi" <ansuelsmth@gmail.com>
Cc: lee@kernel.org, mfd@lists.linux.dev, conor+dt@kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH net-next v25 04/10] mfd: an8855: Add support for Airoha AN8855 Switch
Date: Sat, 10 Oct 2026 16:11:40 +0000	[thread overview]
Message-ID: <sashiko-outbox-166721@kernel.org> (raw)
In-Reply-To: <20261009161102.38961-5-ansuelsmth@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] mfd: overlapping regmap readable ranges for General Purpose and GPU timers
- [Low] mfd: structure and variable naming violates MFD API guidelines
--

commit 05d4dc95b969f0fcf66d11398aafad3e7eb7c7f1
Author: Christian Marangi <ansuelsmth@gmail.com>

mfd: an8855: Add support for Airoha AN8855 Switch

This commit adds support for the Airoha AN8855 Switch which provides
a DSA switch and a NVMEM provider. It utilizes the mdio-regmap driver
and registers a regmap for each internal PHY.

> diff --git a/drivers/mfd/airoha-an8855.c b/drivers/mfd/airoha-an8855.c
> new file mode 100644
> index 0000000000000..a2778511dfefc
> --- /dev/null
> +++ b/drivers/mfd/airoha-an8855.c
[ ... ]
> +static const struct regmap_range an8855_readable_ranges[] = {
[ ... ]
> +	regmap_reg_range(0x10009000, 0x10009fff), /* PDMA */
> +	regmap_reg_range(0x1000a100, 0x1000a2ff), /* General Purpose Timer */
> +	regmap_reg_range(0x1000a200, 0x1000a2ff), /* GPU timer */

[Severity: Medium]
Is this range definition correct? The General Purpose Timer range
(0x1000a100 to 0x1000a2ff) fully overlaps with the GPU timer range
(0x1000a200 to 0x1000a2ff).

Could this be a typo in the hardware memory map definition? It seems like
the General Purpose Timer range might have been intended to end at
0x1000a1ff to avoid overlapping and potential register access boundary
issues.

[ ... ]
> +static int an8855_core_probe(struct mdio_device *mdiodev)
> +{
> +	struct an8855_phy_bus phy_bus_infos[AN8855_MAX_PHY_PORT] = { };
> +	struct device *dev = &mdiodev->dev;
> +	struct an8855_core *priv;
> +	struct regmap *regmap;
> +	int num_phys;
> +	int i, ret;
> +
> +	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);

[Severity: Low]
This isn't a bug, but does this variable and structure naming align with MFD
subsystem conventions?

The MFD guidelines suggest avoiding generic variable names like priv, and
instead recommend using ddata for the instance variable. Also, should the
struct name itself avoid hardcoding implementation details like core?
Naming it something closer to struct an8855 might better adhere to the
subsystem guidelines.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261009161102.38961-1-ansuelsmth@gmail.com?part=4

  reply	other threads:[~2026-10-10 16:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 16:10 [PATCH net-next v25 00/10] net: dsa: Add Airoha AN8855 support Christian Marangi
2026-10-09 16:10 ` [PATCH net-next v25 01/10] dt-bindings: net: dsa: Document support for Airoha AN8855 DSA Switch Christian Marangi
2026-10-10 16:11   ` sashiko-bot
2026-10-09 16:10 ` [PATCH net-next v25 02/10] dt-bindings: net: Document support for AN8855 Switch Internal PHY Christian Marangi
2026-10-10 16:11   ` sashiko-bot
2026-10-10 16:19   ` netdev-bot+sashiko
2026-10-09 16:10 ` [PATCH net-next v25 03/10] dt-bindings: mfd: Document support for Airoha AN8855 Switch SoC Christian Marangi
2026-10-10 16:11   ` sashiko-bot
2026-10-10 16:19   ` netdev-bot+sashiko
2026-10-09 16:10 ` [PATCH net-next v25 04/10] mfd: an8855: Add support for Airoha AN8855 Switch Christian Marangi
2026-10-10 16:11   ` sashiko-bot [this message]
2026-10-12 12:02     ` Christian Marangi
2026-10-10 16:19   ` netdev-bot+sashiko
2026-10-09 16:10 ` [PATCH net-next v25 05/10] net: phy: Add Airoha AN8855 Internal Switch Gigabit PHY Christian Marangi
2026-10-10 16:11   ` sashiko-bot
2026-10-12 12:03     ` Christian Marangi
2026-10-10 16:19   ` netdev-bot+sashiko
2026-10-09 16:10 ` [PATCH net-next v25 06/10] net: dsa: tag_mtk: add Airoha variant usage of this TAG Christian Marangi
2026-10-10 16:11   ` sashiko-bot
2026-10-12 12:04     ` Christian Marangi
2026-10-10 16:19   ` netdev-bot+sashiko
2026-10-09 16:10 ` [PATCH net-next v25 07/10] MAINTAINERS: add myself as maintainer for Airoha AN8855 Switch Christian Marangi
2026-10-09 16:10 ` [PATCH net-next v25 08/10] net: dsa: move mediatek DSA driver in dedicated directory Christian Marangi
2026-10-10 16:11   ` sashiko-bot
2026-10-09 16:10 ` [PATCH net-next v25 09/10] net: dsa: mt7530: generalize and move common function to lib module Christian Marangi
2026-10-10 16:11   ` sashiko-bot
2026-10-12 12:06     ` Christian Marangi
2026-10-10 16:19   ` netdev-bot+sashiko
2026-10-09 16:10 ` [PATCH net-next v25 10/10] net: dsa: Add Airoha AN8855 5-Port Gigabit DSA Switch driver Christian Marangi
2026-10-10 16:11   ` sashiko-bot
2026-10-12 12:11     ` Christian Marangi
2026-10-10 16:19   ` netdev-bot+sashiko

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=sashiko-outbox-166721@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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