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)
unsigned long flags;
int ret;
if (clk == NULL || IS_ERR(clk))
if (IS_ERR_OR_NULL(clk))
return -EINVAL;
spin_lock_irqsave(&clockfw_lock, flags);
......@@ -627,7 +627,7 @@ void clk_disable(struct clk *clk)
{
unsigned long flags;
if (clk == NULL || IS_ERR(clk))
if (IS_ERR_OR_NULL(clk))
return;
spin_lock_irqsave(&clockfw_lock, flags);
......@@ -650,7 +650,7 @@ unsigned long clk_get_rate(struct clk *clk)
unsigned long flags;
unsigned long ret;
if (clk == NULL || IS_ERR(clk))
if (IS_ERR_OR_NULL(clk))
return 0;
spin_lock_irqsave(&clockfw_lock, flags);
......@@ -670,7 +670,7 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
unsigned long flags;
long ret;
if (clk == NULL || IS_ERR(clk))
if (IS_ERR_OR_NULL(clk))
return 0;
spin_lock_irqsave(&clockfw_lock, flags);
......@@ -686,7 +686,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
unsigned long flags;
int ret = -EINVAL;
if (clk == NULL || IS_ERR(clk))
if (IS_ERR_OR_NULL(clk))
return ret;
spin_lock_irqsave(&clockfw_lock, flags);
......@@ -791,7 +791,7 @@ void clk_preinit(struct clk *clk)
int clk_register(struct clk *clk)
{
if (clk == NULL || IS_ERR(clk))
if (IS_ERR_OR_NULL(clk))
return -EINVAL;
/*
......@@ -817,7 +817,7 @@ EXPORT_SYMBOL(clk_register);
void clk_unregister(struct clk *clk)
{
if (clk == NULL || IS_ERR(clk))
if (IS_ERR_OR_NULL(clk))
return;
mutex_lock(&clocks_mutex);
......
......@@ -235,7 +235,7 @@ void omap2xxx_clkt_vps_init(void)
hw = kzalloc(sizeof(*hw), GFP_KERNEL);
if (!hw)
goto cleanup;
return;
init.name = "virt_prcm_set";
init.ops = &virt_prcm_set_ops;
init.parent_names = &parent_name;
......@@ -244,9 +244,12 @@ void omap2xxx_clkt_vps_init(void)
hw->hw.init = &init;
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);
return;
cleanup:
kfree(hw);
}
#endif
......@@ -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++)
if (oc->_clk)
clk_prepare_enable(oc->_clk);
clk_prepare_enable(oc->_clk);
dispc_disable_outputs();
......@@ -412,8 +411,7 @@ int omap_dss_reset(struct omap_hwmod *oh)
pr_debug("dss_core: softreset done\n");
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;
......
......@@ -334,10 +334,9 @@ struct omap_device *omap_device_alloc(struct platform_device *pdev,
struct omap_hwmod **hwmods;
od = kzalloc(sizeof(struct omap_device), GFP_KERNEL);
if (!od) {
ret = -ENOMEM;
if (!od)
goto oda_exit1;
}
od->hwmods_cnt = oh_cnt;
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