From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753213AbcEZJA7 (ORCPT ); Thu, 26 May 2016 05:00:59 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:35651 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479AbcEZJA4 convert rfc822-to-8bit (ORCPT ); Thu, 26 May 2016 05:00:56 -0400 MIME-Version: 1.0 In-Reply-To: <20160512184233.GJ30822@pengutronix.de> References: <81129033.NXiOLTg1so@wasted.cogentembedded.com> <3641492.klKRrvS8tr@wasted.cogentembedded.com> <20160512184233.GJ30822@pengutronix.de> Date: Thu, 26 May 2016 11:00:55 +0200 Message-ID: Subject: Re: [PATCH RFT 1/2] phylib: add device reset GPIO support From: Linus Walleij To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Sergei Shtylyov , Grant Likely , Rob Herring , "devicetree@vger.kernel.org" , Florian Fainelli , "netdev@vger.kernel.org" , Frank Rowand , =?UTF-8?Q?Pawe=C5=82_Moll?= , Mark Rutland , "ijc+devicetree@hellion.org.uk" , Kumar Gala , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 12, 2016 at 8:42 PM, Uwe Kleine-König 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? Yours, Linus Walleij