netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Sergei Shtylyov" <sergei.shtylyov@cogentembedded.com>,
	"Grant Likely" <grant.likely@linaro.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Frank Rowand" <frowand.list@gmail.com>,
	"Paweł Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	"Kumar Gala" <galak@codeaurora.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFT 1/2] phylib: add device reset GPIO support
Date: Thu, 26 May 2016 21:00:00 +0200	[thread overview]
Message-ID: <20160526190000.GE3331@pengutronix.de> (raw)
In-Reply-To: <CACRpkdY3kmOiqVsnBWq8DyDDm-gLjcH4wQ+TTr1+Rp+jYLz+SQ@mail.gmail.com>

On Thu, May 26, 2016 at 11:00:55AM +0200, Linus Walleij wrote:
> On Thu, May 12, 2016 at 8:42 PM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> 
> > [added Linus Walleij to Cc, there is a question for you/him below]
> (...)
> >> +void mdio_device_reset(struct mdio_device *mdiodev, int value)
> >> +{
> >> +     if (mdiodev->reset)
> >> +             gpiod_set_value(mdiodev->reset, value);
> >
> > Before v4.6-rc1~108^2~91 it was not necessary to check for the first
> > parameter being non-NULL before calling gpiod_set_value. Linus, did you
> > change this on purpose?
> 
> Not really. And AFAICT it is still not necessary: what changed is that
> an error message will be printed by VALIDATE_DESC() if you do that.
> And that is proper I guess? I think it's sloppy code to randomly pass in
> NULL to a call and just expect it to bail out, it seems more like
> exercising the error path than something you'd normally rely on.
> 
> Or am I getting things wrong?

is the following sloppy?:

	somegpio = gpiod_get_optional(dev, "some", GPIOD_OUT_LOW);
	if (IS_ERR(somegpio))
		return PTR_ERR(somegpio);
	gpiod_set_value(somegpio, 1);

If not (as I assume) you really changed something as this might trigger
the warning.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2016-05-26 19:00 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 22:21 [PATCH RFT 0/2] Teach phylib hard-resetting devices Sergei Shtylyov
2016-04-08 22:22 ` [PATCH RFT 1/2] phylib: add device reset GPIO support Sergei Shtylyov
2016-04-11 19:25   ` Rob Herring
2016-04-11 19:28     ` Sergei Shtylyov
2016-04-11 22:46       ` Rob Herring
2016-04-08 22:25 ` [PATCH RFT 2/2] macb: kill PHY reset code Sergei Shtylyov
2016-04-11  2:28   ` Andrew Lunn
2016-04-11 17:41     ` Sergei Shtylyov
2016-04-11 18:19       ` Andrew Lunn
2016-04-11 18:39         ` Sergei Shtylyov
     [not found]           ` <570BEF46.7060105-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-04-11 18:51             ` Andrew Lunn
     [not found]               ` <20160411185115.GA30623-g2DYL2Zd6BY@public.gmane.org>
2016-04-11 19:01                 ` Sergei Shtylyov
2016-04-26 10:24                   ` [PATCH] ARM: dts: at91: VInCo: fix phy reset gpio flag Nicolas Ferre
2016-04-26 17:17                     ` David Miller
2016-04-26 18:27                       ` Sergei Shtylyov
2016-04-27  7:15                         ` Nicolas Ferre
2016-04-26 18:25                     ` Sergei Shtylyov
2016-04-12  9:23                 ` [PATCH RFT 2/2] macb: kill PHY reset code Nicolas Ferre
2016-04-12  9:22     ` Nicolas Ferre
2016-04-12 13:40       ` Andrew Lunn
2016-04-12 14:45         ` Nicolas Ferre
2016-04-12 13:54       ` Sergei Shtylyov
2016-04-12 14:57         ` Nicolas Ferre
2016-04-28 22:12 ` [PATCH RFT 1/2] phylib: add device reset GPIO support Sergei Shtylyov
2016-05-03 17:03   ` Rob Herring
2016-05-10 18:32   ` Florian Fainelli
     [not found]     ` <5732294F.3060606-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-05-10 19:11       ` Sergei Shtylyov
     [not found]         ` <5732327A.6080203-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-05-10 19:13           ` Florian Fainelli
     [not found]   ` <3641492.klKRrvS8tr-gHKXc3Y1Z8zGSmamagVegGFoWSdPRAKMAL8bYrjMMd8@public.gmane.org>
2016-05-12 18:42     ` Uwe Kleine-König
2016-05-12 21:35       ` Sergei Shtylyov
2016-05-13  4:06         ` Andrew Lunn
2016-05-13 21:16           ` Sergei Shtylyov
2016-05-13  7:06         ` Uwe Kleine-König
2016-05-13 21:49           ` Sergei Shtylyov
2016-05-13 19:18         ` Sergei Shtylyov
2016-05-14 21:14           ` Sergei Shtylyov
2016-05-13  9:07       ` Roger Quadros
2016-05-13 19:36         ` Sergei Shtylyov
2016-05-13 20:44           ` Andrew Lunn
2016-05-13 20:56             ` Sergei Shtylyov
2016-05-13 23:44               ` Andrew Lunn
2016-05-14 19:36                 ` Sergei Shtylyov
2016-05-14 19:50                   ` Andrew Lunn
2016-05-14 21:46                     ` Sergei Shtylyov
     [not found]                       ` <34922ff9-e566-4829-a631-54ce07cbb325-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2016-05-15 15:23                         ` Andrew Lunn
     [not found]                           ` <20160515152339.GA9021-g2DYL2Zd6BY@public.gmane.org>
2016-05-19 13:40                             ` Sergei Shtylyov
2016-05-16  8:51           ` Roger Quadros
2016-05-26  9:00       ` Linus Walleij
2016-05-26 19:00         ` Uwe Kleine-König [this message]
2016-05-30 14:57           ` Linus Walleij

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=20160526190000.GE3331@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    /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).