From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932166AbcHZPex (ORCPT ); Fri, 26 Aug 2016 11:34:53 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:57324 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753338AbcHZPej (ORCPT ); Fri, 26 Aug 2016 11:34:39 -0400 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:2jPbztpF5Ic=:M9oVJskYtjEN3bbs0x6Lrr gJdWdR3bc+E3EeLURldy91Mx9p+WMFVnwuA2vtlTzyWAiLZ2vBXza7Sh/R+wTzYGat/SWAPMz r5PCRulYabNiiYqwTj2RuEofdnq4Nrh31szYk6jpMhz6rulx6NjcS+ef7O62TB5pZV7wj+eO/ ZpfTTIAc0UuOWJeyg43Z4x6sCHNDfap0Sv973h3sfNx1A+5xU5OcHehK+vitZCAPPrB1kxvo9 vuuFRiDqH3QBRKSzJhFDc8D/uU92emJGCD7lW41jl3E049bdPclgRK/NsUf9vdlR88kfxHWYt EnSHKFXcC8Oaa03+5AnBDYoqePr336qagB7zCvVKfqdlgttlB3ld+sewI4MFyTvoIgoZAWTRA GVuuhu5Nz0PTLAbJSYyakCH6m84YjfphuEBpBNtgpUwbRlcMEs9aiB2Wxycv0Ns0OTo+V9qZ4 imcjuUB1/knbO0dRZwkmjNBsUIOXD7a3pY6G52gyPYMWnwC96UlDjOu94X2eO9lzBPMUThCD8 EOc+jJU5ZuWVHahFE/G66NYUKhEKzPaZR8A/7USVndUhuZ9j9u0nmCPvRND875T6TADQbf0ay zc+EtLX3XS37nF1YlvUdWsTuGXBo5Q+SR2pbMDbi/IezgE8MBuLHUSREPqGTJGbsVyAR2B4ym 8FTjGkAJFu36f4sPcf7A0oMWMSXN2qTIdglxd+BLphbVgrQmgT2jh22lf7NqT4rBanck= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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(+) 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); -- 2.9.0