Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4607224pxj; Wed, 12 May 2021 09:08:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzG1VWC0ZO9pMJk/hgeFvdQNcNI/po2k+k0lbkwukaOmKT1ux1ju5eeI6DMDfX50DGN5hM X-Received: by 2002:a17:906:3ce9:: with SMTP id d9mr38238924ejh.172.1620835703992; Wed, 12 May 2021 09:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835703; cv=none; d=google.com; s=arc-20160816; b=h7oOaCTMM+gweZNGuCiS0xxt1aiE0esAoGIYFEJLxdJcwHV9Cbdb46o/mkAiB6enOT NmthQcgQ2vIA4dZSFo8wojMu8LVymJDp+XGWyMNVDt3gA2kjghhXBKlDb+BXM+8o14eS xIXL7suR+wUg2bqvKnJvjoKBEPOd8UZEHofVdyzNRdHWBptbthVtc0CqdUARzGzy39kT /y4oEh71lyRrF5m2FJG5/l9hYxXxE95Jw4qWDDNjPpMvPJILOfTMw08i9fCHhl/zLeo/ zdk9m7b0W7Pzu8oJ6+dcmw2oxTaoQlT4pg5tX8i/TGD19e2gjpoDwg/vETUaMCVWk13u C+xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nwsh0c4QwNX9N0tQBx6HjyRa1NOxekyS0ytHrwJazOE=; b=PxStzBFJ/FconJtGVP0NTbv7pUNTfjCp5aL09u1fbcX0Jnr8BFO5ESg4BgRD9SZ7mk PhpeDTyMS2ASnJBux+ge5mEf3ZSUCyDI/GYtncE61YA+0ObQ5bfW6FULXnDrYKwFlre9 IcscoKOByhre1ktuIZj4ibRbSv3vw1YacHBrNGCm5p4aTaYS9hOedGvAPoniNd+ODRFx Iixp4TYHGpbxlcbRWTp/iHQA/C15hoeh3m2VfKsXlOmqYp8pBmKuo2CZaoW1eb0lUyXs z979KDfO6Dsu+gJPNsxxYtMK7Yn78oBJmHoVoLbTNT0SWqYXEV9MCTjJ+1QQ0f0lYI2i xjow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AYxKC+Go; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x11si129460edd.384.2021.05.12.09.07.59; Wed, 12 May 2021 09:08:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AYxKC+Go; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238604AbhELQFd (ORCPT + 99 others); Wed, 12 May 2021 12:05:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:57684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232542AbhELPWY (ORCPT ); Wed, 12 May 2021 11:22:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 385C7619A7; Wed, 12 May 2021 15:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832153; bh=sk39f7BcW7qfsEqn3oDJHypA/aw9+AGbHS6rNghlAc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AYxKC+GocyOG+kwsgftInRP8xWHplYHbZxz9vYGNufShxL2AO164KW57F8eljmHrb rryy7nln6D1mqkrOLfz958TwfJDuuOXllyJ79xUX8q7gn9ZSL/Y++dFHw1n/DvAvdl EbEE8uvC35ZNaXNaxiSfq7A5jdyi/PrU0w9jS/ww= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Matti Vaittinen , Mark Brown , Sasha Levin Subject: [PATCH 5.10 163/530] regulator: bd9576: Fix return from bd957x_probe() Date: Wed, 12 May 2021 16:44:33 +0200 Message-Id: <20210512144825.195199698@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 320fcd6bbd2b500923db518902c2c640242d2b50 ] The probe() function returns an uninitialized variable in the success path. There is no need for the "err" variable at all, just delete it. Fixes: b014e9fae7e7 ("regulator: Support ROHM BD9576MUF and BD9573MUF") Signed-off-by: Dan Carpenter Reviewed-by: Matti Vaittinen Link: https://lore.kernel.org/r/YEsbfLJfEWtnRpoU@mwanda Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/bd9576-regulator.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/bd9576-regulator.c b/drivers/regulator/bd9576-regulator.c index a8b5832a5a1b..204a2da054f5 100644 --- a/drivers/regulator/bd9576-regulator.c +++ b/drivers/regulator/bd9576-regulator.c @@ -206,7 +206,7 @@ static int bd957x_probe(struct platform_device *pdev) { struct regmap *regmap; struct regulator_config config = { 0 }; - int i, err; + int i; bool vout_mode, ddr_sel; const struct bd957x_regulator_data *reg_data = &bd9576_regulators[0]; unsigned int num_reg_data = ARRAY_SIZE(bd9576_regulators); @@ -279,8 +279,7 @@ static int bd957x_probe(struct platform_device *pdev) break; default: dev_err(&pdev->dev, "Unsupported chip type\n"); - err = -EINVAL; - goto err; + return -EINVAL; } config.dev = pdev->dev.parent; @@ -300,8 +299,7 @@ static int bd957x_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to register %s regulator\n", desc->name); - err = PTR_ERR(rdev); - goto err; + return PTR_ERR(rdev); } /* * Clear the VOUT1 GPIO setting - rest of the regulators do not @@ -310,8 +308,7 @@ static int bd957x_probe(struct platform_device *pdev) config.ena_gpiod = NULL; } -err: - return err; + return 0; } static const struct platform_device_id bd957x_pmic_id[] = { -- 2.30.2