From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF283C433E6 for ; Mon, 15 Mar 2021 05:29:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C570B64E45 for ; Mon, 15 Mar 2021 05:29:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbhCOF1z (ORCPT ); Mon, 15 Mar 2021 01:27:55 -0400 Received: from mail-lj1-f170.google.com ([209.85.208.170]:42822 "EHLO mail-lj1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbhCOF1h (ORCPT ); Mon, 15 Mar 2021 01:27:37 -0400 Received: by mail-lj1-f170.google.com with SMTP id 184so14705060ljf.9; Sun, 14 Mar 2021 22:27:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:reply-to:to:cc :in-reply-to:references:mime-version:date:user-agent :content-transfer-encoding; bh=wOKNiBuyV2EBb5bEXF6m0Zu6EfHeC7lgHHf+sekEJJM=; b=byd3KCAfm2cKjDIW6fWihG1DsTg71uONWxtwq9IcBHvwxbJ7sxHGuAo78fsg5thgSj UXDQpImBsqaIaAxpm+BUWNiD2zaLOD6mNuTQ6rv7kdq091k3pDySqoFQGnKYYqh+k1gw Hms2zWQCjaPVeCnnWACRMNA1UmW7gq4uHDW/xgk+eFTBg45cfFMyNrf/FUH+l0jrrWP2 1ZKewFhP+umSrudIdrhrrohJu2jWKNnyWabAOdm63bdnbFYCI2MVZmIFfFFWRzwF6WGT fzog384I8d4Rv5klPtBMt8p+s0txGKPua6qePBKoXUdrPOi9KIT5PFgb2Tw7NQK634UN 3aoQ== X-Gm-Message-State: AOAM530oh4x8aZpgM2r2Fw4Wb5NkHinjJtwf2rAgjgTiSoZfS1cUG2Vw 8eeR1UpNBNRGPv22W+3HvrdddzowsBY= X-Google-Smtp-Source: ABdhPJzy77AmdCgrI712x2ZghN5JBTxRTVJcDmEL731Vu4qs2tt98XBeq4lW93Od1QGmaMX9kzSzfw== X-Received: by 2002:a05:651c:118a:: with SMTP id w10mr9296774ljo.431.1615786055762; Sun, 14 Mar 2021 22:27:35 -0700 (PDT) Received: from dc7vkhyyyyyyyyyyyyycy-3.rev.dnainternet.fi (dc7vkhyyyyyyyyyyyyycy-3.rev.dnainternet.fi. [2001:14ba:16e2:8300::4]) by smtp.gmail.com with ESMTPSA id v11sm2757386ljp.63.2021.03.14.22.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 22:27:34 -0700 (PDT) Message-ID: <0d1bdcff83fcd875a968cc4fe5c4943e08e44a6b.camel@fi.rohmeurope.com> Subject: Re: [PATCH] regulator: bd9576: Fix return from bd957x_probe() From: Matti Vaittinen Reply-To: matti.vaittinen@fi.rohmeurope.com To: Dan Carpenter Cc: Liam Girdwood , Mark Brown , linux-power@fi.rohmeurope.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 15 Mar 2021 07:27:25 +0200 User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-03-12 at 10:42 +0300, Dan Carpenter wrote: > 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 Thanks for killing the bug Dan! Very much appreciated. By the way, this is going to conflict with the regulator notification extension RFC series. I will rebase the RFC when this gets in tree. Reviewed-by: Matti Vaittinen > --- > 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[] = {