RE: [PATCH][v2] net: phy: fix a bug in get_phy_c45_ids

2015-11-02 Thread Shaohui Xie
> -Original Message- > From: David Miller [mailto:da...@davemloft.net] > Sent: Tuesday, November 03, 2015 12:02 PM > To: shh@gmail.com > Cc: netdev@vger.kernel.org; f.faine...@gmail.com; Xie Shaohui-B21989 > Subject: Re: [PATCH][v2] net: phy: fix a bug in get_phy

Re: [PATCH][v2] net: phy: fix a bug in get_phy_c45_ids

2015-11-02 Thread David Miller
From: Date: Mon, 2 Nov 2015 18:48:33 +0800 > @@ -205,6 +205,37 @@ struct phy_device *phy_device_create(struct mii_bus > *bus, int addr, int phy_id, > } > EXPORT_SYMBOL(phy_device_create); > > + /* get_phy_c45_devs_in_pkg - reads a MMD's devices in package registers. > + * @bus: the target MI

[PATCH][v2] net: phy: fix a bug in get_phy_c45_ids

2015-11-02 Thread shh.xie
From: Shaohui Xie When probing devices-in-package for a c45 phy, device zero is the last device to probe, however, if driver reads 0 from device zero, c45_ids->devices_in_package is set to '0', the loop condition of probing will be matched again, see codes below: for (i = 1;i < num_ids && c45_id