[U-Boot] [PATCH 03/21] sunxi: usbc: Fix vbus gpio handling to work with the device-model

Hans de Goede
2015-04-24T18:15:07Z

Hi,

On 24-04-15 20:10, Fabio Estevam wrote:
> On Fri, Apr 24, 2015 at 10:48 AM, Hans de Goede <hdegoede@redhat.com> 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