From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752760AbcD2Abp (ORCPT ); Thu, 28 Apr 2016 20:31:45 -0400 Received: from mga11.intel.com ([192.55.52.93]:44938 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752346AbcD2Abn (ORCPT ); Thu, 28 Apr 2016 20:31:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,549,1455004800"; d="scan'208";a="794643564" Subject: Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface To: Mark Brown References: <1461571496-9600-1-git-send-email-baolu.lu@linux.intel.com> <1461571496-9600-5-git-send-email-baolu.lu@linux.intel.com> <20160425173024.GO3217@sirena.org.uk> <571ED178.4090700@linux.intel.com> <20160426102314.GS3217@sirena.org.uk> <57201BC2.5040409@linux.intel.com> <20160427123349.GL3217@sirena.org.uk> <5721A5D7.4070607@linux.intel.com> <20160428171513.GR3217@sirena.org.uk> Cc: felipe.balbi@linux.intel.com, Mathias Nyman , Greg Kroah-Hartman , Lee Jones , Heikki Krogerus , MyungJoo Ham , Chanwoo Choi , Liam Girdwood , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org From: Lu Baolu Message-ID: <5722AB6B.8060708@linux.intel.com> Date: Fri, 29 Apr 2016 08:31:39 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160428171513.GR3217@sirena.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 04/29/2016 01:15 AM, Mark Brown wrote: > On Thu, Apr 28, 2016 at 01:55:35PM +0800, Lu Baolu wrote: > >> How about below code? >> + gpiod = gpiod_get(dev, "vbus_en", GPIOD_ASIS); >> + if (IS_ERR(gpiod)) >> + return PTR_ERR(gpiod); >> + >> + config->gpio = desc_to_gpio(gpiod); >> + config->enable_high = device_property_read_bool(dev, >> + "enable-active-high"); >> + gpiod_put(gpiod); > > That looks reasonable, though if you use "gpio" as the name like DT you > could keep the code the same which would be even better? Not super > crticial though. Systems might implement the name mapping in BIOS by implementing _DSD. The "gpio" looks a little generic. I'd like to use a function specific name. I will send a refreshed patch later. Best regards, Lu Baolu