Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2883644rwb; Mon, 15 Aug 2022 13:15:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR5uIsvnSIVtRtJ+aLOLWzQKvNHEUT60qflOUQhIGoKdnowiJRuoj+MPxBZQX9fK9enliMLn X-Received: by 2002:a17:907:3e21:b0:730:92bb:7fcd with SMTP id hp33-20020a1709073e2100b0073092bb7fcdmr11416648ejc.170.1660594555874; Mon, 15 Aug 2022 13:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594555; cv=none; d=google.com; s=arc-20160816; b=0zfoU+RFuHk1rZSYBR4My1/czwXZ7JAPzMio6i9TQKg3+IVJzTXeWHJpR+kr1HNTxw k4ErkfjaFicLlUu1yFozvT2lXey6VRzGKBQx8BIC1+TKaUvqYmiitVNqOhJClm5kfDvW K3Vo5k9AeixiRf1rvxl5JX5vNlnz8bfLPDGA5hPH57A0DYyz77qzGBRR6Y9gJzeERHDC q3OHtMbQisLtolDLit1DSjOgGmZ08t4XmoAyUC0E8bFcnwXpwqgsFA++lzl1SJGiWBIQ m6A5/TY2Vq0oTWS4pAqRloM9EZmnUn2mDqDSlxMM5YpdwaMMuwu8zRROA34EX0S+I+0p gGng== 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=OCoc2fSgg2B4U0+hrJLePCSiG2tyjhf4U8RyufmK4BA=; b=br8ywzaTSs7SpDXP609YsWLTkQFyz29Sf0134bt67JwNMQzCs/hf1Nfpb9ngVarHgq Xz9k4ejDV54+G593x+tPgNl0+ErShJ5Ra1BBu2HeSs85uJB63dSgnK+tygQ8vwgi4VoQ Cx/tS9TYPxv0acbNah5GawXrv+D96GPglRDat9rR6By3tGkKaQ5N4irFM3uz5ERmDSCR CM7N5khW1N0/b/ckhsud0i9SaFqtXI9Gtr9yAu5Sr7tgt2Jr/AMQC/h+awhzBgaScbnJ c13VMo7/y4rcbtiqdoexZsP2VmCHRVf2jBlHiNi/fdx+EJiI/vwexdh42fbfv/WtYS6K CjzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wYh4tP7X; 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 dt18-20020a170907729200b00734be0ce32esi9439203ejc.688.2022.08.15.13.15.30; Mon, 15 Aug 2022 13:15:55 -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=wYh4tP7X; 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 S1343511AbiHOTIh (ORCPT + 99 others); Mon, 15 Aug 2022 15:08:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245506AbiHOTFr (ORCPT ); Mon, 15 Aug 2022 15:05:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A34072AE23; Mon, 15 Aug 2022 11:34:24 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3C7E761043; Mon, 15 Aug 2022 18:34:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D305C433C1; Mon, 15 Aug 2022 18:34:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588463; bh=CXgv/mwnDeY7ZKskEA+lAuZOc1xXfXxQx4KsFMlI+pU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wYh4tP7XRCvnzI4QnxxNrQNwcBbIwNTju1L3if2oMj65lfrk6s6uyxu+A7rv00O02 yxUDo/GLCWX67NofGoV+LLZJwLwg3zlcQQosrN1ZB2Fff/2JCN8IH2lvtW+ZBSu/XI P2+kTM6AslLo8sNazHEURxi4GG1CfyAs2N4fMX5k= 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.15 411/779] mtd: st_spi_fsm: Add a clk_disable_unprepare() in .probe()s error path Date: Mon, 15 Aug 2022 20:00:55 +0200 Message-Id: <20220815180354.841549079@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 983999c020d6..48bda2dd1bb5 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