Subject: Re: [v5] dsa: mv88e6xxx: make serdes SGMII/Fiber tx amplitude configurable

From: Andrew Lunn <[email-masked]>
Date: Wed, 9 Feb 2022 14:37:16 +0100

> +	if (chip->info->ops->serdes_set_tx_p2p_amplitude) {
> +		dp = dsa_to_port(ds, port);
> +		if (dp)
> +			phy_handle = of_parse_phandle(dp->dn, "phy-handle", 0);
> +
> +		if (phy_handle && !of_property_read_u32(phy_handle,
> +							"tx-p2p-microvolt",
> +							&tx_amp)) {
> +			err = mv88e6352_serdes_set_tx_p2p_amplitude(chip, port,
> +								    tx_amp);
> +			if (err) {
> +				of_node_put(phy_handle);
> +				return err;
> +			}

You could move this test

> +		}
> +		if (phy_handle)
> +			of_node_put(phy_handle);

to here, since you need to put the phy_handle anyway.

   Andrew