[PATCH v3 3/5] phy: core: Add phy bulk data helper functions
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Tue Sep 22 19:43:59 PDT 2026
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 at 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
More information about the linux-phy
mailing list