Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp994243rdg; Fri, 11 Aug 2023 06:44:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESNNlTmblMPqWRLC5/ZkWaKyDnlQ/0s2RFYi0Ye54jNCMryhl+F4T30OJdTFBaTofNEfg1 X-Received: by 2002:a05:6a00:1949:b0:688:14c9:9aa8 with SMTP id s9-20020a056a00194900b0068814c99aa8mr1871988pfk.27.1691761455173; Fri, 11 Aug 2023 06:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691761455; cv=none; d=google.com; s=arc-20160816; b=WDUSayFB74Kfpv9stWMLb32oZKqqu+3feSss+MPAF4OGYwR4Qm9U+nWBcDg8jdo0bJ JnSGlmijnfrkiNhbNoWGTYJ71EVfl2shpp9UZ+WCMx9peVsC+6CpFYqGalkFvsgFugA0 OJZR/ng/xXxY4OqHfxmrSj3X9cS+1yF+Ax2pdxzuAuqpMyd5JEuxxJsA+T69m24TsG9l H1pRj+SAJSgnKBmoM8tI2MbZ2yulDJhN7JvcaK0//Po7sfo0hlVJF+LlLogKrVi9Bdgd RffemiGRsjGI6ljDK5o26wph/DUEtKr6RRM+iQFYmyc5zxhRh8Js1JwUc7XiaX1UrzIj g8Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UL6CrUi/ahFX7DBMUW2nJt1Kz3NrjZimCXDv7g2AazA=; fh=1illQt2rvZm/duIamif60BE+Ziytl52XIUdvA193/Ac=; b=TSZ2hsErwPakx138lVNRjV7+oDELOU+q584RJKSPog16/6XIitTqwS9KP55iqYLcNj 8I176NERtVfKn5gt55vU51AqYhvsWvgIZoaejelbtsHv2UP15r49zDbiO98FoFCK69rL Np1rQc2fxoM8N0hYNRdnJQOzDWXpIeRGQlGXVvjQZCmjrLJUdZiO4qICuAE++JbqxUtY IggMURtwVCrn/z4KlOzjC0i/E5UGznrulSgNoaUgyt2VZi1mSuy3WozZc+7wWakXTCgA JLA+3PlmrgJrqsvdqXLSX6+27ivgJDmpTt00y48hfaRj8egqAW593gWWisTBiOxKFNdX fxgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eXqzzJmA; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a6558c3000000b0054fdfd26dffsi3443493pgu.337.2023.08.11.06.44.02; Fri, 11 Aug 2023 06:44:15 -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=@intel.com header.s=Intel header.b=eXqzzJmA; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236580AbjHKNF6 (ORCPT + 99 others); Fri, 11 Aug 2023 09:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236703AbjHKNFe (ORCPT ); Fri, 11 Aug 2023 09:05:34 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E41563C20; Fri, 11 Aug 2023 06:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691759114; x=1723295114; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EpaGcbRZtUVPRNtweQ68G8X1R1przpLPCnn4gPSdxoU=; b=eXqzzJmA9cr48+xiYcZflU7KgQOn/OoeOrq75uX+yLGkWG3OXL3YlTxz uovhaIOxCeF5Xr3280N7d1b6UJhJOVQThNf2FXMP/iLjYp1N6g4ShKHPG v/FVjtEYnQZeA2EKtKi4OQo6DYE77ZIIm4O4+jOzEmpj6cl1Bx1plTOkT 4rvVGyHBzjWFA80PKimxevIYJ4zfYMbjJ+/bDN/5Nckp4Kc0FvNJAqago W4QURo6LNF7/fwoP+5GvO7ne+82J8cAJN4yQ0Tp8zqS6XpTk0Ih7HL7iq rs8SPXg0SR3+lKEH+WfYnFWQ277rFMoHrw5HYTp2Xd6kwH/k6YK5SEqvV w==; X-IronPort-AV: E=McAfee;i="6600,9927,10798"; a="361811945" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="361811945" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2023 06:05:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10798"; a="709535251" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="709535251" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.51.13]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2023 06:05:04 -0700 From: Adrian Hunter To: Ulf Hansson , Andy Shevchenko , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Yangtao Li Cc: Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Kamal Dasu , Al Cooper , Michal Simek , Eugen Hristev , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Lars Povlsen , Steen Hegelund , Daniel Machon , UNGLinuxDriver@microchip.com, Patrice Chotard , Brian Norris , Ye Xingchen , Brad Larson , Christophe JAILLET , Sai Krishna Potthuri , Swati Agarwal , Andy Tang , Georgii Kruglov , Jiapeng Chong , Doug Brown , Li Zetao , Kunihiko Hayashi , Jassi Brar , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/16] mmc: sdhci-iproc: Use sdhci_pltfm_remove() Date: Fri, 11 Aug 2023 16:03:42 +0300 Message-Id: <20230811130351.7038-8-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230811130351.7038-1-adrian.hunter@intel.com> References: <20230811130351.7038-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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 Use sdhci_pltfm_remove() instead of sdhci_pltfm_unregister() so that devm_clk_get_enabled() can be used for pltfm_host->clk. This has the side effect that the order of operations on the error path and remove path is not the same as it was before, but should be safe nevertheless. Signed-off-by: Adrian Hunter --- drivers/mmc/host/sdhci-iproc.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c index b1547bcbec32..10235fdff246 100644 --- a/drivers/mmc/host/sdhci-iproc.c +++ b/drivers/mmc/host/sdhci-iproc.c @@ -386,16 +386,11 @@ static int sdhci_iproc_probe(struct platform_device *pdev) host->mmc->caps |= iproc_host->data->mmc_caps; if (dev->of_node) { - pltfm_host->clk = devm_clk_get(dev, NULL); + pltfm_host->clk = devm_clk_get_enabled(dev, NULL); if (IS_ERR(pltfm_host->clk)) { ret = PTR_ERR(pltfm_host->clk); goto err; } - ret = clk_prepare_enable(pltfm_host->clk); - if (ret) { - dev_err(dev, "failed to enable host clk\n"); - goto err; - } } if (iproc_host->data->missing_caps) { @@ -406,13 +401,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev) ret = sdhci_add_host(host); if (ret) - goto err_clk; + goto err; return 0; -err_clk: - if (dev->of_node) - clk_disable_unprepare(pltfm_host->clk); err: sdhci_pltfm_free(pdev); return ret; @@ -432,7 +424,7 @@ static struct platform_driver sdhci_iproc_driver = { .pm = &sdhci_pltfm_pmops, }, .probe = sdhci_iproc_probe, - .remove_new = sdhci_pltfm_unregister, + .remove_new = sdhci_pltfm_remove, .shutdown = sdhci_iproc_shutdown, }; module_platform_driver(sdhci_iproc_driver); -- 2.34.1