Skip to content

Commit 3292e5a

Browse files
committed
Merge tag 'memory-controller-drv-6.14' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers
Memory controller drivers for v6.14 1. OMAP GPMC: Cleanup dead code. 2. Tegra20 EMC: Fix OF reference counting when iterating over emc-tables. * tag 'memory-controller-drv-6.14' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: tegra20-emc: fix an OF node reference bug in tegra_emc_find_node_by_ram_code() memory: omap-gpmc: deadcode a pair of functions Link: https://lore.kernel.org/r/20241231133534.136771-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 384727c + b9784e5 commit 3292e5a

3 files changed

Lines changed: 11 additions & 34 deletions

File tree

drivers/memory/omap-gpmc.c

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -358,17 +358,6 @@ static unsigned int gpmc_ps_to_ticks(unsigned int time_ps)
358358
return (time_ps + tick_ps - 1) / tick_ps;
359359
}
360360

361-
static unsigned int gpmc_clk_ticks_to_ns(unsigned int ticks, int cs,
362-
enum gpmc_clk_domain cd)
363-
{
364-
return ticks * gpmc_get_clk_period(cs, cd) / 1000;
365-
}
366-
367-
unsigned int gpmc_ticks_to_ns(unsigned int ticks)
368-
{
369-
return gpmc_clk_ticks_to_ns(ticks, /* any CS */ 0, GPMC_CD_FCLK);
370-
}
371-
372361
static unsigned int gpmc_ticks_to_ps(unsigned int ticks)
373362
{
374363
return ticks * gpmc_get_fclk_period();
@@ -415,6 +404,13 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p)
415404
}
416405

417406
#ifdef CONFIG_OMAP_GPMC_DEBUG
407+
408+
static unsigned int gpmc_clk_ticks_to_ns(unsigned int ticks, int cs,
409+
enum gpmc_clk_domain cd)
410+
{
411+
return ticks * gpmc_get_clk_period(cs, cd) / 1000;
412+
}
413+
418414
/**
419415
* get_gpmc_timing_reg - read a timing parameter and print DTS settings for it.
420416
* @cs: Chip Select Region
@@ -1295,21 +1291,6 @@ int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq,
12951291
}
12961292
EXPORT_SYMBOL_GPL(gpmc_omap_onenand_set_timings);
12971293

1298-
int gpmc_get_client_irq(unsigned int irq_config)
1299-
{
1300-
if (!gpmc_irq_domain) {
1301-
pr_warn("%s called before GPMC IRQ domain available\n",
1302-
__func__);
1303-
return 0;
1304-
}
1305-
1306-
/* we restrict this to NAND IRQs only */
1307-
if (irq_config >= GPMC_NR_NAND_IRQS)
1308-
return 0;
1309-
1310-
return irq_create_mapping(gpmc_irq_domain, irq_config);
1311-
}
1312-
13131294
static int gpmc_irq_endis(unsigned long hwirq, bool endis)
13141295
{
13151296
u32 regval;

drivers/memory/tegra/tegra20-emc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,15 @@ tegra_emc_find_node_by_ram_code(struct tegra_emc *emc)
474474

475475
ram_code = tegra_read_ram_code();
476476

477-
for (np = of_find_node_by_name(dev->of_node, "emc-tables"); np;
478-
np = of_find_node_by_name(np, "emc-tables")) {
477+
for_each_child_of_node(dev->of_node, np) {
478+
if (!of_node_name_eq(np, "emc-tables"))
479+
continue;
479480
err = of_property_read_u32(np, "nvidia,ram-code", &value);
480481
if (err || value != ram_code) {
481482
struct device_node *lpddr2_np;
482483
bool cfg_mismatches = false;
483484

484-
lpddr2_np = of_find_node_by_name(np, "lpddr2");
485+
lpddr2_np = of_get_child_by_name(np, "lpddr2");
485486
if (lpddr2_np) {
486487
const struct lpddr2_info *info;
487488

@@ -518,7 +519,6 @@ tegra_emc_find_node_by_ram_code(struct tegra_emc *emc)
518519
}
519520

520521
if (cfg_mismatches) {
521-
of_node_put(np);
522522
continue;
523523
}
524524
}

include/linux/omap-gpmc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
6666

6767
struct device_node;
6868

69-
extern int gpmc_get_client_irq(unsigned irq_config);
70-
71-
extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
72-
7369
extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
7470
extern int gpmc_calc_divider(unsigned int sync_clk);
7571
extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,

0 commit comments

Comments
 (0)