aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/sh_cmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clocksource/sh_cmt.c')
-rw-r--r--drivers/clocksource/sh_cmt.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index d607ac2d516b..bf3e4c11fd37 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -18,7 +18,6 @@
18 */ 18 */
19 19
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/bootmem.h>
22#include <linux/platform_device.h> 21#include <linux/platform_device.h>
23#include <linux/spinlock.h> 22#include <linux/spinlock.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
@@ -645,11 +644,7 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
645 return 0; 644 return 0;
646 } 645 }
647 646
648 if (is_early_platform_device(pdev)) 647 p = kmalloc(sizeof(*p), GFP_KERNEL);
649 p = alloc_bootmem(sizeof(*p));
650 else
651 p = kmalloc(sizeof(*p), GFP_KERNEL);
652
653 if (p == NULL) { 648 if (p == NULL) {
654 dev_err(&pdev->dev, "failed to allocate driver data\n"); 649 dev_err(&pdev->dev, "failed to allocate driver data\n");
655 return -ENOMEM; 650 return -ENOMEM;
@@ -657,11 +652,7 @@ static int __devinit sh_cmt_probe(struct platform_device *pdev)
657 652
658 ret = sh_cmt_setup(p, pdev); 653 ret = sh_cmt_setup(p, pdev);
659 if (ret) { 654 if (ret) {
660 if (is_early_platform_device(pdev)) 655 kfree(p);
661 free_bootmem(__pa(p), sizeof(*p));
662 else
663 kfree(p);
664
665 platform_set_drvdata(pdev, NULL); 656 platform_set_drvdata(pdev, NULL);
666 } 657 }
667 return ret; 658 return ret;