Re: [PATCH 2/2] net: phy: dp83869: Add TI dp83869 phy

From: Florian Fainelli
Date: Tue Nov 05 2019 - 15:05:34 EST


On 11/5/19 12:02 PM, Dan Murphy wrote:
int ret, val;
>>> +
>>> +ÂÂÂ if (!phydev->priv) {
>>> +ÂÂÂÂÂÂÂ dp83869 = devm_kzalloc(&phydev->mdio.dev, sizeof(*dp83869),
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ GFP_KERNEL);
>> This belongs into the probe callback.
> probe callback? Why do I need a probe function?

To allocate your driver private memory and do that just once,
config_init() can be called multiple times through the lifetime of your
PHY device driver, including but not limited to: phy_connect(),
phy_init_hw(), phy_resume() etc. etc.
--
Florian