aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-08-03 11:21:10 -0400
committerPaul Walmsley <paul@pwsan.com>2012-09-12 04:57:04 -0400
commita032d33b65c89a781c871fd1def595fa6a69b52a (patch)
tree261f10d449f72e6b30f573217e806ff649057304 /arch/arm/mach-omap2/omap_hwmod.c
parent55d512e245bc7699a8800e23df1a24195dd08217 (diff)
ARM: OMAP: clean up some smatch warnings, fix some printk(KERN_ERR ...
Resolve the following warnings from smatch: arch/arm/mach-omap2/gpmc.c:282 gpmc_cs_set_timings() info: why not propagate 'div' from gpmc_cs_calc_divider() instead of -1? arch/arm/mach-omap2/serial.c:328 omap_serial_init_port() error: 'pdev' dereferencing possible ERR_PTR() arch/arm/mach-omap2/timer.c:213 omap2_gp_clockevent_init() Error invalid range 4096 to -1 arch/arm/mach-omap2/gpio.c:63 omap2_gpio_dev_init() warn: possible memory leak of 'pdata' arch/arm/mach-omap2/omap_hwmod.c:1478 _assert_hardreset() warn: assigning -22 to unsigned variable 'ret' arch/arm/mach-omap2/omap_hwmod.c:1487 _assert_hardreset() warn: 4294963201 is more than 255 (max '(ret)' can be) so this is always the same. arch/arm/mach-omap2/omap_hwmod.c:1545 _read_hardreset() warn: assigning -22 to unsigned variable 'ret' arch/arm/mach-omap2/omap_hwmod.c:1554 _read_hardreset() warn: 4294963201 is more than 255 (max '(ret)' can be) so this is always the same. arch/arm/mach-omap2/dpll3xxx.c:629 omap3_clkoutx2_recalc() error: we previously assumed 'pclk' could be null (see line 627) arch/arm/mach-omap2/board-n8x0.c:422 n8x0_mmc_late_init() Error invalid range 14 to 13 arch/arm/mach-omap1/leds-h2p2-debug.c:71 h2p2_dbg_leds_event() error: potentially derefencing uninitialized 'fpga'. arch/arm/plat-omap/mux.c:79 omap_cfg_reg() Error invalid range 4096 to -1 Thanks to Tony Lindgren <tony@atomide.com> for pointing out that BUG() can be disabled. The changes in the first version that removed the subsequent return() after BUG() states have been dropped. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 6ca8e519968d..bd69eaefcc97 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1438,8 +1438,8 @@ static int _init_clocks(struct omap_hwmod *oh, void *data)
1438 * Return the bit position of the reset line that match the 1438 * Return the bit position of the reset line that match the
1439 * input name. Return -ENOENT if not found. 1439 * input name. Return -ENOENT if not found.
1440 */ 1440 */
1441static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name, 1441static int _lookup_hardreset(struct omap_hwmod *oh, const char *name,
1442 struct omap_hwmod_rst_info *ohri) 1442 struct omap_hwmod_rst_info *ohri)
1443{ 1443{
1444 int i; 1444 int i;
1445 1445
@@ -1475,7 +1475,7 @@ static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name,
1475static int _assert_hardreset(struct omap_hwmod *oh, const char *name) 1475static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
1476{ 1476{
1477 struct omap_hwmod_rst_info ohri; 1477 struct omap_hwmod_rst_info ohri;
1478 u8 ret = -EINVAL; 1478 int ret = -EINVAL;
1479 1479
1480 if (!oh) 1480 if (!oh)
1481 return -EINVAL; 1481 return -EINVAL;
@@ -1484,7 +1484,7 @@ static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
1484 return -ENOSYS; 1484 return -ENOSYS;
1485 1485
1486 ret = _lookup_hardreset(oh, name, &ohri); 1486 ret = _lookup_hardreset(oh, name, &ohri);
1487 if (IS_ERR_VALUE(ret)) 1487 if (ret < 0)
1488 return ret; 1488 return ret;
1489 1489
1490 ret = soc_ops.assert_hardreset(oh, &ohri); 1490 ret = soc_ops.assert_hardreset(oh, &ohri);
@@ -1542,7 +1542,7 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
1542static int _read_hardreset(struct omap_hwmod *oh, const char *name) 1542static int _read_hardreset(struct omap_hwmod *oh, const char *name)
1543{ 1543{
1544 struct omap_hwmod_rst_info ohri; 1544 struct omap_hwmod_rst_info ohri;
1545 u8 ret = -EINVAL; 1545 int ret = -EINVAL;
1546 1546
1547 if (!oh) 1547 if (!oh)
1548 return -EINVAL; 1548 return -EINVAL;
@@ -1551,7 +1551,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
1551 return -ENOSYS; 1551 return -ENOSYS;
1552 1552
1553 ret = _lookup_hardreset(oh, name, &ohri); 1553 ret = _lookup_hardreset(oh, name, &ohri);
1554 if (IS_ERR_VALUE(ret)) 1554 if (ret < 0)
1555 return ret; 1555 return ret;
1556 1556
1557 return soc_ops.is_hardreset_asserted(oh, &ohri); 1557 return soc_ops.is_hardreset_asserted(oh, &ohri);