From d26f05931fb7bcfbd0f64acc692c606fd76bbb3a Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 10 Mar 2023 08:46:55 -0600 Subject: [PATCH 1/6] ARM: OMAP2+: Use of_property_read_bool() for boolean properties It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool(). Signed-off-by: Rob Herring Message-Id: <20230310144655.1540793-1-robh@kernel.org> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/omap_hwmod.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 5a2a9b8e61ed..989195f6f7be 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2322,11 +2322,11 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data, static void __init parse_module_flags(struct omap_hwmod *oh, struct device_node *np) { - if (of_find_property(np, "ti,no-reset-on-init", NULL)) + if (of_property_read_bool(np, "ti,no-reset-on-init")) oh->flags |= HWMOD_INIT_NO_RESET; - if (of_find_property(np, "ti,no-idle-on-init", NULL)) + if (of_property_read_bool(np, "ti,no-idle-on-init")) oh->flags |= HWMOD_INIT_NO_IDLE; - if (of_find_property(np, "ti,no-idle", NULL)) + if (of_property_read_bool(np, "ti,no-idle")) oh->flags |= HWMOD_NO_IDLE; } From 6eaf5d97bb46a625274c84ef4b320a7242630929 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Sun, 19 Mar 2023 11:31:35 -0500 Subject: [PATCH 2/6] ARM: OMAP2+: Use of_address_to_resource() Replace open coded parsing of "reg" with of_address_to_resource(). Signed-off-by: Rob Herring Message-Id: <20230319163135.225076-1-robh@kernel.org> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/omap_hwmod.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 989195f6f7be..de3fd0bc862d 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -706,9 +706,7 @@ static const struct of_device_id ti_clkctrl_match_table[] __initconst = { static int __init _setup_clkctrl_provider(struct device_node *np) { - const __be32 *addrp; struct clkctrl_provider *provider; - u64 size; int i; provider = memblock_alloc(sizeof(*provider), SMP_CACHE_BYTES); @@ -717,8 +715,7 @@ static int __init _setup_clkctrl_provider(struct device_node *np) provider->node = np; - provider->num_addrs = - of_property_count_elems_of_size(np, "reg", sizeof(u32)) / 2; + provider->num_addrs = of_address_count(np); provider->addr = memblock_alloc(sizeof(void *) * provider->num_addrs, @@ -733,11 +730,11 @@ static int __init _setup_clkctrl_provider(struct device_node *np) return -ENOMEM; for (i = 0; i < provider->num_addrs; i++) { - addrp = of_get_address(np, i, &size, NULL); - provider->addr[i] = (u32)of_translate_address(np, addrp); - provider->size[i] = size; - pr_debug("%s: %pOF: %x...%x\n", __func__, np, provider->addr[i], - provider->addr[i] + provider->size[i]); + struct resource res; + of_address_to_resource(np, i, &res); + provider->addr[i] = res.start; + provider->size[i] = resource_size(&res); + pr_debug("%s: %pOF: %pR\n", __func__, np, &res); } list_add(&provider->link, &clkctrl_providers); From 977f54705e99b92779f2bfac2597b967772b1b16 Mon Sep 17 00:00:00 2001 From: Lukas Bulwahn Date: Mon, 20 Mar 2023 09:38:06 +0100 Subject: [PATCH 3/6] ARM: OMAP2+: remove obsolete config OMAP3_SDRC_AC_TIMING Commit d42f265a5d7a ("ARM: OMAP3: clock: remove un-used core dpll re-program code") removes arch/arm/mach-omap2/sram34xx.S, which implemented the effect of the config OMAP3_SDRC_AC_TIMING. Since then, the OMAP3_SDRC_AC_TIMING config was hanging around without effect. Remove this obsolete config. Signed-off-by: Lukas Bulwahn Message-Id: <20230320083806.9545-1-lukas.bulwahn@gmail.com> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/Kconfig | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 3b53dda9ec79..821727eefd5a 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -255,17 +255,6 @@ config MACH_NOKIA_N8X0 select MACH_NOKIA_N810 select MACH_NOKIA_N810_WIMAX -config OMAP3_SDRC_AC_TIMING - bool "Enable SDRC AC timing register changes" - depends on ARCH_OMAP3 - help - If you know that none of your system initiators will attempt to - access SDRAM during CORE DVFS, select Y here. This should boost - SDRAM performance at lower CORE OPPs. There are relatively few - users who will wish to say yes at this point - almost everyone will - wish to say no. Selecting yes without understanding what is - going on could result in system crashes; - endmenu endif From 31006a885118ef7eb18f865f5ff615fb31868bfe Mon Sep 17 00:00:00 2001 From: Jilin Yuan Date: Wed, 14 Sep 2022 16:43:15 +0800 Subject: [PATCH 4/6] ARM: OMAP2+: fix repeated words in comments Delete the redundant word 'from'. Signed-off-by: Jilin Yuan Message-Id: <20220914084315.40165-1-yuanjilin@cdjrlc.com> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/cm33xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c index d61fa06117b4..c824d4e3db63 100644 --- a/arch/arm/mach-omap2/cm33xx.c +++ b/arch/arm/mach-omap2/cm33xx.c @@ -5,7 +5,7 @@ * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/ * Vaibhav Hiremath * - * Reference taken from from OMAP4 cminst44xx.c + * Reference taken from OMAP4 cminst44xx.c */ #include From 89e990559c378e06d2b2ef4f5dd6e963795cb7d8 Mon Sep 17 00:00:00 2001 From: ye xingchen Date: Tue, 20 Sep 2022 06:51:13 +0000 Subject: [PATCH 5/6] ARM: OMAP2+: Remove the unneeded result variable Return the value amx3_common_init() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: ye xingchen Message-Id: <20220920065113.215685-1-ye.xingchen@zte.com.cn> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/pm33xx-core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/pm33xx-core.c b/arch/arm/mach-omap2/pm33xx-core.c index 711bcc6c8ddd..c907478be196 100644 --- a/arch/arm/mach-omap2/pm33xx-core.c +++ b/arch/arm/mach-omap2/pm33xx-core.c @@ -104,8 +104,6 @@ static int amx3_common_init(int (*idle)(u32 wfi_flags)) static int am33xx_suspend_init(int (*idle)(u32 wfi_flags)) { - int ret; - gfx_l4ls_clkdm = clkdm_lookup("gfx_l4ls_gfx_clkdm"); if (!gfx_l4ls_clkdm) { @@ -113,9 +111,7 @@ static int am33xx_suspend_init(int (*idle)(u32 wfi_flags)) return -ENODEV; } - ret = amx3_common_init(idle); - - return ret; + return amx3_common_init(idle); } static int am43xx_suspend_init(int (*idle)(u32 wfi_flags)) From 19050da1d1057a7bc73fd9039f94b7f63a00e54e Mon Sep 17 00:00:00 2001 From: Kenneth Lee Date: Tue, 9 Aug 2022 00:20:50 -0700 Subject: [PATCH 6/6] ARM: OMAP2+: hwmod: Use kzalloc for allocating only one element Use kzalloc(...) rather than kcalloc(1, ...) because the number of elements we are specifying in this case is 1, so kzalloc would accomplish the same thing and we can simplify. Signed-off-by: Kenneth Lee Message-Id: <20220809072050.1733996-1-klee33@uw.edu> Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/omap_hwmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index de3fd0bc862d..aac4c4ee2528 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -3454,7 +3454,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, } if (list_empty(&oh->slave_ports)) { - oi = kcalloc(1, sizeof(*oi), GFP_KERNEL); + oi = kzalloc(sizeof(*oi), GFP_KERNEL); if (!oi) goto out_free_class;