[PATCH 4/7] net: phy: add phydev_{err,err_probe,info,warn,dbg} macros

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jul 10 03:01:08 PDT 2023


On 10.07.23 08:36, Marco Felsch wrote:
> Import Linux macros to make it easier to port drivers to barebox.
> 
> Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>

> ---
>  include/linux/phy.h | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index d96c4e97ab..b0474e87df 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -417,6 +417,21 @@ static inline bool phy_acquired(struct phy_device *phydev)
>  	return phydev && phydev->bus && slice_acquired(&phydev->bus->slice);
>  }
>  
> +#define phydev_err(_phydev, format, args...)	\
> +	dev_err(&_phydev->dev, format, ##args)
> +
> +#define phydev_err_probe(_phydev, err, format, args...)	\
> +	dev_err_probe(&_phydev->dev, err, format, ##args)
> +
> +#define phydev_info(_phydev, format, args...)	\
> +	dev_info(&_phydev->dev, format, ##args)
> +
> +#define phydev_warn(_phydev, format, args...)	\
> +	dev_warn(&_phydev->dev, format, ##args)
> +
> +#define phydev_dbg(_phydev, format, args...)	\
> +	dev_dbg(&_phydev->dev, format, ##args)
> +
>  #ifdef CONFIG_PHYLIB
>  int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
>  		int (*run)(struct phy_device *));

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list