aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/kernel/entry-armv.S13
-rw-r--r--arch/arm/kernel/process.c13
-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
17 files changed, 49 insertions, 58 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 0f82098c9bfe..cd22d821bf74 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -562,21 +562,21 @@ ENDPROC(__und_usr)
562 @ Fall-through from Thumb-2 __und_usr 562 @ Fall-through from Thumb-2 __und_usr
563 @ 563 @
564#ifdef CONFIG_NEON 564#ifdef CONFIG_NEON
565 get_thread_info r10 @ get current thread
565 adr r6, .LCneon_thumb_opcodes 566 adr r6, .LCneon_thumb_opcodes
566 b 2f 567 b 2f
567#endif 568#endif
568call_fpe: 569call_fpe:
570 get_thread_info r10 @ get current thread
569#ifdef CONFIG_NEON 571#ifdef CONFIG_NEON
570 adr r6, .LCneon_arm_opcodes 572 adr r6, .LCneon_arm_opcodes
5712: 5732: ldr r5, [r6], #4 @ mask value
572 ldr r7, [r6], #4 @ mask value
573 cmp r7, #0 @ end mask?
574 beq 1f
575 and r8, r0, r7
576 ldr r7, [r6], #4 @ opcode bits matching in mask 574 ldr r7, [r6], #4 @ opcode bits matching in mask
575 cmp r5, #0 @ end mask?
576 beq 1f
577 and r8, r0, r5
577 cmp r8, r7 @ NEON instruction? 578 cmp r8, r7 @ NEON instruction?
578 bne 2b 579 bne 2b
579 get_thread_info r10
580 mov r7, #1 580 mov r7, #1
581 strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used 581 strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used
582 strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used 582 strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used
@@ -586,7 +586,6 @@ call_fpe:
586 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27 586 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
587 tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2 587 tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
588 moveq pc, lr 588 moveq pc, lr
589 get_thread_info r10 @ get current thread
590 and r8, r0, #0x00000f00 @ mask out CP number 589 and r8, r0, #0x00000f00 @ mask out CP number
591 THUMB( lsr r8, r8, #8 ) 590 THUMB( lsr r8, r8, #8 )
592 mov r7, #1 591 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-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 e5cafed8ef25..2520d46c8508 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1659,7 +1659,7 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
1659 return -ENOSYS; 1659 return -ENOSYS;
1660 1660
1661 ret = _lookup_hardreset(oh, name, &ohri); 1661 ret = _lookup_hardreset(oh, name, &ohri);
1662 if (IS_ERR_VALUE(ret)) 1662 if (ret < 0)
1663 return ret; 1663 return ret;
1664 1664
1665 if (oh->clkdm) { 1665 if (oh->clkdm) {
@@ -2409,7 +2409,7 @@ static int __init _init(struct omap_hwmod *oh, void *data)
2409 _init_mpu_rt_base(oh, NULL); 2409 _init_mpu_rt_base(oh, NULL);
2410 2410
2411 r = _init_clocks(oh, NULL); 2411 r = _init_clocks(oh, NULL);
2412 if (IS_ERR_VALUE(r)) { 2412 if (r < 0) {
2413 WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh->name); 2413 WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh->name);
2414 return -EINVAL; 2414 return -EINVAL;
2415 } 2415 }
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 89cad4a605dd..86babd740d41 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -1180,7 +1180,7 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
1180{ 1180{
1181 int i; 1181 int i;
1182 1182
1183 if (IS_ERR_OR_NULL(pwrdm)) { 1183 if (!pwrdm) {
1184 pr_debug("powerdomain: %s: invalid powerdomain pointer\n", 1184 pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
1185 __func__); 1185 __func__);
1186 return 1; 1186 return 1;
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 773733fccd83..06cbb49cc976 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -288,7 +288,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
288 r = -EINVAL; 288 r = -EINVAL;
289 } else { 289 } else {
290 r = clk_set_parent(timer->fclk, src); 290 r = clk_set_parent(timer->fclk, src);
291 if (IS_ERR_VALUE(r)) 291 if (r < 0)
292 pr_warn("%s: %s cannot set source\n", 292 pr_warn("%s: %s cannot set source\n",
293 __func__, oh->name); 293 __func__, oh->name);
294 clk_put(src); 294 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);