[PATCH v3 1/4] phy: add common PHY properties support

Simon Glass sjg at chromium.org
Sat Apr 11 16:37:40 CEST 2026


Hi Lucien,

On 2026-04-05T14:49:40, Lucien.Jheng <lucienzx159 at gmail.com> wrote:
> phy: add common PHY properties support
>
> Add a new PHY_COMMON_PROPS library that provides helper functions for
> PHY drivers to read standardized polarity properties from the device
> tree node:
>
>   - phy_get_rx_polarity() / phy_get_tx_polarity()
>   - phy_get_manual_rx_polarity() / phy_get_manual_tx_polarity()
>
> The dt-bindings/phy/phy.h header with PHY_POL_NORMAL, PHY_POL_INVERT,
> and PHY_POL_AUTO constants is provided via dts/upstream/include, which
> is already in the build include path.
>
> Ported from Merge tag 'phy-for-7.0':
>   git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy
>
> Link: https://git.kernel.org/linus/e7556b59ba65179612bce3fa56bb53d1b4fb20db
> Signed-off-by: Lucien.Jheng <lucienzx159 at gmail.com>
>
> drivers/phy/Kconfig                  |   8 +
>  drivers/phy/Makefile                 |   1 +
>  drivers/phy/phy-common-props.c       | 286 +++++++++++++++++++++++++++++++++++
>  include/linux/phy/phy-common-props.h |  69 +++++++++
>  4 files changed, 364 insertions(+)

> diff --git a/drivers/phy/phy-common-props.c b/drivers/phy/phy-common-props.c
> @@ -74,6 +74,10 @@ static int ofnode_get_u32_prop_for_name(ofnode node, const char *name,
> +     if (!name) {
> +             printf("Error: Lookup key inside \"%s\" is mandatory\n",
> +                    names_title);

In U-Boot drivers, error messages typically use log_err() or pr_err()
rather than printf(). This applies to the other printf() calls in this
file as well. Please can you switch to pr_err() for consistency? Also
note that these errors consume code space, so you could use
log_debug() if you don't want to do that.

Regards,
Simon


More information about the U-Boot mailing list