Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1858353rwb; Fri, 19 Aug 2022 10:33:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR74feViivjAAlp15UuIN7L6AKM5xPayQC0tRpHe7JcHCH8SGw+IxzEVjRW7nbAyP2H1gceI X-Received: by 2002:a17:907:1613:b0:73d:3672:e053 with SMTP id hb19-20020a170907161300b0073d3672e053mr2123240ejc.630.1660930380596; Fri, 19 Aug 2022 10:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930380; cv=none; d=google.com; s=arc-20160816; b=Z7SnR7/tQMQveMGriSy2YxqESspY3jrsfdzr/NUC3vp8UfO7YX8XEWvJK5YHpl6ZdX S2DYhzYE2edTw63ysSPi25/jQ+WgxevObYEZ/utxJHFKvvA5sLPrOuEjtT8cTWeKtI7q k/tCnVz4Gozu7Fc0HoGTWfXkSNl2zQz1qLntEQGkS1L0/qEV9zYruWQYi+AGmi2KTibk s696vtoH+ywOtzmIRJfuO3jPl0W6+OfcLgNPPEJnNINJ4RPCITyTrC25mRV4+8bJlEjT UPzr+bBSEIFEFZJ895H6pJql9tfC2J8irkA8gI9uzvuPWYaJhY1jXXR++tyCqlZor7Ho Fg+g== 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=i5iX+NkcE/hVOcp9KgwsMib3EOuu0nC97tlNGOPhp/0=; b=m7HltiqsArrQdb6Z2qhtEQPkAkgLXqFd/ladMtZax7Kso6/ODSFu6vkk5SyKMtkw17 jIWXN84vU7DjuT3OVYBaXD6fdgYPK0OQZNkcw4sHA6iUN5qGYsdQgMVv2mIHx7MdYU9y 1IlenLXyx28y/XVLNrWulutBUruHAWGWMMxno7eBc/9nFclfcDTUFWaiLO7iOgEiliXA UXdSyrNyIGdLrxeD/ib+OvbdEl4SFDFwgjSR3QbCxyO2VUa1SpHLFTMAUHKFPjDpd7jE cPfPxojeA+gDF2wt0NJkXMYTnSU89m02LgxWw16JT1EwgONp0T4gk0Zn8ogWh8EQHcJ1 IEQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ylGYYiUn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga12-20020a1709070c0c00b007330bee74cdsi3689971ejc.676.2022.08.19.10.32.33; Fri, 19 Aug 2022 10:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ylGYYiUn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1352117AbiHSQY6 (ORCPT + 99 others); Fri, 19 Aug 2022 12:24:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352388AbiHSQUp (ORCPT ); Fri, 19 Aug 2022 12:20:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C59310A76A; Fri, 19 Aug 2022 09:01:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 05E1FB8280C; Fri, 19 Aug 2022 16:01:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFA27C433D6; Fri, 19 Aug 2022 16:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924895; bh=fDMiJkUJXq/6ql0CIBkC7iDv1sl3hWmBD+OxG2A8bEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ylGYYiUnlY+L3T2kFBWtwGIjq8Alq6SVGIWRkXqDZszQamL4msPmWQCLxkPC9GGET z1ijpY5QZ7px+6+rdtvWmzH+Y41KsQ5dl5ztaqBgqMQXt9CPgjQcsn3+B9EPr7ZG1C yztbUtcOWSYGnYKx0mP7+Ha4Ph25Xh8bazxXUawY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Miquel Raynal , Sasha Levin Subject: [PATCH 5.10 277/545] mtd: st_spi_fsm: Add a clk_disable_unprepare() in .probe()s error path Date: Fri, 19 Aug 2022 17:40:47 +0200 Message-Id: <20220819153841.719713866@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Uwe Kleine-König [ Upstream commit 28607b426c3d050714f250d0faeb99d2e9106e90 ] For all but one error path clk_disable_unprepare() is already there. Add it to the one location where it's missing. Fixes: 481815a6193b ("mtd: st_spi_fsm: Handle clk_prepare_enable/clk_disable_unprepare.") Fixes: 69d5af8d016c ("mtd: st_spi_fsm: Obtain and use EMI clock") Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220607152458.232847-2-u.kleine-koenig@pengutronix.de Signed-off-by: Sasha Levin --- drivers/mtd/devices/st_spi_fsm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index 1888523d9745..9bee99f07af0 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -2115,10 +2115,12 @@ static int stfsm_probe(struct platform_device *pdev) (long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20), fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10)); - return mtd_device_register(&fsm->mtd, NULL, 0); - + ret = mtd_device_register(&fsm->mtd, NULL, 0); + if (ret) { err_clk_unprepare: - clk_disable_unprepare(fsm->clk); + clk_disable_unprepare(fsm->clk); + } + return ret; } -- 2.35.1