Re: [PATCH 03/12] net: phy: add phy_device_set_miits helper

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

 



> +void phy_device_set_miits(struct phy_device *phydev,
> +			  struct mii_timestamper *mii_ts)
> +{
> +	if (!phydev)
> +		return;
> +
> +	if (phydev->mii_ts) {
> +		phydev_dbg(phydev,
> +			   "MII timestamper already set -> skip set\n");
> +		return;
> +	}
> +
> +	phydev->mii_ts = mii_ts;
> +}

We tend to be less paranoid. Few, if any, other functions test that
phydev is not NULL. And the current code allows overwriting of an
existing stamper. If you think overwriting should not be allowed
return -EINVAL, and change all the callers to test for it.

> +EXPORT_SYMBOL(phy_device_set_miits);

_GPL please. The code is a bit inconsistent, but new symbols should be
EXPORT_SYMBOL_GPL.

I do however like this patch, hiding away the internals of phydev.

  Andrew



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux