Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3091150rwb; Mon, 15 Aug 2022 17:54:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR6uHjmT5Ei3kSRb3t57YWGq/iFvK5JNOQe3l7jstkGH5hIOZ+0jzLNP6MauYlokAQSoQGqi X-Received: by 2002:a05:6402:2683:b0:43e:76fc:f9db with SMTP id w3-20020a056402268300b0043e76fcf9dbmr16312029edd.390.1660611203310; Mon, 15 Aug 2022 17:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611203; cv=none; d=google.com; s=arc-20160816; b=ThRi7vVK5gE3O+Vc7lDxW/BXBLedmH9z+m96r7q1B9gXprCjpmZWBHket7qvLMeJMG cjxMWcI/GLBnwPkZgeZkCyrILOyPK6sKGv0yu2Jwb1maAR6YCYIWz0wKSROwojh3nW9Y uFlSUP2+QLu54wZNK3vnS+nbhU/G4n/QLwOYdrJzUeS7wHTuAnyiG0tuVkWh/XUbwpzw hAojypTE5CsboF/zAc7YWYH7wEnvKk+azKK3xXe8q/yy0+IiBAq/E6QCAfcbGw8t5fhl sy9DIj1O7uJ1VM/qTkloOMXJff4vQoUipPjr5gE+aCNsi798zrzM1WB9I+pga7co0pna iwKg== 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=PoQMt5kj5LX/NVB+P7uq6dsk0UQKyVV4d0qvAssySWY=; b=cy2bXFvp3+bwVwRfTvFIU/oxOWwXtER0sJ2iTq6L5OvZO0MiD8Lx2RTahdCUlryDsW Mm5h7DmM3uMtMmovsKFYW7WA6yDDgoJcHSh7Em0bBlIwqMIA/1YWu1emdtqAL+/IiPr1 /PFjD/l6ekI8uWJ4ZHn+lSVO182Lsx5jAoc8cGtvqkELCh/Ut3XwuaVlJOp0yB4Lq+Y3 t1qJohcFjiSxZOBdsG/gsx5M2LzdSdtC096USy0cBkqduNRhVNXGwr26GZ0zB7Rj8pvc 8EztOhlec16U0pXJ8zRzuv70OTN2l5c8ucZJ8Oq8rz0o4Y8i7vkQnHhsWY3qEA41YfYR XqwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TsLE4vzb; 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 ga14-20020a1709070c0e00b007317e0f2b71si9881127ejc.256.2022.08.15.17.52.57; Mon, 15 Aug 2022 17:53:23 -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=TsLE4vzb; 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 S1348238AbiHPAKR (ORCPT + 99 others); Mon, 15 Aug 2022 20:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355626AbiHPABD (ORCPT ); Mon, 15 Aug 2022 20:01:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C84774AD48; Mon, 15 Aug 2022 13:22:03 -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 7A437B80EB1; Mon, 15 Aug 2022 20:22:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC9FCC433D6; Mon, 15 Aug 2022 20:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594921; bh=DweMI5Mf3uuhoLOWQNcaUFo2iN49xJP4R8pDEYpunt4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TsLE4vzbT9VxMYHBc3+2Nush8idbT2zY/AFdNLQDEv5YlQ3Bz6h7Ofc93SF6ClL/q 7iJVlrbeF/EOw3+bfVZRuGGuFftbuzn/1rgIjxylo5W0QEvIGSnjrBChld1VMBwTA5 HqcM2JUdvJqqL7hmse4yLefEbgPKpIYhEWryeT0g= 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.19 0601/1157] mtd: st_spi_fsm: Add a clk_disable_unprepare() in .probe()s error path Date: Mon, 15 Aug 2022 19:59:17 +0200 Message-Id: <20220815180503.706206239@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 d3377b10fc0f..52a799cae402 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