[PATCH net-next v2 5/7] net: ethtool: phy: Convert the PHY_GET command to generic phy dump

Kory Maincent kory.maincent at bootlin.com
Mon Mar 10 05:14:13 PDT 2025


On Sat,  8 Mar 2025 16:54:37 +0100
Maxime Chevallier <maxime.chevallier at bootlin.com> wrote:

> Now that we have an infrastructure in ethnl for perphy DUMPs, we can get
> rid of the custom ->doit and ->dumpit to deal with PHY listing commands.
> 
> As most of the code was custom, this basically means re-writing how we
> deal with PHY listing.

Only nitpick ;)

> -static int
> -ethnl_phy_fill_reply(const struct ethnl_req_info *req_base, struct sk_buff
> *skb) +static int phy_prepare_data(const struct ethnl_req_info *req_info,
> +			    struct ethnl_reply_data *reply_data,
> +			    const struct genl_info *info)
>  {
> -	struct phy_req_info *req_info = PHY_REQINFO(req_base);
> -	struct phy_device_node *pdn = req_info->pdn;
> -	struct phy_device *phydev = pdn->phy;
> -	enum phy_upstream ptype;
> +	struct phy_reply_data *rep_data = PHY_REPDATA(reply_data);
> +	struct phy_link_topology *topo = reply_data->dev->link_topo;
> +	struct nlattr **tb = info->attrs;
> +	struct phy_device_node *pdn;
> +	struct phy_device *phydev;
  
Reverse xmas tree.

> -	ptype = pdn->upstream_type;
> +	/* RTNL is held by th caller */

Small typo here *the*.

The rest is good for me.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com



More information about the linux-arm-kernel mailing list