Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751241AbdFBKc5 (ORCPT ); Fri, 2 Jun 2017 06:32:57 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:34487 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138AbdFBKcz (ORCPT ); Fri, 2 Jun 2017 06:32:55 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Andy Shevchenko Date: Fri, 2 Jun 2017 13:32:53 +0300 Message-ID: Subject: Re: [PATCH v5 10/11] gpio-exar/8250-exar: Make set of exported GPIOs configurable To: Jan Kiszka Cc: Greg Kroah-Hartman , Linus Walleij , Alexandre Courbot , Linux Kernel Mailing List , "linux-serial@vger.kernel.org" , "linux-gpio@vger.kernel.org" , Sudip Mukherjee , Sascha Weisenberger Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 902 Lines: 29 On Fri, Jun 2, 2017 at 10:28 AM, Jan Kiszka wrote: > On the SIMATIC, IOT2040 only a single pin is exportable as GPIO, the > rest is required to operate the UART. To allow modeling this case, > expand the platform device data structure to specify a (consecutive) pin > subset for exporting by the gpio-exar driver. > + if (device_property_read_u32(&pdev->dev, "gpio-exar,first-pin", > + &first_pin) < 0 || > + device_property_read_u32(&pdev->dev, "ngpios", &ngpios) < 0) > + return -EINVAL; You shadow an error. Please use ret = device_property_...; if (ret) return ret; ret = ... ... Moreover, I missed how you named first property, I would go rather with "linux," prefix to show that is _internal_ / Linux only property. Perhaps something like "linux,first-pin" ? -- With Best Regards, Andy Shevchenko