netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] net: phy: leds: Add support for "link" trigger
Date: Thu, 2 Nov 2017 01:14:22 +0100	[thread overview]
Message-ID: <20171102001422.GA4772@lunn.ch> (raw)
In-Reply-To: <698c7dea-7b32-e63c-11ac-feac163a65a1@maciej.szmigiero.name>

On Thu, Nov 02, 2017 at 12:49:31AM +0100, Maciej S. Szmigiero wrote:
> Hi Andrew,
> 
> On 01.11.2017 13:33, Maciej S. Szmigiero wrote:
> > On 01.11.2017 13:31, Andrew Lunn wrote:
> >>> 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 (?).
> >>  
> >> Hi Maciej
> >>
> >> Occasionally, there is a need to call devm_kfree(). But i don't see
> >> anything here why it is needed. So i would drop your devm_kfree(), and
> >> if you feel like it, add an additional patch removing the existing
> >> one.
> > 
> > OK, will do as you suggest.
> > 
> 
> Upon closer inspection of the code it turned out that these devm_kfree()
> calls actually had some purpose - the PHY core ignores the return value
> of phy_led_triggers_register() and will successfully attach a PHY even
> if this function returns an error.
> 
> In that case these LED trigger structures would unnecessary take some
> memory, that's why (probably) the PHY LED code frees them on error
> path.

O.K. Thanks for looking into this.

     Andrew

  reply	other threads:[~2017-11-02  0:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 11:56 [PATCH v2] net: phy: leds: Add support for "link" trigger Maciej S. Szmigiero
2017-11-01 12:16 ` Andrew Lunn
2017-11-01 12:21   ` Maciej S. Szmigiero
2017-11-01 12:31     ` Andrew Lunn
2017-11-01 12:33       ` Maciej S. Szmigiero
2017-11-01 23:49         ` Maciej S. Szmigiero
2017-11-02  0:14           ` Andrew Lunn [this message]
2017-11-01 12:37     ` Andrew Lunn
2017-11-01 12:43       ` Maciej S. Szmigiero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171102001422.GA4772@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@maciej.szmigiero.name \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).