From patchwork Fri Aug 26 15:25:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101928 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp412252qga; Fri, 26 Aug 2016 08:29:06 -0700 (PDT) X-Received: by 10.98.24.194 with SMTP id 185mr7116002pfy.52.1472225341993; Fri, 26 Aug 2016 08:29:01 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yp6si21699224pac.253.2016.08.26.08.29.01; Fri, 26 Aug 2016 08:29:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753131AbcHZP24 (ORCPT + 4 others); Fri, 26 Aug 2016 11:28:56 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:54404 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751547AbcHZP2k (ORCPT ); Fri, 26 Aug 2016 11:28:40 -0400 Received: from wuerfel.lan. ([176.0.135.42]) by mrelayeu.kundenserver.de (mreue005) with ESMTPA (Nemesis) id 0Lyh3D-1b1iA500zn-016644; Fri, 26 Aug 2016 17:26:54 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Arnd Bergmann , Phil Reid , Linus Walleij , Alexandre Courbot , linux-gpio@vger.kernel.org Subject: [PATCH 1/5] gpio: pca954x: fix undefined error code from remove Date: Fri, 26 Aug 2016 17:25:42 +0200 Message-Id: <20160826152546.604384-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160826152546.604384-1-arnd@arndb.de> References: <20160826152546.604384-1-arnd@arndb.de> X-Provags-ID: V03:K0:ZBySBF9ELBSBbx4PZsykU6Qw3tFeT5j2PnFe+MxWPnm06nahUyd 43h2dGwcqrCUSecAekao9ZD++uW1CKR4Z8LzzpOruNnh0NXlqzCIdpbYGb42bf3U96IfTtn Y9p8vZof1Yhx7TmNsr9hloDnGgDGYgjQDsz4miy0WDk8dP7yPba3F2C115av6U1BhI3Di8L TesDZaCUzcVIB9yq01pEA== X-UI-Out-Filterresults: notjunk:1; V01:K0:PdlbicsP9Dw=:EyLOhhc0CZ920VzBXb5tXE Zi68HY6MdK6guN+CVa7IxuE/9Sdp7j9004R30D1tUgcKRBLf6vtoNHkxi3FrDLrV1ELoGeCZh 5sukIFU1BQDKNIZgrjTg9ZmLFioOn07dcyeHN0UrO6BAfpYN2el7r8sPxoAv+O5W1x09bc11U ky4Dt4mSZb0KCBERhWR2EDkkT5ABC/WtHN3wmLrAnRv+F2rTS7iMGKUBwWgTjbPQmGmnDNgB1 25DJ/WJbFrFPEKtMVqr9RzMb7FvOj6JO8sFLNooE3e7whjfkKCU6M1dE0xZ9Lnj03Z/QTfwW/ U91Io6ucb2ma1gV4PITGoj6nu2ZEchjaR/st4q3/dZxC1L5Y9ed5YtJxCXnRBqXhxfsk6RUmY +JDZfB+SOUFlWe96Jp/LLk93WYR0WKKjLHspXOcIvCirrvOblWDvZ2K0KvvSmGjipOfg1cjtw VTgToF6hJQuS9n66muUkjmjjDKIxJoOSBKHJtV+e5qIg9QyfBkl0mGSYAKrypYs1QbeqrXoLG zlu/r/nOWawjFFA1PtgRMnORPQHamBuAC4R0yFmAqH4eFzwVs8UjJaXbM0xG81ysS0P7oVfps 7ZkzCEamkdcXgJr/mNA5RKOweCZ9BRp/eL+lJ2ZKgCOvOXgrdUk7gWwXfFKcZNFVo+zGYjJRd jsJwiP36xor1CWr+GVAvmkZM/XxLclCN1/JlYymGkYHk4u20Djm3i58OEALRdK/ybHpM= Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The recent addition of the regulator support has led to the pca953x_remove function returning uninitialized data when no platform data pointer is provided, as gcc warns when using -Wmaybe-uninitialized: drivers/gpio/gpio-pca953x.c: In function 'pca953x_remove': drivers/gpio/gpio-pca953x.c:860:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] This restores the previous behavior, returning 0 on success. Signed-off-by: Arnd Bergmann Fixes: e23efa311110 ("gpio: pca954x: Add vcc regulator and enable it") Cc: Phil Reid --- Cc: Linus Walleij Cc: Alexandre Courbot Cc: linux-gpio@vger.kernel.org drivers/gpio/gpio-pca953x.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index cbe2824461eb..b9d31d737dbf 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -853,6 +853,8 @@ static int pca953x_remove(struct i2c_client *client) if (ret < 0) dev_err(&client->dev, "%s failed, %d\n", "teardown", ret); + } else { + ret = 0; } regulator_disable(chip->regulator);