Re: [PATCH] phylib: Add support for the LXT973 phy.
From: Richard Cochran <richardcochran@gmail.com>
Date: 2010-06-02 15:08:20
On Wed, Jun 02, 2010 at 06:50:17AM -0700, David Miller wrote:
phy_device->priv "could one day get used for a different purpose"? What in the world are you smoking Andy?
I think he meant that the 'priv' pointer may one day be used to point to some dynamically allocated data structure.
It's clearly a private state pointer for the PHY driver to use, full stop. There is absolutely no ambiguity of what this value is and what it is used for and who owns it. The comments in the layout of struct phy_device state this clearly as well.
...
Richard, please respin your patch so that you're using the ->priv field like in your original patch.
Well, is it okay to just use the first patch? The fix needs just one bit of data, and I thought that (ab)using the 'priv' pointer would be okay, if a bit hacky. If, over time, the driver needs more private data, it should be clear enought that the existing bit "fiber selected" will also appear in the data structure. Otherwise, the driver would have to allocate a structure with one field, just to remember one bit. Richard