[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250910-memory-tegra-cleanup-v1-10-023c33a2d997@linaro.org>
Date: Wed, 10 Sep 2025 12:44:06 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Krzysztof Kozlowski <krzk@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>
Cc: linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org,
Aaron Kling <webgeek1234@...il.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Subject: [PATCH 10/13] memory: tegra124-emc: Add the SoC model prefix to
functions
Replace "tegra_emc" with "tegra124_emc" in all functions to:
1. Avoid name clashing with other Tegra EMC drivers which makes it
easier to jump to function definitions,
2. Decode the calltraces a bit easier,
3. Unify with other Tegra MC and EMC drivers, which use the SoC model
prefixes.
No functional impact.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
---
drivers/memory/tegra/tegra124-emc.c | 98 ++++++++++++++++++-------------------
1 file changed, 49 insertions(+), 49 deletions(-)
diff --git a/drivers/memory/tegra/tegra124-emc.c b/drivers/memory/tegra/tegra124-emc.c
index f4d703103d9ca155eca92331ee762cecd4e01302..9978ff911c4790b30423064c8fe0d3d53e8efcef 100644
--- a/drivers/memory/tegra/tegra124-emc.c
+++ b/drivers/memory/tegra/tegra124-emc.c
@@ -571,8 +571,8 @@ static void emc_seq_wait_clkchange(struct tegra_emc *emc)
dev_err(emc->dev, "clock change timed out\n");
}
-static struct emc_timing *tegra_emc_find_timing(struct tegra_emc *emc,
- unsigned long rate)
+static struct emc_timing *tegra124_emc_find_timing(struct tegra_emc *emc,
+ unsigned long rate)
{
struct emc_timing *timing = NULL;
unsigned int i;
@@ -592,10 +592,10 @@ static struct emc_timing *tegra_emc_find_timing(struct tegra_emc *emc,
return timing;
}
-static int tegra_emc_prepare_timing_change(struct tegra_emc *emc,
- unsigned long rate)
+static int tegra124_emc_prepare_timing_change(struct tegra_emc *emc,
+ unsigned long rate)
{
- struct emc_timing *timing = tegra_emc_find_timing(emc, rate);
+ struct emc_timing *timing = tegra124_emc_find_timing(emc, rate);
struct emc_timing *last = &emc->last_timing;
enum emc_dll_change dll_change;
unsigned int pre_wait = 0;
@@ -820,10 +820,10 @@ static int tegra_emc_prepare_timing_change(struct tegra_emc *emc,
return 0;
}
-static void tegra_emc_complete_timing_change(struct tegra_emc *emc,
- unsigned long rate)
+static void tegra124_emc_complete_timing_change(struct tegra_emc *emc,
+ unsigned long rate)
{
- struct emc_timing *timing = tegra_emc_find_timing(emc, rate);
+ struct emc_timing *timing = tegra124_emc_find_timing(emc, rate);
struct emc_timing *last = &emc->last_timing;
u32 val;
@@ -986,8 +986,8 @@ static int cmp_timings(const void *_a, const void *_b)
return 1;
}
-static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc,
- struct device_node *node)
+static int tegra124_emc_load_timings_from_dt(struct tegra_emc *emc,
+ struct device_node *node)
{
int child_count = of_get_child_count(node);
struct emc_timing *timing;
@@ -1015,15 +1015,15 @@ static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc,
return 0;
}
-static const struct of_device_id tegra_emc_of_match[] = {
+static const struct of_device_id tegra124_emc_of_match[] = {
{ .compatible = "nvidia,tegra124-emc" },
{ .compatible = "nvidia,tegra132-emc" },
{}
};
-MODULE_DEVICE_TABLE(of, tegra_emc_of_match);
+MODULE_DEVICE_TABLE(of, tegra124_emc_of_match);
static struct device_node *
-tegra_emc_find_node_by_ram_code(struct device_node *node, u32 ram_code)
+tegra124_emc_find_node_by_ram_code(struct device_node *node, u32 ram_code)
{
struct device_node *np;
int err;
@@ -1041,7 +1041,7 @@ tegra_emc_find_node_by_ram_code(struct device_node *node, u32 ram_code)
return NULL;
}
-static void tegra_emc_rate_requests_init(struct tegra_emc *emc)
+static void tegra124_emc_rate_requests_init(struct tegra_emc *emc)
{
unsigned int i;
@@ -1143,7 +1143,7 @@ static int emc_set_max_rate(struct tegra_emc *emc, unsigned long rate,
* valid range.
*/
-static bool tegra_emc_validate_rate(struct tegra_emc *emc, unsigned long rate)
+static bool tegra124_emc_validate_rate(struct tegra_emc *emc, unsigned long rate)
{
unsigned int i;
@@ -1154,8 +1154,8 @@ static bool tegra_emc_validate_rate(struct tegra_emc *emc, unsigned long rate)
return false;
}
-static int tegra_emc_debug_available_rates_show(struct seq_file *s,
- void *data)
+static int tegra124_emc_debug_available_rates_show(struct seq_file *s,
+ void *data)
{
struct tegra_emc *emc = s->private;
const char *prefix = "";
@@ -1171,9 +1171,9 @@ static int tegra_emc_debug_available_rates_show(struct seq_file *s,
return 0;
}
-DEFINE_SHOW_ATTRIBUTE(tegra_emc_debug_available_rates);
+DEFINE_SHOW_ATTRIBUTE(tegra124_emc_debug_available_rates);
-static int tegra_emc_debug_min_rate_get(void *data, u64 *rate)
+static int tegra124_emc_debug_min_rate_get(void *data, u64 *rate)
{
struct tegra_emc *emc = data;
@@ -1182,12 +1182,12 @@ static int tegra_emc_debug_min_rate_get(void *data, u64 *rate)
return 0;
}
-static int tegra_emc_debug_min_rate_set(void *data, u64 rate)
+static int tegra124_emc_debug_min_rate_set(void *data, u64 rate)
{
struct tegra_emc *emc = data;
int err;
- if (!tegra_emc_validate_rate(emc, rate))
+ if (!tegra124_emc_validate_rate(emc, rate))
return -EINVAL;
err = emc_set_min_rate(emc, rate, EMC_RATE_DEBUG);
@@ -1199,11 +1199,11 @@ static int tegra_emc_debug_min_rate_set(void *data, u64 rate)
return 0;
}
-DEFINE_DEBUGFS_ATTRIBUTE(tegra_emc_debug_min_rate_fops,
- tegra_emc_debug_min_rate_get,
- tegra_emc_debug_min_rate_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(tegra124_emc_debug_min_rate_fops,
+ tegra124_emc_debug_min_rate_get,
+ tegra124_emc_debug_min_rate_set, "%llu\n");
-static int tegra_emc_debug_max_rate_get(void *data, u64 *rate)
+static int tegra124_emc_debug_max_rate_get(void *data, u64 *rate)
{
struct tegra_emc *emc = data;
@@ -1212,12 +1212,12 @@ static int tegra_emc_debug_max_rate_get(void *data, u64 *rate)
return 0;
}
-static int tegra_emc_debug_max_rate_set(void *data, u64 rate)
+static int tegra124_emc_debug_max_rate_set(void *data, u64 rate)
{
struct tegra_emc *emc = data;
int err;
- if (!tegra_emc_validate_rate(emc, rate))
+ if (!tegra124_emc_validate_rate(emc, rate))
return -EINVAL;
err = emc_set_max_rate(emc, rate, EMC_RATE_DEBUG);
@@ -1229,9 +1229,9 @@ static int tegra_emc_debug_max_rate_set(void *data, u64 rate)
return 0;
}
-DEFINE_DEBUGFS_ATTRIBUTE(tegra_emc_debug_max_rate_fops,
- tegra_emc_debug_max_rate_get,
- tegra_emc_debug_max_rate_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(tegra124_emc_debug_max_rate_fops,
+ tegra124_emc_debug_max_rate_get,
+ tegra124_emc_debug_max_rate_set, "%llu\n");
static void emc_debugfs_init(struct device *dev, struct tegra_emc *emc)
{
@@ -1266,11 +1266,11 @@ static void emc_debugfs_init(struct device *dev, struct tegra_emc *emc)
emc->debugfs.root = debugfs_create_dir("emc", NULL);
debugfs_create_file("available_rates", 0444, emc->debugfs.root, emc,
- &tegra_emc_debug_available_rates_fops);
+ &tegra124_emc_debug_available_rates_fops);
debugfs_create_file("min_rate", 0644, emc->debugfs.root,
- emc, &tegra_emc_debug_min_rate_fops);
+ emc, &tegra124_emc_debug_min_rate_fops);
debugfs_create_file("max_rate", 0644, emc->debugfs.root,
- emc, &tegra_emc_debug_max_rate_fops);
+ emc, &tegra124_emc_debug_max_rate_fops);
}
static inline struct tegra_emc *
@@ -1334,7 +1334,7 @@ static int emc_icc_set(struct icc_node *src, struct icc_node *dst)
return 0;
}
-static int tegra_emc_interconnect_init(struct tegra_emc *emc)
+static int tegra124_emc_interconnect_init(struct tegra_emc *emc)
{
const struct tegra_mc_soc *soc = emc->mc->soc;
struct icc_node *node;
@@ -1383,7 +1383,7 @@ static int tegra_emc_interconnect_init(struct tegra_emc *emc)
return dev_err_probe(emc->dev, err, "failed to initialize ICC\n");
}
-static int tegra_emc_opp_table_init(struct tegra_emc *emc)
+static int tegra124_emc_opp_table_init(struct tegra_emc *emc)
{
u32 hw_version = BIT(tegra_sku_info.soc_speedo_id);
int opp_token, err;
@@ -1425,12 +1425,12 @@ static int tegra_emc_opp_table_init(struct tegra_emc *emc)
return err;
}
-static void devm_tegra_emc_unset_callback(void *data)
+static void devm_tegra124_emc_unset_callback(void *data)
{
tegra124_clk_set_emc_callbacks(NULL, NULL);
}
-static int tegra_emc_probe(struct platform_device *pdev)
+static int tegra124_emc_probe(struct platform_device *pdev)
{
struct device_node *np;
struct tegra_emc *emc;
@@ -1454,9 +1454,9 @@ static int tegra_emc_probe(struct platform_device *pdev)
ram_code = tegra_read_ram_code();
- np = tegra_emc_find_node_by_ram_code(pdev->dev.of_node, ram_code);
+ np = tegra124_emc_find_node_by_ram_code(pdev->dev.of_node, ram_code);
if (np) {
- err = tegra_emc_load_timings_from_dt(emc, np);
+ err = tegra124_emc_load_timings_from_dt(emc, np);
of_node_put(np);
if (err)
return err;
@@ -1470,10 +1470,10 @@ static int tegra_emc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, emc);
- tegra124_clk_set_emc_callbacks(tegra_emc_prepare_timing_change,
- tegra_emc_complete_timing_change);
+ tegra124_clk_set_emc_callbacks(tegra124_emc_prepare_timing_change,
+ tegra124_emc_complete_timing_change);
- err = devm_add_action_or_reset(&pdev->dev, devm_tegra_emc_unset_callback,
+ err = devm_add_action_or_reset(&pdev->dev, devm_tegra124_emc_unset_callback,
NULL);
if (err)
return err;
@@ -1483,16 +1483,16 @@ static int tegra_emc_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, PTR_ERR(emc->clk),
"failed to get EMC clock\n");
- err = tegra_emc_opp_table_init(emc);
+ err = tegra124_emc_opp_table_init(emc);
if (err)
return err;
- tegra_emc_rate_requests_init(emc);
+ tegra124_emc_rate_requests_init(emc);
if (IS_ENABLED(CONFIG_DEBUG_FS))
emc_debugfs_init(&pdev->dev, emc);
- tegra_emc_interconnect_init(emc);
+ tegra124_emc_interconnect_init(emc);
/*
* Don't allow the kernel module to be unloaded. Unloading adds some
@@ -1504,16 +1504,16 @@ static int tegra_emc_probe(struct platform_device *pdev)
return 0;
};
-static struct platform_driver tegra_emc_driver = {
- .probe = tegra_emc_probe,
+static struct platform_driver tegra124_emc_driver = {
+ .probe = tegra124_emc_probe,
.driver = {
.name = "tegra-emc",
- .of_match_table = tegra_emc_of_match,
+ .of_match_table = tegra124_emc_of_match,
.suppress_bind_attrs = true,
.sync_state = icc_sync_state,
},
};
-module_platform_driver(tegra_emc_driver);
+module_platform_driver(tegra124_emc_driver);
MODULE_AUTHOR("Mikko Perttunen <mperttunen@...dia.com>");
MODULE_DESCRIPTION("NVIDIA Tegra124 EMC driver");
--
2.48.1
Powered by blists - more mailing lists