From nobody Tue Oct 7 18:23:15 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 84FC2285CB3; Mon, 7 Jul 2025 21:17:20 +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=1751923040; cv=none; b=nZ4JkzP4RU45UYDaFsajgFW6PwbREdzIYwNCg1cCXr1ZxuF2vz8uze2BOeh0NYgLMvtDjXV3OtRq5SreZE4GEvl7qBidK+A3SVGOX9SmidyUG0IArgo0l2Ykjbzg4eIejU0hpRsSjn2C/nyUchHQWXF0gcjc/Dm5aZKnr6W89B0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751923040; c=relaxed/simple; bh=XUqrxevcySUgm7p5WtPmWVKyUTemkuPq3v/8JCmiCIk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cVhJX+Tc2tI3V0Op/OWEtyGGWA4Muzf/FULNghCmLEoBQye1Fj/zrkP0O+DITj2b6dfeYnjBLHipfB+NNMPdxnXFQ1RmIEmuMx02PjKTTCRIAUR+mbNJfqBewB+7ZLvUlx2qMX9MBhzc4jBoMJHd2fE5OIZGC27MLgJisYmSn4c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BmuBv55P; 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="BmuBv55P" Received: by smtp.kernel.org (Postfix) with ESMTPS id 25CCEC4CEF1; Mon, 7 Jul 2025 21:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751923040; bh=XUqrxevcySUgm7p5WtPmWVKyUTemkuPq3v/8JCmiCIk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=BmuBv55PvgbYzuUKw+KxCe73ssXdUEZvdcR4DN4i3yxSl8qOg3t4SNxF+52IDIZmu ADdww0aiAAgQ2btC3P5ZuUk1cnfOzycA+uaLyKDikqI4YEae3wcsnD9KBBYzh1t2A5 ICCCjQKyefx+mBQYLpKCHp/peORB4Gw1DOqGmWLvoMkKU4rNHTnTcud69uVq309J8b 3w7Aj8ghfN/e674jqcVwD2OmnhK/LonT/LcOfTnnAgRRvajjPog89PlwhbZAf5i4OQ tFOYQ47EECiavNN5hP/HNY9nnX8mtgWzhFSuI1anMpbMbrCFLAwTEB4SHTv0wkEoAe X/BsHHvpNTiKw== 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 148BAC83030; Mon, 7 Jul 2025 21:17:20 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Mon, 07 Jul 2025 16:17:13 -0500 Subject: [PATCH v6 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: <20250707-tegra124-cpufreq-v6-1-fe69c0f9bbab@gmail.com> References: <20250707-tegra124-cpufreq-v6-0-fe69c0f9bbab@gmail.com> In-Reply-To: <20250707-tegra124-cpufreq-v6-0-fe69c0f9bbab@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=1751923039; l=614; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=NFHbo8ZLsnmTINee5fdPYY+g47zvEQ1GnvuQon0Ga54=; b=SYN1C3omppLTHmdh/N3jYvRNM8zPPiu4wxHYor/Ky6k+sIPYa4crIEGfGSX57vy0vWPOK/foB gQ9x/Dj5oIdBijvZaiyJm9kq2v+uDeC4ISAuyxTqTnU2IkMzcLzjEpy 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 Acked-by: Rafael J. Wysocki --- 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 Tue Oct 7 18:23:15 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 96C81285CB6; Mon, 7 Jul 2025 21:17:20 +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=1751923040; cv=none; b=mF6K6Uj9+bl26DEVamAsHD03HWuR5BYmgw82wmVhTgQ2BcqCEy8OxABfbueJ86yZfZSKCDUxGzmiggdQZJVTeEoD4mbzUzkKVKvKzKoko++d9rMcqAfapw2KcpH8cwghYzfP2UmurRNvMSoWea/W6wUeknY9S4JVF05NoYJsbEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751923040; c=relaxed/simple; bh=UPGQs6o7IxPKQ3JcTYGvuyxfO5biIaF57rUkGXslPb4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qABlGG5mrG5gwtBba03Dn/XX171YXmcaqggMu+U8a2mb6AZQIhOGpWK4dRljPvRzsFt5P0glmBAN6dzkugCZEkXc02quO3WeUjP7pFBsWsZRLB6QcabYkZSJtaKLuNTmUSNXx5VlOhMKOCYt6v5j1g8LfyMBCLdgxlW5d5r8KCg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jI+O4Fzf; 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="jI+O4Fzf" Received: by smtp.kernel.org (Postfix) with ESMTPS id 34700C4CEEF; Mon, 7 Jul 2025 21:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751923040; bh=UPGQs6o7IxPKQ3JcTYGvuyxfO5biIaF57rUkGXslPb4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jI+O4Fzf04vU2gDgfER/7R1fMRzltZP00uVSXVytd4drz/e69Z2rXedxJwEKGF0Xf cE25CfrJyL7aIGB8niQwQzIlUGO+d3L3UYP+eI5KdQPP3b0fk8himFI2D/AksjN58a BVcSmvFaLNi8VvAN8hxO+7M4ufIpCBKPqUfXtra221LRwnZQpfNnmUq6wFAEkPqMGQ zbe9dR91KoumfSozI6uF34D4/XWO0iWbR7uxvquN5GAFWLtmcnzbqdN+zjKyrt7yOD hmJyYYoj8skFCzYVwZZRR0BXDxg+o69GxtaedrszUy977UKcjbsKXZnSTNYvcVSfup B1mz230bq4WJg== 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 22EE3C83F0A; Mon, 7 Jul 2025 21:17:20 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Mon, 07 Jul 2025 16:17:14 -0500 Subject: [PATCH v6 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: <20250707-tegra124-cpufreq-v6-2-fe69c0f9bbab@gmail.com> References: <20250707-tegra124-cpufreq-v6-0-fe69c0f9bbab@gmail.com> In-Reply-To: <20250707-tegra124-cpufreq-v6-0-fe69c0f9bbab@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=1751923039; l=1698; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=o7BSnjiEeAr40p8PQoKLMNpDwUQoKoaMMFdZbO3EPoY=; b=wXWLmy6jc3k4OJng0097xSiNPXWyA0flXotAsiuNhuR+74Ab7gz0CiykHDD4jteSMI7q1Qgcq 1/bp4h/blJ1Dx96SKgvPmhzQTaeL9Axr4vljJ+lI7S3hfO5xrMFt7Ga 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 Tue Oct 7 18:23:15 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 B56BD286D7F; Mon, 7 Jul 2025 21:17:20 +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=1751923040; cv=none; b=CApgXc4GqEXo5VFyHes0vy4+uX8jQMYe97c0q4j2y25jm7o0Z4zD3kr393DQ5ltuxLJ5qMztYYyno83LtE23Y06AkHrZHyXErnkbfSqaaVf8fgwA9XDjOCZX8frXxNJOXsAxTvGEtyNb5FRgY38YPXxyIGZ0vf8zasySOMIc/F4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751923040; c=relaxed/simple; bh=1stkMTJ1H5HREcQraMTxwxe87w8rCjp9IH3zgVqmKsc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fb6tXtd3aqWpGpR3yhD0AxxsEL+noC7F27Q3BVTOXMGH4jHKHkv4ga0GLIQm/Zr27Js0usQJRB97YTn3s1J5Us1Ar+c3dWMOnwsEqJEKcfvBx+sQeYI9+LUJkhqOd4s/nNPofvZHhgRGhLgo1lK/3gYoQBcfZZqKiJiqDQFfijM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uPmtZGiU; 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="uPmtZGiU" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3C185C4CEF8; Mon, 7 Jul 2025 21:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751923040; bh=1stkMTJ1H5HREcQraMTxwxe87w8rCjp9IH3zgVqmKsc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uPmtZGiUsN/f343+DjjqSWq73PKErgdDg+mvKswVXJOMAIRd9imOR4apQiAK0+Q3m HS+PqrlRjldihVbFzpQmTH3R1HbE42bPZYnPmj44riT/22wbXKA0bmsT0vcdVVk2WB UkCM6kH0aRWOKeBF5s8pQffHE1lKt3VVeSroyHGeD6vdRhJvABvv4dT3j1gYb4uCm1 FQG2kds8hoesr9A5zpQ4Lo00dQwxn0y8DfUGthnPrh9vM/kZZMCFw2NJCReooQur7m a54zGeKQEGHQKvbe2PkvjSX4ubIbbhqILtUyIy0sJRQoTcI9/fLG/eUeAwrUjNdUom MnTzk5y5OQfsg== 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 3301CC71130; Mon, 7 Jul 2025 21:17:20 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Mon, 07 Jul 2025 16:17:15 -0500 Subject: [PATCH v6 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: <20250707-tegra124-cpufreq-v6-3-fe69c0f9bbab@gmail.com> References: <20250707-tegra124-cpufreq-v6-0-fe69c0f9bbab@gmail.com> In-Reply-To: <20250707-tegra124-cpufreq-v6-0-fe69c0f9bbab@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=1751923039; l=4409; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=ZKgE/EyIvhxsmDDP8cQEfrMMLR3Gs2c7Yzk8IoNf/gU=; b=6bjn+2RLCediVwC+wZESfmF16dryHZKRdOf6L2BL+5DI01hEAww/CxGJ2zmSC5nchrKLwGGf7 c3O9fTdC55YDWoelMjR/RaC49B7i6hYwYSYTqspdSy5ncoKwEc9AdaR 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 four 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 * Populating module license 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..b8bccde8b298a4920bfe6dc0d4c= 4a92704ecfcf5 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 *tegra124_cpufreq_pdev; + 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)) { + tegra124_cpufreq_pdev =3D platform_device_register_simple("cpufreq-tegra1= 24", -1, NULL, 0); + if (IS_ERR(tegra124_cpufreq_pdev)) { platform_driver_unregister(&tegra124_cpufreq_platdrv); - return PTR_ERR(pdev); + return PTR_ERR(tegra124_cpufreq_pdev); } =20 return 0; } module_init(tegra_cpufreq_init); =20 +static void __exit tegra_cpufreq_module_exit(void) +{ + if (!IS_ERR_OR_NULL(tegra124_cpufreq_pdev)) + platform_device_unregister(tegra124_cpufreq_pdev); + + 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