Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3248414rwb; Mon, 15 Aug 2022 22:15:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR6VcKZfA7p41thTpboKPskP+dXUt2UpHfOJT6YsVQDBl2S8o/KLIHSp24hUzWT6OfWYjWdQ X-Received: by 2002:a17:90b:3b51:b0:1f7:499d:3e69 with SMTP id ot17-20020a17090b3b5100b001f7499d3e69mr21843010pjb.240.1660626945549; Mon, 15 Aug 2022 22:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660626945; cv=none; d=google.com; s=arc-20160816; b=D+mf0rlhc8gEpVsMlQx9n6o5viRymSZvBEGIfRMXEb+PyVulI70Pk0KLYHStsqxAuY L2hKgum8GqaXhor/CYA6cL9KwZOZIIlDUActRp/Y3OU1P95zLp2rh4c5qQzxZPnjf626 hFFK0Vyns4aq2UorUgZJ13yNo3+7/DXwt7r3GOzuxb4XBtekSOjwST1iXgfmtEHdoOol m1slLtWemNUSxDAFlYxfcaLnKbACXQ/1xqTEmtyeGRCzxoxqxncP141lZX4dIw1832Od WOwobu/7IF4s+ej5obG36D1F2+hYlJmgwpx3xg1ajGjgl/9fnRnDNKIXacKRkbc7y96U olFA== 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=FXsSLQ2v871HP+mjOXQWKxESSHGIVtMx46loPZnlzxQ=; b=Mus0qyVT25wQvvhjqo6sNlWs69r4hQHqaLvlFLF8TqNdgnRtQiC4FEisor7rK09eY9 JzQtEDWTWr2eTr84/mm06ULb3HojSla6tr1QqvD1n3wIuUtFcYf/PvIEMGdo9m7irVW3 qdx0ISTOOZ7fULEIKgpafWf+YrHMiXruZ+OmDdVbUaAz/srq09K0W+jS89ypZlMt37ki eqepn4HjNQY+9YFCtslLwD84Nq7EnkFmm24Ljj/q+mya7yhG6hHdcWxUjFca69tbGp6D k24y6lXSid/5HBRbH3ReAVPTKE2Jr80ob9BuMuRWbaezEwi7mtYG4aByoOi/FYL4hzTb qC0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ExsZnuu/"; 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 y20-20020a63de54000000b0041b63205786si12762822pgi.293.2022.08.15.22.15.34; Mon, 15 Aug 2022 22:15:45 -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="ExsZnuu/"; 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 S230157AbiHPEcg (ORCPT + 99 others); Tue, 16 Aug 2022 00:32:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230105AbiHPEcH (ORCPT ); Tue, 16 Aug 2022 00:32:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAEF7EB3; Mon, 15 Aug 2022 13:22:14 -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 55C9660F60; Mon, 15 Aug 2022 20:22:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5642FC433D6; Mon, 15 Aug 2022 20:22:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594933; bh=VGslUow4e0bUUqVOwE8Ov4b9PU8fkbBMNLmIyFUG9RE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ExsZnuu/0303q0Idu2Cs94ZQt2w/E3wJNTdskRjS4BcLoWXf3NgZSePX60Dkyb0Bg ck3jv2Np+DeVp1Y4Z5AS3pAzldwSEltDCK4hToeIg+/fC2g/wFV0NoEedPDUHw7t7Z TjSFZpUkBi06iTTE1eoyLMQlnnTyoNsbaoFE5xpw= 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 0604/1157] mtd: st_spi_fsm: Disable clock only after device was unregistered Date: Mon, 15 Aug 2022 19:59:20 +0200 Message-Id: <20220815180503.834627235@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 cd043c613e21bb6f039057043da759471706adf5 ] Until mtd_device_unregister() returns the device is expected to be operational. So only disable the clock after the mtd is unregistered. Fixes: 1fefc8ecb834 ("mtd: st_spi_fsm: add missing clk_disable_unprepare() in stfsm_remove()") Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220607152458.232847-4-u.kleine-koenig@pengutronix.de Signed-off-by: Sasha Levin --- drivers/mtd/devices/st_spi_fsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index a5a4b612480c..9f6d4dd8bade 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -2128,10 +2128,10 @@ static int stfsm_remove(struct platform_device *pdev) { struct stfsm *fsm = platform_get_drvdata(pdev); - clk_disable_unprepare(fsm->clk); - WARN_ON(mtd_device_unregister(&fsm->mtd)); + clk_disable_unprepare(fsm->clk); + return 0; } -- 2.35.1