From nobody Wed Oct 8 04:05:58 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBDC523184F; Wed, 2 Jul 2025 07:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751442409; cv=none; b=Y33ESIi1ZIkRwoVHjsAOgjN03BSTn+v6Mpo4W2A8hmQkvwlznav9sYrh9V5qfhr6ckkHWTMF7RiG1Jh/V17rbxFDVK50nt6G2O+GfNXq2TFIobuNguE0sPL9Yqqbg7E2gt5VhdGf1/8EfJq8xvM3FtkNE08zh56wpQgJO65hOpw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751442409; c=relaxed/simple; bh=XUqrxevcySUgm7p5WtPmWVKyUTemkuPq3v/8JCmiCIk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MVLvUCaQl7I3QRMYZvWBptce4vTq8reDMlNEOjk7jCPH+1u0u4AfmpE9GRi2qhYcDEdFwgG8CM/JvhGdbyh1yQNlBcIaOf+ePhq9lcreZ75Ew1rwHKTvGp5c/1b4MM8SsRkM4rDfMqCrb2nd4SV33g3hQ2fwpOBl1McHUn9CAws= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uNrvLHRm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uNrvLHRm" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8228BC4CEF4; Wed, 2 Jul 2025 07:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751442408; bh=XUqrxevcySUgm7p5WtPmWVKyUTemkuPq3v/8JCmiCIk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uNrvLHRmHFhS9zvL8WtcBmE++kWowUWrlPjQnXjdE6ZrJzhEreCH3Tc6AwW7fV3CP TpywUflfGMyd5g1eJqCkyEVAr1EJvioHMWYsoFiBiUrJG7JMGB4XvXKTTtmmmvZd5A fBRcTZEuc+JVmtS8XFqHYtQ+A7BqRjwPwnM/p0JQoQUBUAK54Ns9uV70wSFh+3sx13 JJslhFAUXbmfGclqby/buvYGGqhowGOJadiiWmuWZF4t/hQkYC5BWZAGcxQjbiRoiZ HhePmSawDursio8OtZGUj2j2zuVv48wRB3dXW+Fauj+Of3pnzeDWTwebr0HI0YqQOO kxjzH793CxH3A== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71C2EC7EE30; Wed, 2 Jul 2025 07:46:48 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Wed, 02 Jul 2025 02:46:24 -0500 Subject: [PATCH v5 1/3] cpufreq: Export disable_cpufreq() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250702-tegra124-cpufreq-v5-1-66ab3640a570@gmail.com> References: <20250702-tegra124-cpufreq-v5-0-66ab3640a570@gmail.com> In-Reply-To: <20250702-tegra124-cpufreq-v5-0-66ab3640a570@gmail.com> To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, Aaron Kling X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1751442407; l=614; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=NFHbo8ZLsnmTINee5fdPYY+g47zvEQ1GnvuQon0Ga54=; b=sq6Fw3hxaW3eVkR+hfnJhFHsc/U13j7iTnX1Xm2A9scCGSGp/1xKOrUm7kVL2qH6+umGrfeU2 mUmZ6u+16wcBVh4AW8pEGX/z9PL6B4I8/Ftnr9HnUPtc/OR+tKWLZ8C X-Developer-Key: i=webgeek1234@gmail.com; a=ed25519; pk=TQwd6q26txw7bkK7B8qtI/kcAohZc7bHHGSD7domdrU= X-Endpoint-Received: by B4 Relay for webgeek1234@gmail.com/20250217 with auth_id=342 X-Original-From: Aaron Kling Reply-To: webgeek1234@gmail.com From: Aaron Kling This is used by the tegra124-cpufreq driver. Signed-off-by: Aaron Kling --- drivers/cpufreq/cpufreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0cf5a320bb5e864709b259249fb1af8bfbc0b04b..78cddc78ee98630f99ccc332c64= c94f437297177 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -109,6 +109,7 @@ void disable_cpufreq(void) { off =3D 1; } +EXPORT_SYMBOL_GPL(disable_cpufreq); static DEFINE_MUTEX(cpufreq_governor_mutex); =20 bool have_governor_per_policy(void) --=20 2.50.0 From nobody Wed Oct 8 04:05:58 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBD092309B3; Wed, 2 Jul 2025 07:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751442409; cv=none; b=nH6IKyq4IVjsYDevVssfcuS/bMJClS+8xl+5p6PJr7Vg/KZm4yseNKNL7+9Rzf5wVqlF5AiBj4Aclr/bUhu7d5E+7OUv6XYYenFw/vpbZCuHqvrU5hbeX9CFIz3MwgLaRllCclIGswPyKo6z/1Jx77BDdKDyb2ekthowvbgm+u0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751442409; c=relaxed/simple; bh=UPGQs6o7IxPKQ3JcTYGvuyxfO5biIaF57rUkGXslPb4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cvN40lHstZ+nzIxJY/iNub5bnd1MaU2w1ccMn3KnI9Lyw9qSDn/c/rIXQs1gj9dQa9qzefLE9uH883D9qHf75A4Kfz00ApBK835bbMre2FggqhkBxlEbwNtIpHVasFnsMQUtTzkTUPJCmr4qCW7N2r34P8oEdLJI0kCfw/D87h0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AnV4Ri9J; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AnV4Ri9J" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8C270C4CEF8; Wed, 2 Jul 2025 07:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751442408; bh=UPGQs6o7IxPKQ3JcTYGvuyxfO5biIaF57rUkGXslPb4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=AnV4Ri9JJmbRqp+2AmdUWHshc+V6XXIpGoF5GH5eK9UPuYZfVvnpeu34Efkxpr1Ux DQdgL1zW1Zb72KyiaUuNj7xOQTKoASEA3FduGQSYUbaOSCxcx1XjX7Pl2EvBePrAO6 aPI7EHIS5BkfW4IyRyUrT1BNVE7zTZ3jKaRdTT8rKHKwmk8AtztSlQ25FqEonfdwPm w6J8A2aqmGWPZuHxBiXrASK64mVUe+EFdKQBmJSXCC99kiCdK6nhGIZrZskCUcIFl5 as2dLtwTRpZXKwO61NrPmUMfV8RhQrs83QmE1bpW5m/SzUAqJR9xtxuCBaYFeDztSP 7A4m+9PwFTyyQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F09BC83013; Wed, 2 Jul 2025 07:46:48 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Wed, 02 Jul 2025 02:46:25 -0500 Subject: [PATCH v5 2/3] cpufreq: dt: Add register helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250702-tegra124-cpufreq-v5-2-66ab3640a570@gmail.com> References: <20250702-tegra124-cpufreq-v5-0-66ab3640a570@gmail.com> In-Reply-To: <20250702-tegra124-cpufreq-v5-0-66ab3640a570@gmail.com> To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, Aaron Kling X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1751442407; l=1698; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=o7BSnjiEeAr40p8PQoKLMNpDwUQoKoaMMFdZbO3EPoY=; b=u4mb1O8HXeuudeU1EGdFvH0aUkecR25S5gJX5CVbPdk8NDZc+4BN+f4lUC6Z8GIrCWEn/rh6x cV07wFV9m6NAs9gOIagCuROX0B+zZJCWw3Xj6o336YmaPmLC3ICPw5n X-Developer-Key: i=webgeek1234@gmail.com; a=ed25519; pk=TQwd6q26txw7bkK7B8qtI/kcAohZc7bHHGSD7domdrU= X-Endpoint-Received: by B4 Relay for webgeek1234@gmail.com/20250217 with auth_id=342 X-Original-From: Aaron Kling Reply-To: webgeek1234@gmail.com From: Aaron Kling Cpufreq-dt currently exports no functions. This means that drivers that are based on cpufreq-dt have no way of establishing a depmod dependency on it. This helper allows that link. Signed-off-by: Aaron Kling --- drivers/cpufreq/cpufreq-dt.c | 11 +++++++++++ drivers/cpufreq/cpufreq-dt.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index e80dd982a3e23f6e678d691daba2d8bfda28d93c..506437489b4db241a7a6259274a= e84e688772e66 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -329,6 +329,17 @@ static struct platform_driver dt_cpufreq_platdrv =3D { }; module_platform_driver(dt_cpufreq_platdrv); =20 +struct platform_device *cpufreq_dt_pdev_register(struct device *dev) +{ + struct platform_device_info cpufreq_dt_devinfo =3D {}; + + cpufreq_dt_devinfo.name =3D "cpufreq-dt"; + cpufreq_dt_devinfo.parent =3D dev; + + return platform_device_register_full(&cpufreq_dt_devinfo); +} +EXPORT_SYMBOL_GPL(cpufreq_dt_pdev_register); + MODULE_ALIAS("platform:cpufreq-dt"); MODULE_AUTHOR("Viresh Kumar "); MODULE_AUTHOR("Shawn Guo "); diff --git a/drivers/cpufreq/cpufreq-dt.h b/drivers/cpufreq/cpufreq-dt.h index 28c8af7ec5ef3ad0aa94f43ad9129600ca094329..fc1889aeb4f1f15fa7c46c23800= 21bbf40b62f11 100644 --- a/drivers/cpufreq/cpufreq-dt.h +++ b/drivers/cpufreq/cpufreq-dt.h @@ -22,4 +22,6 @@ struct cpufreq_dt_platform_data { int (*resume)(struct cpufreq_policy *policy); }; =20 +struct platform_device *cpufreq_dt_pdev_register(struct device *dev); + #endif /* __CPUFREQ_DT_H__ */ --=20 2.50.0 From nobody Wed Oct 8 04:05:58 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBD6823182D; Wed, 2 Jul 2025 07:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751442409; cv=none; b=p/sv586Fo+wX+TrmIsHYxprLdwDH7qvZw7Ey6OlFd/EY7SsiziTYunKmxP5FfsFtN+J3yY/onmB172lUjHn7/4+BBKeKTygZSr7nlx/9p3gEk5ZD0HTkMmmPByTNzcvHA/2Fac/sFe6iNrIkk8W08tATTbh0niGyzUAnXJhT2DI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751442409; c=relaxed/simple; bh=CCT5ACpN4bOrIoFhtMjKzW9kbni6iu0szWJHP/pcWaw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bNKK0XtsbxTSEOhr9sg9Wx4hdW8CCDGsl41bEiLrBpjnYdS2Qar0ct2m98NQOHOdvKutW9cfaXn39W3nbeSe0y1apaTfrL4ccMFwkyGn5B09buLoabIObMApnMt/ouyzUdQZMDClBkswGK8JEcPkQDOieITbj94GGRGH7Xv+8LU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rWPG3TAM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rWPG3TAM" Received: by smtp.kernel.org (Postfix) with ESMTPS id 9AA66C4CEF2; Wed, 2 Jul 2025 07:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751442408; bh=CCT5ACpN4bOrIoFhtMjKzW9kbni6iu0szWJHP/pcWaw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rWPG3TAMeXfN1DWpY9KU50ZAXL8Xeby4SVD94ze5D7xXGI/eqNHSPFKjAx8AHKAgD xM+RWN2zrqSGponOWrVZj7izjQ1ZqmCJINPmxLjsSKJnLj3ceUCHnXs2w+uY0gKCWQ eCkQN3UcvWCwgt+GJ5rSmN9d5d0lk3qfdoYPWFTppSnVIqZLfasnAX1lKksaONGnXZ QBXQPAJM7nMWrNhJhNbo+QaJKnTsRlXu8D5h7thoyY1JOK7fQnRhYjiCRhCIfYIWWE 2UhEh1QrFsdQUJUNXuPOf3cKnE1QmSUlzzmBvB1T8Xk742ooh0pvnFPuW7LKdT+e7T V62dcEnHFv3Zw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E3B5C8303F; Wed, 2 Jul 2025 07:46:48 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Wed, 02 Jul 2025 02:46:26 -0500 Subject: [PATCH v5 3/3] cpufreq: tegra124: Allow building as a module Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250702-tegra124-cpufreq-v5-3-66ab3640a570@gmail.com> References: <20250702-tegra124-cpufreq-v5-0-66ab3640a570@gmail.com> In-Reply-To: <20250702-tegra124-cpufreq-v5-0-66ab3640a570@gmail.com> To: "Rafael J. Wysocki" , Viresh Kumar , Thierry Reding , Jonathan Hunter Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, Aaron Kling X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1751442407; l=4356; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=9YZ0nqGE5aiW/b0NHl7GJtHyqEJaSop9yzdt0kviJuE=; b=jgSpInoztgv7fEM71kFrbW8fbsIyKN/iuw2frQLeJN0xB3/tYBdYcyPpz1yQ58NIcGyWlMjYm JXdU31Ah099ClQZBb8E69C1pv0Kvd8mS/QiXbcZP3VrgX0UkVeYmxv3 X-Developer-Key: i=webgeek1234@gmail.com; a=ed25519; pk=TQwd6q26txw7bkK7B8qtI/kcAohZc7bHHGSD7domdrU= X-Endpoint-Received: by B4 Relay for webgeek1234@gmail.com/20250217 with auth_id=342 X-Original-From: Aaron Kling Reply-To: webgeek1234@gmail.com From: Aaron Kling This requires three changes: * Using the cpufreq-dt register helper to establish a hard dependency for depmod to track * Adding a remove routine to remove the cpufreq-dt device * Adding a exit routine to handle cleaning up the driver Signed-off-by: Aaron Kling --- drivers/cpufreq/Kconfig.arm | 2 +- drivers/cpufreq/tegra124-cpufreq.c | 44 +++++++++++++++++++++++++++++-----= ---- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm index 4f9cb943d945c244eb2b29f543d14df6cac4e5d4..625f6fbdaaf5fd774e3b0bb996e= b7ce980da41ee 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -238,7 +238,7 @@ config ARM_TEGRA20_CPUFREQ This adds the CPUFreq driver support for Tegra20/30 SOCs. =20 config ARM_TEGRA124_CPUFREQ - bool "Tegra124 CPUFreq support" + tristate "Tegra124 CPUFreq support" depends on ARCH_TEGRA || COMPILE_TEST depends on CPUFREQ_DT default y diff --git a/drivers/cpufreq/tegra124-cpufreq.c b/drivers/cpufreq/tegra124-= cpufreq.c index 514146d98bca2d8aa59980a14dff3487cd8045f6..ebce62be9a9c17724d50dadeea1= bb2ec81538421 100644 --- a/drivers/cpufreq/tegra124-cpufreq.c +++ b/drivers/cpufreq/tegra124-cpufreq.c @@ -16,6 +16,10 @@ #include #include =20 +#include "cpufreq-dt.h" + +static struct platform_device *platform_device; + struct tegra124_cpufreq_priv { struct clk *cpu_clk; struct clk *pllp_clk; @@ -55,7 +59,6 @@ static int tegra124_cpufreq_probe(struct platform_device = *pdev) struct device_node *np __free(device_node) =3D of_cpu_device_node_get(0); struct tegra124_cpufreq_priv *priv; struct device *cpu_dev; - struct platform_device_info cpufreq_dt_devinfo =3D {}; int ret; =20 if (!np) @@ -95,11 +98,7 @@ static int tegra124_cpufreq_probe(struct platform_device= *pdev) if (ret) goto out_put_pllp_clk; =20 - cpufreq_dt_devinfo.name =3D "cpufreq-dt"; - cpufreq_dt_devinfo.parent =3D &pdev->dev; - - priv->cpufreq_dt_pdev =3D - platform_device_register_full(&cpufreq_dt_devinfo); + priv->cpufreq_dt_pdev =3D cpufreq_dt_pdev_register(&pdev->dev); if (IS_ERR(priv->cpufreq_dt_pdev)) { ret =3D PTR_ERR(priv->cpufreq_dt_pdev); goto out_put_pllp_clk; @@ -173,6 +172,21 @@ static int __maybe_unused tegra124_cpufreq_resume(stru= ct device *dev) return err; } =20 +static void tegra124_cpufreq_remove(struct platform_device *pdev) +{ + struct tegra124_cpufreq_priv *priv =3D dev_get_drvdata(&pdev->dev); + + if (!IS_ERR(priv->cpufreq_dt_pdev)) { + platform_device_unregister(priv->cpufreq_dt_pdev); + priv->cpufreq_dt_pdev =3D ERR_PTR(-ENODEV); + } + + clk_put(priv->pllp_clk); + clk_put(priv->pllx_clk); + clk_put(priv->dfll_clk); + clk_put(priv->cpu_clk); +} + static const struct dev_pm_ops tegra124_cpufreq_pm_ops =3D { SET_SYSTEM_SLEEP_PM_OPS(tegra124_cpufreq_suspend, tegra124_cpufreq_resume) @@ -182,12 +196,12 @@ static struct platform_driver tegra124_cpufreq_platdr= v =3D { .driver.name =3D "cpufreq-tegra124", .driver.pm =3D &tegra124_cpufreq_pm_ops, .probe =3D tegra124_cpufreq_probe, + .remove =3D tegra124_cpufreq_remove, }; =20 static int __init tegra_cpufreq_init(void) { int ret; - struct platform_device *pdev; =20 if (!(of_machine_is_compatible("nvidia,tegra124") || of_machine_is_compatible("nvidia,tegra210"))) @@ -201,15 +215,25 @@ static int __init tegra_cpufreq_init(void) if (ret) return ret; =20 - pdev =3D platform_device_register_simple("cpufreq-tegra124", -1, NULL, 0); - if (IS_ERR(pdev)) { + platform_device =3D platform_device_register_simple("cpufreq-tegra124", -= 1, NULL, 0); + if (IS_ERR(platform_device)) { platform_driver_unregister(&tegra124_cpufreq_platdrv); - return PTR_ERR(pdev); + return PTR_ERR(platform_device); } =20 return 0; } module_init(tegra_cpufreq_init); =20 +static void __exit tegra_cpufreq_module_exit(void) +{ + if (platform_device && !IS_ERR(platform_device)) + platform_device_unregister(platform_device); + + platform_driver_unregister(&tegra124_cpufreq_platdrv); +} +module_exit(tegra_cpufreq_module_exit); + MODULE_AUTHOR("Tuomas Tynkkynen "); MODULE_DESCRIPTION("cpufreq driver for NVIDIA Tegra124"); +MODULE_LICENSE("GPL"); --=20 2.50.0