From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Fri, 24 Apr 2015 20:15:07 +0200 Subject: [U-Boot] [PATCH 03/21] sunxi: usbc: Fix vbus gpio handling to work with the device-model In-Reply-To: References: <1429883310-22441-1-git-send-email-hdegoede@redhat.com> <1429883310-22441-4-git-send-email-hdegoede@redhat.com> Message-ID: <553A882B.4010006@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 24-04-15 20:10, Fabio Estevam wrote: > On Fri, Apr 24, 2015 at 10:48 AM, Hans de Goede wrote: > >> sunxi_usbc->gpio_vbus = get_vbus_gpio(index); >> - if (sunxi_usbc->gpio_vbus != -1) { >> + if (sunxi_usbc->gpio_vbus >= 0) { > > What about using dm_gpio_is_valid() instead? dm_gpio_is_valid takes a struct gpio_desc *, where as this code is using good old gpio indexes (int). We will likely want to convert this to getting the gpio from devicetree directly in the future, but first we need this patch-set to convert all sunxi boards to the device-model, so that we can make such changes without the need to introduce a whole lot of #ifdef-s Regards, Hans