Re: [PATCH net-next v4 2/3] net: phy: Add helper for getting tx amplitude gain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -3133,12 +3126,12 @@ static int phy_get_int_delay_property(struct device *dev, const char *name)
>  s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev,
>  			   const int *delay_values, int size, bool is_rx)
>  {
> -	s32 delay;
> -	int i;
> +	u32 delay;
> +	int i, ret;

Networking uses reverse christmass tree. So you need to sort these two
longest first.

> +int phy_get_tx_amplitude_gain(struct phy_device *phydev, struct device *dev,
> +			      enum ethtool_link_mode_bit_indices linkmode,
> +			      u32 *val)

Since this is an exported symbol, it would be nice to have some
kerneldoc for it.

> +{
> +	switch (linkmode) {
> +	case ETHTOOL_LINK_MODE_100baseT_Full_BIT:
> +		return phy_get_u32_property(dev,
> +					    "tx-amplitude-100base-tx-percent",
> +					    val);

So no handling of the default value here. This would be the logical
place to have the 100 if the value is not in device tree.

> +	default:
> +		return -EINVAL;
> +	}
> +}
> +EXPORT_SYMBOL(phy_get_tx_amplitude_gain);

I would prefer EXPORT_SYMBOL_GPL, but up to you.

    Andrew

---
pw-bot: cr




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux