[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150331.192838.1922058179914527422.davem@davemloft.net>
Date: Tue, 31 Mar 2015 19:28:38 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: u.kleine-koenig@...gutronix.de
Cc: f.fainelli@...il.com, netdev@...r.kernel.org,
linus.walleij@...aro.org, acourbot@...dia.com,
kernel@...gutronix.de
Subject: Re: [PATCH v2] net: phy: at803x: simplify using
devm_gpiod_get_optional and its 4th argument
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Date: Tue, 31 Mar 2015 22:08:45 +0200
> I still think assigning directly to priv->gpiod_reset would fine
> because having the priv->gpiod_reset NULL is neither more nor less
> right that ERR_PTR(-ESOMETHING).
You really want to push my buttons don't you? :-/
What if someone adds a new resource allocation after this thing and
then adds an unwind path where something has to be done to the GPIOD
as part of cleanup?
What does your error pointer cause to happen to an unsuspecting person
creating such a change?
Why isn't this obvious to you as a good coding practice that is
future proof against any changes to this code?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists