# Re: \[PATCH net-next v2 5/7\] net: ethtool: phy: Convert the PHY\_GET command to generic phy dump

- From: Kory Maincent \<kory.maincent@bootlin.com\>
- Date: 2025-03-10 12:14:19 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/03/2964886
- Thread: https://ratatoskr.run/netdev/2025/03/2963350/t.md

```text
On Sat,  8 Mar 2025 16:54:37 +0100
Maxime Chevallier [ref] 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
```
