From patchwork Fri Nov 10 13:40:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10053217 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 270EA60365 for ; Fri, 10 Nov 2017 13:40:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 162032A961 for ; Fri, 10 Nov 2017 13:40:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 097532B10F; Fri, 10 Nov 2017 13:40:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 442FE2A961 for ; Fri, 10 Nov 2017 13:40:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752697AbdKJNkw (ORCPT ); Fri, 10 Nov 2017 08:40:52 -0500 Received: from mga01.intel.com ([192.55.52.88]:58731 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbdKJNkv (ORCPT ); Fri, 10 Nov 2017 08:40:51 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Nov 2017 05:40:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,374,1505804400"; d="scan'208";a="1190241" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 10 Nov 2017 05:40:34 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id E28712F7; Fri, 10 Nov 2017 15:40:33 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , linux-gpio@vger.kernel.org, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Mika Westerberg Cc: Andy Shevchenko Subject: [PATCH v1 2/6] gpiolib: acpi: Don't contaminate return parameter in case of error Date: Fri, 10 Nov 2017 15:40:29 +0200 Message-Id: <20171110134033.85461-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171110134033.85461-1-andriy.shevchenko@linux.intel.com> References: <20171110134033.85461-1-andriy.shevchenko@linux.intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If error occurs, leave lookup parameter untouched. There is no functional change, since all current callers just bail out in case of error without using the assigned pieces. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- drivers/gpio/gpiolib-acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 2a85d27eb028..f640445099ab 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -585,7 +585,6 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode, * The property was found and resolved, so need to lookup the GPIO based * on returned args. */ - lookup->adev = args.adev; if (args.nargs != 3) return -EPROTO; @@ -593,6 +592,7 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode, lookup->pin_index = args.args[1]; lookup->active_low = !!args.args[2]; + lookup->adev = args.adev; return 0; }