[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b789b023-2e7b-1f5b-59a6-9676db74e850@maciej.szmigiero.name>
Date: Wed, 1 Nov 2017 13:21:58 +0100
From: "Maciej S. Szmigiero" <mail@...iej.szmigiero.name>
To: Andrew Lunn <andrew@...n.ch>
Cc: Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] net: phy: leds: Add support for "link" trigger
Hi Andrew,
On 01.11.2017 13:16, Andrew Lunn wrote:
>> @@ -123,6 +153,10 @@ int phy_led_triggers_register(struct phy_device *phy)
>> while (i--)
>> phy_led_trigger_unregister(&phy->phy_led_triggers[i]);
>> devm_kfree(&phy->mdio.dev, phy->phy_led_triggers);
>> +out_unreg_link:
>> + phy_led_trigger_unregister(phy->led_link_trigger);
>> +out_free_link:
>> + devm_kfree(&phy->mdio.dev, phy->led_link_trigger);
>
> Hi Maciej
>
> The point of the devm_ API is that you don't need to worry about
> freeing the memory. The core will do it, when the driver is removed.
>
> I guess you are just copying the code above, which i would also say is
> unnecessary.
Yes, I did it the same way as the existing code did for phy->phy_led_triggers
for reasons of both consistency and also to be on the safe side because
maybe there is some non-obvious reason why it has to be freed
explicitly (?).
> Andrew
Maciej
Powered by blists - more mailing lists