Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3087564rwb; Mon, 15 Aug 2022 17:49:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ql3tlEIXDrCcrro6rmuvNaltNII/xOA5g073d/ZMIeccYNK8et+5DPMqhZzkNCcor0WBK X-Received: by 2002:a05:6402:428e:b0:443:8279:13ea with SMTP id g14-20020a056402428e00b00443827913eamr10549294edc.294.1660610975552; Mon, 15 Aug 2022 17:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610975; cv=none; d=google.com; s=arc-20160816; b=x6vkj7d9vfxecZVWKlrZSDxORyRSlG1zEskQ60pv+BZoKmAuMhwmgMu5SOcyDgxamL M7Y0srDcgLCJDTNtOx95aZSZRMAOY967K7uucmGzbYxYJjBp0GJgevZLm7jkm9cHvBIW +juTP40MwArFqrnIsFpXEXFNisCu6T8a5bmwfIknGrDFpJEnYy0PYkvCK1Shn6HZ0PRG sL5JYwQBOafLF+wF0UvsGSrrK91fau24aKhjpP2Gca20vMseHqJEzhzjDd45KTf+g867 2XR4skuamdDaBdpT8AkhO0w++dIXrJThdiu/BD4uja4y23GGNp+5jJmw6eTVtQYdJdI0 IweA== 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=paC/YJ08RoGvT3G+dkc5BWk0bW4nH5iB9aT4F8VjC4yxbP5KcflrtxT0Ndi3+WWHQ3 4jPHu9YE3sUo+R19eIaAJ3fm0PhT5e1P0eWsxDa5sNyYEJpWVn6siZM9c21PG1mSr5c0 KdktoLwVke+1IGEGGBtWVchw804Zgcp1rl07oBfxU7UqxAIKielz3RsJ3ATidDIdge5T IbYy0kZAObOBnMlPko1T2T9YhXm/54LL7xOIo3SNDOECjZJ768obFexQV3Wb7Bx5ZHpl +hBuSKOhQjUqwGLtvM3sU8JRf+rocyk1054Xxl1a9XtLrjy8RksupR6pJCcVB401yFMC oqUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AB8m6qY0; 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 mf23-20020a170906cb9700b0073866c0672asi1380634ejb.73.2022.08.15.17.49.10; Mon, 15 Aug 2022 17:49:35 -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=AB8m6qY0; 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 S1348407AbiHOVbH (ORCPT + 99 others); Mon, 15 Aug 2022 17:31:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348435AbiHOV1j (ORCPT ); Mon, 15 Aug 2022 17:27:39 -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 1D5E5EA8A9; Mon, 15 Aug 2022 12:23:21 -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 648FEB80FD3; Mon, 15 Aug 2022 19:23:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6A5DC433C1; Mon, 15 Aug 2022 19:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591399; bh=CXgv/mwnDeY7ZKskEA+lAuZOc1xXfXxQx4KsFMlI+pU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AB8m6qY01CfEzQMHJyY9zMvkc4vIMEiH86Nze/ACgOWgk/ZEdYpz57+uY92FXI8w2 vewymdgCYGxDWjuIYFTPTHteNFtwVVp86gDeYoLklraIw3kB23oZ1M6RpFvZzPD8Z7 vp66Z7fzer45rjZ3etFHVJJuSthDivumOobkXrSo= 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.18 0566/1095] mtd: st_spi_fsm: Add a clk_disable_unprepare() in .probe()s error path Date: Mon, 15 Aug 2022 19:59:25 +0200 Message-Id: <20220815180452.988843466@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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