From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755385AbbDIKkW (ORCPT ); Thu, 9 Apr 2015 06:40:22 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:9305 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751506AbbDIKkV (ORCPT ); Thu, 9 Apr 2015 06:40:21 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 09 Apr 2015 03:36:26 -0700 Message-ID: <5526561B.8000102@nvidia.com> Date: Thu, 9 Apr 2015 16:06:11 +0530 From: Laxman Dewangan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Mark Brown CC: , Subject: Re: [PATCH] regulator: max8973: get rid of extra variable for gpio validity References: <1428500280-3421-1-git-send-email-ldewangan@nvidia.com> <20150408144205.GZ6023@sirena.org.uk> In-Reply-To: <20150408144205.GZ6023@sirena.org.uk> X-Originating-IP: [10.19.65.30] X-ClientProxiedBy: DRUKMAIL101.nvidia.com (10.25.59.19) To bgmail102.nvidia.com (10.25.59.11) Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 08 April 2015 08:12 PM, Mark Brown wrote: > * PGP Signed by an unknown key > > On Wed, Apr 08, 2015 at 07:08:00PM +0530, Laxman Dewangan wrote: >> To find that dvs-gpio is valid or not, gpio API gpio_is_valid() >> can be directly used instead of intermediate variable. >> >> Removing the extra variable and using the gpio_is_valid(). > Are you sure that platform data using 0 as default/unset is still > handled correctly after this? > This issue already exist and this patch will not handle this case because gpio_is_valid() return true for gpio 0 also. I search the registration of this driver on linux-next and found that it is used from DT only. No one is registering this device from non-DT. However, I can push another patch to fix the issue as if platform data is provided from non-DT and dvs_gpio is 0 then mark this as -EINVAL so that it will treat this as invalid gpio. Still there will be issue if some platform have real GPIO number as 0 and register from board files. Does it make sense?