Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752167AbdCWUTf (ORCPT ); Thu, 23 Mar 2017 16:19:35 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36657 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbdCWUTd (ORCPT ); Thu, 23 Mar 2017 16:19:33 -0400 Date: Thu, 23 Mar 2017 13:19:29 -0700 From: Dmitry Torokhov To: Andy Shevchenko Cc: Linus Walleij , Alexandre Courbot , linux-gpio@vger.kernel.org, Hans de Goede , linux-kernel@vger.kernel.org, Mika Westerberg , Jarkko Nikula , linux-acpi@vger.kernel.org Subject: Re: [PATCH v1 3/8] gpio: acpi: Do sanity check for GpioInt in acpi_find_gpio() Message-ID: <20170323201929.GD2502@dtor-ws> References: <20170323194618.26548-1-andriy.shevchenko@linux.intel.com> <20170323194618.26548-4-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170323194618.26548-4-andriy.shevchenko@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1273 Lines: 40 On Thu, Mar 23, 2017 at 09:46:13PM +0200, Andy Shevchenko wrote: > Check that we don't ask for output direction on GpioInt resource in cases with > or without _DSD defined. > > Signed-off-by: Andy Shevchenko Reviewed-by: Dmitry Torokhov > --- > drivers/gpio/gpiolib-acpi.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c > index 3bda3166d418..21e4930ca2db 100644 > --- a/drivers/gpio/gpiolib-acpi.c > +++ b/drivers/gpio/gpiolib-acpi.c > @@ -614,12 +614,12 @@ struct gpio_desc *acpi_find_gpio(struct device *dev, > desc = acpi_get_gpiod_by_index(adev, NULL, idx, &info); > if (IS_ERR(desc)) > return desc; > + } > > - if ((flags == GPIOD_OUT_LOW || flags == GPIOD_OUT_HIGH) && > - info.gpioint) { > - dev_dbg(dev, "refusing GpioInt() entry when doing GPIOD_OUT_* lookup\n"); > - return ERR_PTR(-ENOENT); > - } > + if (info.gpioint && > + (flags == GPIOD_OUT_LOW || flags == GPIOD_OUT_HIGH)) { > + dev_dbg(dev, "refusing GpioInt() entry when doing GPIOD_OUT_* lookup\n"); > + return ERR_PTR(-ENOENT); > } > > if (info.polarity == GPIO_ACTIVE_LOW) > -- > 2.11.0 > -- Dmitry