linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: w.sang@pengutronix.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] net/fec: change phy-reset-gpio request warning to debug message
Date: Wed, 21 Sep 2011 14:11:59 +0200	[thread overview]
Message-ID: <20110921121159.GG1966@pengutronix.de> (raw)
In-Reply-To: <20110921120341.GG28907@S2100-06.ap.freescale.net>

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/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110921/8880ce14/attachment.sig>

  reply	other threads:[~2011-09-21 12:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21 11:10 [PATCH v2 0/3] add fec support for imx6q Shawn Guo
2011-09-21 11:10 ` [PATCH v2 1/3] net/fec: change phy-reset-gpio request warning to debug message Shawn Guo
2011-09-21 11:25   ` Wolfram Sang
2011-09-21 12:03     ` Shawn Guo
2011-09-21 12:11       ` Wolfram Sang [this message]
2011-09-21 12:44         ` Shawn Guo
2011-09-21 12:59           ` Wolfram Sang
2011-09-21 13:18             ` Shawn Guo
2011-09-21 11:10 ` [PATCH v2 2/3] net/fec: fix fec1 check in fec_enet_mii_init() Shawn Guo
2011-09-21 11:10 ` [PATCH v2 3/3] net/fec: add imx6q enet support Shawn Guo
2011-09-21 11:07   ` Fabio Estevam
2011-09-21 11:28     ` Shawn Guo
2011-09-21 11:32   ` Wolfram Sang
2011-09-21 11:58     ` Shawn Guo
2011-09-21 12:26       ` Wolfram Sang

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=20110921121159.GG1966@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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).