lkml.org 
[lkml]   [2017]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2] net: phy: leds: Add support for "link" trigger
    > @@ -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.

    Andrew

    \
     
     \ /
      Last update: 2017-11-01 13:17    [W:7.400 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site