[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110921121159.GG1966@pengutronix.de>
Date: Wed, 21 Sep 2011 14:11:59 +0200
From: Wolfram Sang <w.sang@...gutronix.de>
To: Shawn Guo <shawn.guo@...escale.com>
Cc: Shawn Guo <shawn.guo@...aro.org>,
"David S. Miller" <davem@...emloft.net>, patches@...aro.org,
netdev@...r.kernel.org,
Troy Kisky <troy.kisky@...ndarydevices.com>,
Francois Romieu <romieu@...zoreil.com>,
linux-arm-kernel@...ts.infradead.org,
Lothar Waßmann <LW@...O-electronics.de>
Subject: Re: [PATCH v2 1/3] net/fec: change phy-reset-gpio request warning
to debug message
On Wed, Sep 21, 2011 at 08:03:42PM +0800, Shawn Guo wrote:
> On Wed, Sep 21, 2011 at 01:25:55PM +0200, Wolfram Sang wrote:
> > Hi Shawn,
> >
> > On Wed, Sep 21, 2011 at 07:10:30PM +0800, Shawn Guo wrote:
> > > FEC can work without a phy reset on some platforms, which means not
> > > very platform necessarily have a phy-reset gpio encoded in device tree.
> > > So it makes more sense to have the phy-reset-gpio request failure as
> > > a debug message rather than a warning.
> >
> > Or remove it entirely?
> >
> I would like to keep it. When people want to debug at this point, they
> do not need to type the debug message.
I just think the message might be confusing in case you don't need the
gpio, because then failing is expected behaviour. For those platforms,
it is not even an error then, so you must drop returning the error. To
be very precise, you should check of_get_named_gpio() and return if no
gpio is specified. Then, you can distinguish that case from problems
when getting the GPIO.
> > I also wanted to suggested to drop returning the error code, since it is
> > not an error anymore, strictly speaking. Then I noticed that the caller
> > does not check the error code. So, this could be added or turn the
> > function to void?
> >
> To me, keep the return value as integer is more scalable. Someday,
> someone need to add more stuff in the function, or want to improve
> the caller to check return value, it plays.
I agree that keeping it int is way better. But why not add it now to
keep things proper and tested? If this patch gets accepted as it is and
later someone else will add error checking to the caller, your platform
will lose FEC support as a regression.
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists