Commit 31216ef5 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'omap-for-v5.11/soc-signed' of...

Merge tag 'omap-for-v5.11/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/soc

SoC changes for omaps for v5.11 merge window:

Several non-urgent fixes for various issues found by automated tests.
So far we have not been hitting any of these so these can wait for the
merge window no problem.

* tag 'omap-for-v5.11/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP1: clock: Use IS_ERR_OR_NULL() to clean code
  ARM: OMAP2+: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare
  ARM: OMAP2+: Remove redundant assignment to variable ret
  ARM: OMAP2+: Fix kfree NULL pointer in omap2xxx_clkt_vps_init
  ARM: OMAP2+: Fix memleak in omap2xxx_clkt_vps_init

Link: https://lore.kernel.org/r/pull-1606462656-588116@atomide.comSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 418baf2c 2e023b93
...@@ -612,7 +612,7 @@ int clk_enable(struct clk *clk) ...@@ -612,7 +612,7 @@ int clk_enable(struct clk *clk)
unsigned long flags; unsigned long flags;
int ret; int ret;
if (clk == NULL || IS_ERR(clk)) if (IS_ERR_OR_NULL(clk))
return -EINVAL; return -EINVAL;
spin_lock_irqsave(&clockfw_lock, flags); spin_lock_irqsave(&clockfw_lock, flags);
...@@ -627,7 +627,7 @@ void clk_disable(struct clk *clk) ...@@ -627,7 +627,7 @@ void clk_disable(struct clk *clk)
{ {
unsigned long flags; unsigned long flags;
if (clk == NULL || IS_ERR(clk)) if (IS_ERR_OR_NULL(clk))
return; return;
spin_lock_irqsave(&clockfw_lock, flags); spin_lock_irqsave(&clockfw_lock, flags);
...@@ -650,7 +650,7 @@ unsigned long clk_get_rate(struct clk *clk) ...@@ -650,7 +650,7 @@ unsigned long clk_get_rate(struct clk *clk)
unsigned long flags; unsigned long flags;
unsigned long ret; unsigned long ret;
if (clk == NULL || IS_ERR(clk)) if (IS_ERR_OR_NULL(clk))
return 0; return 0;
spin_lock_irqsave(&clockfw_lock, flags); spin_lock_irqsave(&clockfw_lock, flags);
...@@ -670,7 +670,7 @@ long clk_round_rate(struct clk *clk, unsigned long rate) ...@@ -670,7 +670,7 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
unsigned long flags; unsigned long flags;
long ret; long ret;
if (clk == NULL || IS_ERR(clk)) if (IS_ERR_OR_NULL(clk))
return 0; return 0;
spin_lock_irqsave(&clockfw_lock, flags); spin_lock_irqsave(&clockfw_lock, flags);
...@@ -686,7 +686,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate) ...@@ -686,7 +686,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
unsigned long flags; unsigned long flags;
int ret = -EINVAL; int ret = -EINVAL;
if (clk == NULL || IS_ERR(clk)) if (IS_ERR_OR_NULL(clk))
return ret; return ret;
spin_lock_irqsave(&clockfw_lock, flags); spin_lock_irqsave(&clockfw_lock, flags);
...@@ -791,7 +791,7 @@ void clk_preinit(struct clk *clk) ...@@ -791,7 +791,7 @@ void clk_preinit(struct clk *clk)
int clk_register(struct clk *clk) int clk_register(struct clk *clk)
{ {
if (clk == NULL || IS_ERR(clk)) if (IS_ERR_OR_NULL(clk))
return -EINVAL; return -EINVAL;
/* /*
...@@ -817,7 +817,7 @@ EXPORT_SYMBOL(clk_register); ...@@ -817,7 +817,7 @@ EXPORT_SYMBOL(clk_register);
void clk_unregister(struct clk *clk) void clk_unregister(struct clk *clk)
{ {
if (clk == NULL || IS_ERR(clk)) if (IS_ERR_OR_NULL(clk))
return; return;
mutex_lock(&clocks_mutex); mutex_lock(&clocks_mutex);
......
...@@ -235,7 +235,7 @@ void omap2xxx_clkt_vps_init(void) ...@@ -235,7 +235,7 @@ void omap2xxx_clkt_vps_init(void)
hw = kzalloc(sizeof(*hw), GFP_KERNEL); hw = kzalloc(sizeof(*hw), GFP_KERNEL);
if (!hw) if (!hw)
goto cleanup; return;
init.name = "virt_prcm_set"; init.name = "virt_prcm_set";
init.ops = &virt_prcm_set_ops; init.ops = &virt_prcm_set_ops;
init.parent_names = &parent_name; init.parent_names = &parent_name;
...@@ -244,9 +244,12 @@ void omap2xxx_clkt_vps_init(void) ...@@ -244,9 +244,12 @@ void omap2xxx_clkt_vps_init(void)
hw->hw.init = &init; hw->hw.init = &init;
clk = clk_register(NULL, &hw->hw); clk = clk_register(NULL, &hw->hw);
if (IS_ERR(clk)) {
printk(KERN_ERR "Failed to register clock\n");
kfree(hw);
return;
}
clkdev_create(clk, "cpufreq_ck", NULL); clkdev_create(clk, "cpufreq_ck", NULL);
return;
cleanup:
kfree(hw);
} }
#endif #endif
...@@ -385,8 +385,7 @@ int omap_dss_reset(struct omap_hwmod *oh) ...@@ -385,8 +385,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
} }
for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
if (oc->_clk) clk_prepare_enable(oc->_clk);
clk_prepare_enable(oc->_clk);
dispc_disable_outputs(); dispc_disable_outputs();
...@@ -412,8 +411,7 @@ int omap_dss_reset(struct omap_hwmod *oh) ...@@ -412,8 +411,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
pr_debug("dss_core: softreset done\n"); pr_debug("dss_core: softreset done\n");
for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
if (oc->_clk) clk_disable_unprepare(oc->_clk);
clk_disable_unprepare(oc->_clk);
r = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0; r = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0;
......
...@@ -334,10 +334,9 @@ struct omap_device *omap_device_alloc(struct platform_device *pdev, ...@@ -334,10 +334,9 @@ struct omap_device *omap_device_alloc(struct platform_device *pdev,
struct omap_hwmod **hwmods; struct omap_hwmod **hwmods;
od = kzalloc(sizeof(struct omap_device), GFP_KERNEL); od = kzalloc(sizeof(struct omap_device), GFP_KERNEL);
if (!od) { if (!od)
ret = -ENOMEM;
goto oda_exit1; goto oda_exit1;
}
od->hwmods_cnt = oh_cnt; od->hwmods_cnt = oh_cnt;
hwmods = kmemdup(ohs, sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL); hwmods = kmemdup(ohs, sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment