aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-05-02 16:31:29 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-05-02 16:31:29 -0400
commit33b9f582c5c1db515412cc7efff28f7d1779321f (patch)
tree60ea1b403b41f651bc570f4c368ba82064880796
parent946342d03ec4e8367bba7bb99e7155e97f69058a (diff)
parent008ca431822f39a023322b3598d8366faf46cfc1 (diff)
Merge branch 'cleanup' into for-linus
Conflicts: arch/arm/plat-omap/dmtimer.c
-rw-r--r--arch/arm/kernel/entry-armv.S13
-rw-r--r--arch/arm/kernel/process.c13
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c2
-rw-r--r--arch/arm/mach-imx/devices/devices.c2
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c6
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c7
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c2
-rw-r--r--arch/arm/mach-omap2/clock.c2
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c4
-rw-r--r--arch/arm/mach-omap2/gpmc.c8
-rw-r--r--arch/arm/mach-omap2/omap_device.c13
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c4
-rw-r--r--arch/arm/mach-omap2/pm-debug.c6
-rw-r--r--arch/arm/mach-omap2/powerdomain.c2
-rw-r--r--arch/arm/mach-omap2/timer.c2
-rw-r--r--arch/arm/mach-tegra/board-harmony-pcie.c6
-rw-r--r--arch/arm/mach-tegra/tegra2_emc.c2
-rw-r--r--arch/arm/mach-ux500/cpu.c5
-rw-r--r--arch/arm/plat-omap/dmtimer.c12
19 files changed, 51 insertions, 60 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index c66ca7e4ee91..582b405befc5 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -520,21 +520,21 @@ ENDPROC(__und_usr)
520 @ Fall-through from Thumb-2 __und_usr 520 @ Fall-through from Thumb-2 __und_usr
521 @ 521 @
522#ifdef CONFIG_NEON 522#ifdef CONFIG_NEON
523 get_thread_info r10 @ get current thread
523 adr r6, .LCneon_thumb_opcodes 524 adr r6, .LCneon_thumb_opcodes
524 b 2f 525 b 2f
525#endif 526#endif
526call_fpe: 527call_fpe:
528 get_thread_info r10 @ get current thread
527#ifdef CONFIG_NEON 529#ifdef CONFIG_NEON
528 adr r6, .LCneon_arm_opcodes 530 adr r6, .LCneon_arm_opcodes
5292: 5312: ldr r5, [r6], #4 @ mask value
530 ldr r7, [r6], #4 @ mask value
531 cmp r7, #0 @ end mask?
532 beq 1f
533 and r8, r0, r7
534 ldr r7, [r6], #4 @ opcode bits matching in mask 532 ldr r7, [r6], #4 @ opcode bits matching in mask
533 cmp r5, #0 @ end mask?
534 beq 1f
535 and r8, r0, r5
535 cmp r8, r7 @ NEON instruction? 536 cmp r8, r7 @ NEON instruction?
536 bne 2b 537 bne 2b
537 get_thread_info r10
538 mov r7, #1 538 mov r7, #1
539 strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used 539 strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used
540 strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used 540 strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used
@@ -544,7 +544,6 @@ call_fpe:
544 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27 544 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
545 tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2 545 tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
546 moveq pc, lr 546 moveq pc, lr
547 get_thread_info r10 @ get current thread
548 and r8, r0, #0x00000f00 @ mask out CP number 547 and r8, r0, #0x00000f00 @ mask out CP number
549 THUMB( lsr r8, r8, #8 ) 548 THUMB( lsr r8, r8, #8 )
550 mov r7, #1 549 mov r7, #1
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 047d3e40e470..cbd0f51937cc 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -459,15 +459,16 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
459 * atomic helpers and the signal restart code. Insert it into the 459 * atomic helpers and the signal restart code. Insert it into the
460 * gate_vma so that it is visible through ptrace and /proc/<pid>/mem. 460 * gate_vma so that it is visible through ptrace and /proc/<pid>/mem.
461 */ 461 */
462static struct vm_area_struct gate_vma; 462static struct vm_area_struct gate_vma = {
463 .vm_start = 0xffff0000,
464 .vm_end = 0xffff0000 + PAGE_SIZE,
465 .vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYEXEC,
466 .vm_mm = &init_mm,
467};
463 468
464static int __init gate_vma_init(void) 469static int __init gate_vma_init(void)
465{ 470{
466 gate_vma.vm_start = 0xffff0000; 471 gate_vma.vm_page_prot = PAGE_READONLY_EXEC;
467 gate_vma.vm_end = 0xffff0000 + PAGE_SIZE;
468 gate_vma.vm_page_prot = PAGE_READONLY_EXEC;
469 gate_vma.vm_flags = VM_READ | VM_EXEC |
470 VM_MAYREAD | VM_MAYEXEC;
471 return 0; 472 return 0;
472} 473}
473arch_initcall(gate_vma_init); 474arch_initcall(gate_vma_init);
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 1ea79730187f..688991af8bf7 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -1251,7 +1251,7 @@ static void __init nuri_camera_init(void)
1251 } 1251 }
1252 1252
1253 m5mols_board_info.irq = s5p_register_gpio_interrupt(GPIO_CAM_8M_ISP_INT); 1253 m5mols_board_info.irq = s5p_register_gpio_interrupt(GPIO_CAM_8M_ISP_INT);
1254 if (!IS_ERR_VALUE(m5mols_board_info.irq)) 1254 if (m5mols_board_info.irq >= 0)
1255 s3c_gpio_cfgpin(GPIO_CAM_8M_ISP_INT, S3C_GPIO_SFN(0xF)); 1255 s3c_gpio_cfgpin(GPIO_CAM_8M_ISP_INT, S3C_GPIO_SFN(0xF));
1256 else 1256 else
1257 pr_err("%s: Failed to configure 8M_ISP_INT GPIO\n", __func__); 1257 pr_err("%s: Failed to configure 8M_ISP_INT GPIO\n", __func__);
diff --git a/arch/arm/mach-imx/devices/devices.c b/arch/arm/mach-imx/devices/devices.c
index 1b37482407f9..1b4366a0e7c0 100644
--- a/arch/arm/mach-imx/devices/devices.c
+++ b/arch/arm/mach-imx/devices/devices.c
@@ -37,7 +37,7 @@ int __init mxc_device_init(void)
37 int ret; 37 int ret;
38 38
39 ret = device_register(&mxc_aips_bus); 39 ret = device_register(&mxc_aips_bus);
40 if (IS_ERR_VALUE(ret)) 40 if (ret < 0)
41 goto done; 41 goto done;
42 42
43 ret = device_register(&mxc_ahb_bus); 43 ret = device_register(&mxc_ahb_bus);
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index ea961445e0e9..b23c8e4f28e8 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -536,16 +536,14 @@ static void __init ap_init_of(void)
536 'A' + (ap_sc_id & 0x0f)); 536 'A' + (ap_sc_id & 0x0f));
537 537
538 soc_dev = soc_device_register(soc_dev_attr); 538 soc_dev = soc_device_register(soc_dev_attr);
539 if (IS_ERR_OR_NULL(soc_dev)) { 539 if (IS_ERR(soc_dev)) {
540 kfree(soc_dev_attr->revision); 540 kfree(soc_dev_attr->revision);
541 kfree(soc_dev_attr); 541 kfree(soc_dev_attr);
542 return; 542 return;
543 } 543 }
544 544
545 parent = soc_device_to_device(soc_dev); 545 parent = soc_device_to_device(soc_dev);
546 546 integrator_init_sysfs(parent, ap_sc_id);
547 if (!IS_ERR_OR_NULL(parent))
548 integrator_init_sysfs(parent, ap_sc_id);
549 547
550 of_platform_populate(root, of_default_bus_match_table, 548 of_platform_populate(root, of_default_bus_match_table,
551 ap_auxdata_lookup, parent); 549 ap_auxdata_lookup, parent);
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 2b0db82a5381..da1091be0887 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -360,17 +360,14 @@ static void __init intcp_init_of(void)
360 'A' + (intcp_sc_id & 0x0f)); 360 'A' + (intcp_sc_id & 0x0f));
361 361
362 soc_dev = soc_device_register(soc_dev_attr); 362 soc_dev = soc_device_register(soc_dev_attr);
363 if (IS_ERR_OR_NULL(soc_dev)) { 363 if (IS_ERR(soc_dev)) {
364 kfree(soc_dev_attr->revision); 364 kfree(soc_dev_attr->revision);
365 kfree(soc_dev_attr); 365 kfree(soc_dev_attr);
366 return; 366 return;
367 } 367 }
368 368
369 parent = soc_device_to_device(soc_dev); 369 parent = soc_device_to_device(soc_dev);
370 370 integrator_init_sysfs(parent, intcp_sc_id);
371 if (!IS_ERR_OR_NULL(parent))
372 integrator_init_sysfs(parent, intcp_sc_id);
373
374 of_platform_populate(root, of_default_bus_match_table, 371 of_platform_populate(root, of_default_bus_match_table,
375 intcp_auxdata_lookup, parent); 372 intcp_auxdata_lookup, parent);
376} 373}
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index c3558f93d42c..6c949bc86256 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -479,7 +479,7 @@ static int __init beagle_opp_init(void)
479 479
480 /* Initialize the omap3 opp table if not already created. */ 480 /* Initialize the omap3 opp table if not already created. */
481 r = omap3_opp_init(); 481 r = omap3_opp_init();
482 if (IS_ERR_VALUE(r) && (r != -EEXIST)) { 482 if (r < 0 && (r != -EEXIST)) {
483 pr_err("%s: opp default init failed\n", __func__); 483 pr_err("%s: opp default init failed\n", __func__);
484 return r; 484 return r;
485 } 485 }
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index e4ec3a69ee2e..2191f25ad21b 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -596,7 +596,7 @@ int __init omap2_clk_switch_mpurate_at_boot(const char *mpurate_ck_name)
596 return -ENOENT; 596 return -ENOENT;
597 597
598 r = clk_set_rate(mpurate_ck, mpurate); 598 r = clk_set_rate(mpurate_ck, mpurate);
599 if (IS_ERR_VALUE(r)) { 599 if (r < 0) {
600 WARN(1, "clock: %s: unable to set MPU rate to %d: %d\n", 600 WARN(1, "clock: %s: unable to set MPU rate to %d: %d\n",
601 mpurate_ck_name, mpurate, r); 601 mpurate_ck_name, mpurate, r);
602 clk_put(mpurate_ck); 602 clk_put(mpurate_ck);
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index fadd87435cd0..0d75889c0a6f 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -303,7 +303,7 @@ static int omap2_onenand_setup_async(void __iomem *onenand_base)
303 t = omap2_onenand_calc_async_timings(); 303 t = omap2_onenand_calc_async_timings();
304 304
305 ret = gpmc_set_async_mode(gpmc_onenand_data->cs, &t); 305 ret = gpmc_set_async_mode(gpmc_onenand_data->cs, &t);
306 if (IS_ERR_VALUE(ret)) 306 if (ret < 0)
307 return ret; 307 return ret;
308 308
309 omap2_onenand_set_async_mode(onenand_base); 309 omap2_onenand_set_async_mode(onenand_base);
@@ -325,7 +325,7 @@ static int omap2_onenand_setup_sync(void __iomem *onenand_base, int *freq_ptr)
325 t = omap2_onenand_calc_sync_timings(gpmc_onenand_data, freq); 325 t = omap2_onenand_calc_sync_timings(gpmc_onenand_data, freq);
326 326
327 ret = gpmc_set_sync_mode(gpmc_onenand_data->cs, &t); 327 ret = gpmc_set_sync_mode(gpmc_onenand_data->cs, &t);
328 if (IS_ERR_VALUE(ret)) 328 if (ret < 0)
329 return ret; 329 return ret;
330 330
331 set_onenand_cfg(onenand_base); 331 set_onenand_cfg(onenand_base);
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 410e1bac7815..6de31739b45c 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -716,7 +716,7 @@ static int gpmc_setup_irq(void)
716 return -EINVAL; 716 return -EINVAL;
717 717
718 gpmc_irq_start = irq_alloc_descs(-1, 0, GPMC_NR_IRQ, 0); 718 gpmc_irq_start = irq_alloc_descs(-1, 0, GPMC_NR_IRQ, 0);
719 if (IS_ERR_VALUE(gpmc_irq_start)) { 719 if (gpmc_irq_start < 0) {
720 pr_err("irq_alloc_descs failed\n"); 720 pr_err("irq_alloc_descs failed\n");
721 return gpmc_irq_start; 721 return gpmc_irq_start;
722 } 722 }
@@ -801,7 +801,7 @@ static int gpmc_mem_init(void)
801 continue; 801 continue;
802 gpmc_cs_get_memconf(cs, &base, &size); 802 gpmc_cs_get_memconf(cs, &base, &size);
803 rc = gpmc_cs_insert_mem(cs, base, size); 803 rc = gpmc_cs_insert_mem(cs, base, size);
804 if (IS_ERR_VALUE(rc)) { 804 if (rc < 0) {
805 while (--cs >= 0) 805 while (--cs >= 0)
806 if (gpmc_cs_mem_enabled(cs)) 806 if (gpmc_cs_mem_enabled(cs))
807 gpmc_cs_delete_mem(cs); 807 gpmc_cs_delete_mem(cs);
@@ -1370,14 +1370,14 @@ static int gpmc_probe(struct platform_device *pdev)
1370 GPMC_REVISION_MINOR(l)); 1370 GPMC_REVISION_MINOR(l));
1371 1371
1372 rc = gpmc_mem_init(); 1372 rc = gpmc_mem_init();
1373 if (IS_ERR_VALUE(rc)) { 1373 if (rc < 0) {
1374 clk_disable_unprepare(gpmc_l3_clk); 1374 clk_disable_unprepare(gpmc_l3_clk);
1375 clk_put(gpmc_l3_clk); 1375 clk_put(gpmc_l3_clk);
1376 dev_err(gpmc_dev, "failed to reserve memory\n"); 1376 dev_err(gpmc_dev, "failed to reserve memory\n");
1377 return rc; 1377 return rc;
1378 } 1378 }
1379 1379
1380 if (IS_ERR_VALUE(gpmc_setup_irq())) 1380 if (gpmc_setup_irq() < 0)
1381 dev_warn(gpmc_dev, "gpmc_setup_irq failed\n"); 1381 dev_warn(gpmc_dev, "gpmc_setup_irq failed\n");
1382 1382
1383 /* Now the GPMC is initialised, unreserve the chip-selects */ 1383 /* Now the GPMC is initialised, unreserve the chip-selects */
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index 381be7ac0c17..eeea4fa28fbc 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -131,7 +131,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
131 int oh_cnt, i, ret = 0; 131 int oh_cnt, i, ret = 0;
132 132
133 oh_cnt = of_property_count_strings(node, "ti,hwmods"); 133 oh_cnt = of_property_count_strings(node, "ti,hwmods");
134 if (!oh_cnt || IS_ERR_VALUE(oh_cnt)) { 134 if (oh_cnt <= 0) {
135 dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n"); 135 dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n");
136 return -ENODEV; 136 return -ENODEV;
137 } 137 }
@@ -815,20 +815,17 @@ struct device *omap_device_get_by_hwmod_name(const char *oh_name)
815 } 815 }
816 816
817 oh = omap_hwmod_lookup(oh_name); 817 oh = omap_hwmod_lookup(oh_name);
818 if (IS_ERR_OR_NULL(oh)) { 818 if (!oh) {
819 WARN(1, "%s: no hwmod for %s\n", __func__, 819 WARN(1, "%s: no hwmod for %s\n", __func__,
820 oh_name); 820 oh_name);
821 return ERR_PTR(oh ? PTR_ERR(oh) : -ENODEV); 821 return ERR_PTR(-ENODEV);
822 } 822 }
823 if (IS_ERR_OR_NULL(oh->od)) { 823 if (!oh->od) {
824 WARN(1, "%s: no omap_device for %s\n", __func__, 824 WARN(1, "%s: no omap_device for %s\n", __func__,
825 oh_name); 825 oh_name);
826 return ERR_PTR(oh->od ? PTR_ERR(oh->od) : -ENODEV); 826 return ERR_PTR(-ENODEV);
827 } 827 }
828 828
829 if (IS_ERR_OR_NULL(oh->od->pdev))
830 return ERR_PTR(oh->od->pdev ? PTR_ERR(oh->od->pdev) : -ENODEV);
831
832 return &oh->od->pdev->dev; 829 return &oh->od->pdev->dev;
833} 830}
834 831
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index a202a4785104..ede9d495a9e2 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1666,7 +1666,7 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
1666 return -ENOSYS; 1666 return -ENOSYS;
1667 1667
1668 ret = _lookup_hardreset(oh, name, &ohri); 1668 ret = _lookup_hardreset(oh, name, &ohri);
1669 if (IS_ERR_VALUE(ret)) 1669 if (ret < 0)
1670 return ret; 1670 return ret;
1671 1671
1672 if (oh->clkdm) { 1672 if (oh->clkdm) {
@@ -2416,7 +2416,7 @@ static int __init _init(struct omap_hwmod *oh, void *data)
2416 _init_mpu_rt_base(oh, NULL); 2416 _init_mpu_rt_base(oh, NULL);
2417 2417
2418 r = _init_clocks(oh, NULL); 2418 r = _init_clocks(oh, NULL);
2419 if (IS_ERR_VALUE(r)) { 2419 if (r < 0) {
2420 WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh->name); 2420 WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh->name);
2421 return -EINVAL; 2421 return -EINVAL;
2422 } 2422 }
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 1edd000a8143..0b339861d751 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -217,7 +217,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
217 return 0; 217 return 0;
218 218
219 d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir); 219 d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir);
220 if (!(IS_ERR_OR_NULL(d))) 220 if (d)
221 (void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d, 221 (void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d,
222 (void *)pwrdm, &pwrdm_suspend_fops); 222 (void *)pwrdm, &pwrdm_suspend_fops);
223 223
@@ -261,8 +261,8 @@ static int __init pm_dbg_init(void)
261 return 0; 261 return 0;
262 262
263 d = debugfs_create_dir("pm_debug", NULL); 263 d = debugfs_create_dir("pm_debug", NULL);
264 if (IS_ERR_OR_NULL(d)) 264 if (!d)
265 return PTR_ERR(d); 265 return -EINVAL;
266 266
267 (void) debugfs_create_file("count", S_IRUGO, 267 (void) debugfs_create_file("count", S_IRUGO,
268 d, (void *)DEBUG_FILE_COUNTERS, &debug_fops); 268 d, (void *)DEBUG_FILE_COUNTERS, &debug_fops);
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 8e61d80bf6b3..43ac20c15f4f 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -1182,7 +1182,7 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
1182{ 1182{
1183 int i; 1183 int i;
1184 1184
1185 if (IS_ERR_OR_NULL(pwrdm)) { 1185 if (!pwrdm) {
1186 pr_debug("powerdomain: %s: invalid powerdomain pointer\n", 1186 pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
1187 __func__); 1187 __func__);
1188 return 1; 1188 return 1;
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index f62b509ed08d..a97026400af7 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -287,7 +287,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
287 r = -EINVAL; 287 r = -EINVAL;
288 } else { 288 } else {
289 r = clk_set_parent(timer->fclk, src); 289 r = clk_set_parent(timer->fclk, src);
290 if (IS_ERR_VALUE(r)) 290 if (r < 0)
291 pr_warn("%s: %s cannot set source\n", 291 pr_warn("%s: %s cannot set source\n",
292 __func__, oh->name); 292 __func__, oh->name);
293 clk_put(src); 293 clk_put(src);
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c
index 3cdc1bb8254c..6d29e6a39540 100644
--- a/arch/arm/mach-tegra/board-harmony-pcie.c
+++ b/arch/arm/mach-tegra/board-harmony-pcie.c
@@ -56,9 +56,9 @@ int __init harmony_pcie_init(void)
56 gpio_direction_output(en_vdd_1v05, 1); 56 gpio_direction_output(en_vdd_1v05, 1);
57 57
58 regulator = regulator_get(NULL, "vdd_ldo0,vddio_pex_clk"); 58 regulator = regulator_get(NULL, "vdd_ldo0,vddio_pex_clk");
59 if (IS_ERR_OR_NULL(regulator)) { 59 if (IS_ERR(regulator)) {
60 pr_err("%s: regulator_get failed: %d\n", __func__, 60 err = PTR_ERR(regulator);
61 (int)PTR_ERR(regulator)); 61 pr_err("%s: regulator_get failed: %d\n", __func__, err);
62 goto err_reg; 62 goto err_reg;
63 } 63 }
64 64
diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c
index ce7ce42a1ac9..9e8bdfa2b369 100644
--- a/arch/arm/mach-tegra/tegra2_emc.c
+++ b/arch/arm/mach-tegra/tegra2_emc.c
@@ -276,7 +276,7 @@ static struct tegra_emc_pdata *tegra_emc_fill_pdata(struct platform_device *pdev
276 int i; 276 int i;
277 277
278 WARN_ON(pdev->dev.platform_data); 278 WARN_ON(pdev->dev.platform_data);
279 BUG_ON(IS_ERR_OR_NULL(c)); 279 BUG_ON(IS_ERR(c));
280 280
281 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 281 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
282 pdata->tables = devm_kzalloc(&pdev->dev, sizeof(*pdata->tables), 282 pdata->tables = devm_kzalloc(&pdev->dev, sizeof(*pdata->tables),
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index 537870d3fea8..002da9a369d5 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -140,14 +140,13 @@ struct device * __init ux500_soc_device_init(const char *soc_id)
140 soc_info_populate(soc_dev_attr, soc_id); 140 soc_info_populate(soc_dev_attr, soc_id);
141 141
142 soc_dev = soc_device_register(soc_dev_attr); 142 soc_dev = soc_device_register(soc_dev_attr);
143 if (IS_ERR_OR_NULL(soc_dev)) { 143 if (IS_ERR(soc_dev)) {
144 kfree(soc_dev_attr); 144 kfree(soc_dev_attr);
145 return NULL; 145 return NULL;
146 } 146 }
147 147
148 parent = soc_device_to_device(soc_dev); 148 parent = soc_device_to_device(soc_dev);
149 if (!IS_ERR_OR_NULL(parent)) 149 device_create_file(parent, &ux500_soc_attr);
150 device_create_file(parent, &ux500_soc_attr);
151 150
152 return parent; 151 return parent;
153} 152}
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index a0daa2fb5de6..e6dbc8dbe6a6 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -140,8 +140,7 @@ static int omap_dm_timer_prepare(struct omap_dm_timer *timer)
140 */ 140 */
141 if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) { 141 if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {
142 timer->fclk = clk_get(&timer->pdev->dev, "fck"); 142 timer->fclk = clk_get(&timer->pdev->dev, "fck");
143 if (WARN_ON_ONCE(IS_ERR_OR_NULL(timer->fclk))) { 143 if (WARN_ON_ONCE(IS_ERR(timer->fclk))) {
144 timer->fclk = NULL;
145 dev_err(&timer->pdev->dev, ": No fclk handle.\n"); 144 dev_err(&timer->pdev->dev, ": No fclk handle.\n");
146 return -EINVAL; 145 return -EINVAL;
147 } 146 }
@@ -373,7 +372,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
373 372
374struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) 373struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
375{ 374{
376 if (timer) 375 if (timer && !IS_ERR(timer->fclk))
377 return timer->fclk; 376 return timer->fclk;
378 return NULL; 377 return NULL;
379} 378}
@@ -482,7 +481,7 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
482 if (pdata && pdata->set_timer_src) 481 if (pdata && pdata->set_timer_src)
483 return pdata->set_timer_src(timer->pdev, source); 482 return pdata->set_timer_src(timer->pdev, source);
484 483
485 if (!timer->fclk) 484 if (IS_ERR(timer->fclk))
486 return -EINVAL; 485 return -EINVAL;
487 486
488 switch (source) { 487 switch (source) {
@@ -500,13 +499,13 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
500 } 499 }
501 500
502 parent = clk_get(&timer->pdev->dev, parent_name); 501 parent = clk_get(&timer->pdev->dev, parent_name);
503 if (IS_ERR_OR_NULL(parent)) { 502 if (IS_ERR(parent)) {
504 pr_err("%s: %s not found\n", __func__, parent_name); 503 pr_err("%s: %s not found\n", __func__, parent_name);
505 return -EINVAL; 504 return -EINVAL;
506 } 505 }
507 506
508 ret = clk_set_parent(timer->fclk, parent); 507 ret = clk_set_parent(timer->fclk, parent);
509 if (IS_ERR_VALUE(ret)) 508 if (ret < 0)
510 pr_err("%s: failed to set %s as parent\n", __func__, 509 pr_err("%s: failed to set %s as parent\n", __func__,
511 parent_name); 510 parent_name);
512 511
@@ -808,6 +807,7 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
808 return -ENOMEM; 807 return -ENOMEM;
809 } 808 }
810 809
810 timer->fclk = ERR_PTR(-ENODEV);
811 timer->io_base = devm_ioremap_resource(dev, mem); 811 timer->io_base = devm_ioremap_resource(dev, mem);
812 if (IS_ERR(timer->io_base)) 812 if (IS_ERR(timer->io_base))
813 return PTR_ERR(timer->io_base); 813 return PTR_ERR(timer->io_base);