Hi Damon,

> You are right, this is really a valid concern.
>
> If CONFIG_GENERIC_PHY is disabled, the old code could still proceed and
> keep the driver probing, while the new version would return an error
> directly.

-ENOSYS can only come from the !CONFIG_GENERIC_PHY stubs in
include/linux/phy/phy.h; the real implementation in drivers/phy/phy-core.c
never returns it. And the stub for the optional variant returns NULL, not
-ENOSYS:

    static inline struct phy *devm_phy_optional_get(struct device *dev,
                                                    const char *string)
    {
            return NULL;
    }

So with CONFIG_GENERIC_PHY disabled the PHY is still treated as absent
(NULL), exactly as the old -ENOSYS branch did. With CONFIG_GENERIC_PHY
enabled, -ENOSYS cannot occur, devm_phy_optional_get() turns -ENODEV into
NULL, and any other error is still propagated - same as the open-coded
check.

> It should be better to keep the -ENOSYS handling to preserve the
> original behavior.

Overall the behaviour is unchanged in both configurations, so no separate
handling is needed.

Best regards,
Jun Yan

Reply via email to