Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Inochi Amaoto" <inochiama@gmail.com>
Cc: olteanv@gmail.com, linux-phy@lists.infradead.org,
	neil.armstrong@linaro.org, vkoul@kernel.org
Subject: Re: [PATCH v3 3/5] phy: core: Add phy bulk data helper functions
Date: Wed, 23 Sep 2026 02:43:59 +0000	[thread overview]
Message-ID: <20260923024359.A18151F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260923023304.78428-4-inochiama@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] phy: dummy bulk helpers return -EOPNOTSUPP instead of -ENOSYS
--

commit 13d75f0d7130ed7038dd436bf22de3965e1fa564
Author: Inochi Amaoto <inochiama@gmail.com>

    phy: core: Add phy bulk data helper functions
    
    Add several helper functions that allow drivers to get several phy
    consumers in one operation. If any of the phy cannot be acquired then
    any phys that were got will be put before returning to the caller.

> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index ea47975e288ae..77d9d74682b74 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h

[ ... ]

> @@ -493,6 +511,43 @@ static inline struct phy *devm_of_phy_get_by_index(struct device *dev,
>  	return ERR_PTR(-ENOSYS);
>  }
>  
> +static inline int phy_bulk_check_disabled(unsigned int num_phys,
> +					  struct phy_bulk_data *phys)
> +{
> +	if (!phys)
> +		return 0;
> +
> +	for (unsigned int i = 0; i < num_phys; i++)
> +		if (phys[i].phy)
> +			return -EOPNOTSUPP;

[Severity: Low]
Does this code break the dummy PHY subsystem conventions by returning
-EOPNOTSUPP?

The fallback functions for individual operations like phy_init() and
phy_power_on() typically return -ENOSYS when CONFIG_GENERIC_PHY is disabled.
Using -EOPNOTSUPP here might cause inconsistent error handling for drivers
falling back to these bulk dummies.

> +
> +	return 0;
> +}
> +
> +static inline int phy_bulk_init(unsigned int num_phys,
> +				struct phy_bulk_data *phys)
> +{
> +	return phy_bulk_check_disabled(num_phys, phys);
> +}

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260923023304.78428-1-inochiama@gmail.com?part=3

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-09-23  2:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  2:32 [PATCH v3 0/5] phy: core: Add phy bulk helpers support Inochi Amaoto
2026-09-23  2:32 ` [PATCH v3 1/5] phy: core: Add common helper to add phy phandle device link Inochi Amaoto
2026-09-23  2:33 ` [PATCH v3 2/5] phy: core: Add common helper for get phy phandle by index Inochi Amaoto
2026-09-23  2:33 ` [PATCH v3 3/5] phy: core: Add phy bulk data helper functions Inochi Amaoto
2026-09-23  2:43   ` sashiko-bot [this message]
2026-09-23  2:33 ` [PATCH v3 4/5] phy: core: Add managed " Inochi Amaoto
2026-09-23  2:33 ` [PATCH v3 5/5] doc: phy: Document some bulk " Inochi Amaoto
2026-09-23  2:46   ` sashiko-bot
2026-09-23  2:55   ` Randy Dunlap

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=20260923024359.A18151F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=inochiama@gmail.com \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.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