Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965441AbeALUDm (ORCPT + 1 other); Fri, 12 Jan 2018 15:03:42 -0500 Received: from mout.web.de ([212.227.15.4]:54935 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965128AbeALUDj (ORCPT ); Fri, 12 Jan 2018 15:03:39 -0500 Subject: [PATCH 3/4] gpio-stmpe: Move an assignment in stmpe_gpio_probe() From: SF Markus Elfring To: linux-gpio@vger.kernel.org, Linus Walleij Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <25ddf208-1f02-8bb7-b6b8-e0ffa422b754@users.sourceforge.net> Date: Fri, 12 Jan 2018 21:03:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:dRr3L102esceAKad1pjqP8UCPvgppvSPS9oqFlxJI8qQWkqo2Hf PUEOcLiA+KOENIt/jWPe1LEjtySK5weRkbd0wnV42/J4c4obWtIwCBytBQVlVba56UdpFnW 3L0lsvCfznaPoovF00LUd6U07YPEljpcO7kL+I7LIKvSaB7Ekql8hm9GV/ZjALKXOaFQAgE 507zNk+X3TIQsp3D1bY2A== X-UI-Out-Filterresults: notjunk:1;V01:K0:z1mFtpY/3CI=:BS5GyMcdCXB0O2/RVAIlUj uVFkE3qciyZt11QtgYmyeTJt0TvdxihNwbisGrxCWX2XlDYRhC+QqrGjHCom+v7OoohbSb3IT Zc2Led9I6z1U8PrLpVBqJ4Cp8X2GwAo8w1JfdocWO5OhiTr7C+agxklUbZS+WcYEYmum3bccr V9Pr7FM74wbIUm6eBY5EdDqMrRmhzptpz7jhB6QxBGEdP4JHwRGD3ss7aFWtz+TWxqaQZdxk8 h9RnWkeO+R745Nrr9ap/Tg8lDPzQbXCa4CNsIu/pNxppQ6JySy77hJsF7rZ4KuASJb6OnIlS3 p7QoORN153YFN/HXb3RMCFs0+1hJp5DFBxhZ6jB1PzFpr2hgYJzC0/94Td97VEod19js7yXR9 M8HR7iJLNeHG6396k0GSuNVQgCglMJFJKbdE4wjnEmrUy0RDPAbPex1E8ncF0nyM/PTWisLDl obfmMSXWSB8EA8SbQFvaiwDPyIsPlPt8jeMCq4huQZYD1fKfvwfvXb82cFLQNuNBr9Slhrp+3 gz7ytMxVZ72RklANXkayLzQAwGY5UZpb673Us40Edvt6sj59+EmGIIYhd4YseGxfe6wMFjpZU temkLFNtL3BEagu7bSfEakgTww8Qrm9OiqirheTHM4vHWFbScGzZAScLMTocdAwI8TBzyzHI6 jKAbf6nVTyWPX34UwibDnJSW20db8RqYTA7LUxCulpcqecDMQY88CzDi4u1yusYPgLwobx9dp oIzvOiiqISnsJ3eV61D8Z+Jzq7NqZCpYNM5DOcKuaUxWxcC1c71kUsKJq8U81DXqyx5Sdduah Oev+THo/GP8GlRWyMsaVAjksHR+A2+mip5O23lT6RFSTv5/JJ4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Fri, 12 Jan 2018 20:44:15 +0100 Move the assignment for the local variable "irq" so that its setting will only be performed directly before it is checked by this function. Signed-off-by: Markus Elfring --- drivers/gpio/gpio-stmpe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 2cf30dcba82a..d51e27eb1c59 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -435,8 +435,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev) int ret; int irq = 0; - irq = platform_get_irq(pdev, 0); - stmpe_gpio = kzalloc(sizeof(*stmpe_gpio), GFP_KERNEL); if (!stmpe_gpio) return -ENOMEM; @@ -459,6 +457,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev) if (stmpe_gpio->norequest_mask) stmpe_gpio->chip.irq.need_valid_mask = true; + irq = platform_get_irq(pdev, 0); if (irq < 0) dev_info(&pdev->dev, "device configured in no-irq mode: " -- 2.15.1