aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/sh_cmt.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-01-27 16:04:17 -0500
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-04-16 06:03:09 -0400
commitb262bc74dcfd77355720342cbcf89cc8ec12e86b (patch)
tree87aa1a02549e46dd506e1b6c345ace04504b14a4 /drivers/clocksource/sh_cmt.c
parent740a95184dd61eb0481f75ced05ea5e01b7ce6ac (diff)
clocksource: sh_cmt: Replace kmalloc + memset with kzalloc
One kzalloc a day keeps the bugs away. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/clocksource/sh_cmt.c')
-rw-r--r--drivers/clocksource/sh_cmt.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 6b65621a9733..0779bf194aea 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -672,8 +672,6 @@ static void sh_cmt_register_clockevent(struct sh_cmt_channel *ch,
672{ 672{
673 struct clock_event_device *ced = &ch->ced; 673 struct clock_event_device *ced = &ch->ced;
674 674
675 memset(ced, 0, sizeof(*ced));
676
677 ced->name = name; 675 ced->name = name;
678 ced->features = CLOCK_EVT_FEAT_PERIODIC; 676 ced->features = CLOCK_EVT_FEAT_PERIODIC;
679 ced->features |= CLOCK_EVT_FEAT_ONESHOT; 677 ced->features |= CLOCK_EVT_FEAT_ONESHOT;
@@ -709,7 +707,6 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index,
709 int irq; 707 int irq;
710 int ret; 708 int ret;
711 709
712 memset(ch, 0, sizeof(*ch));
713 ch->cmt = cmt; 710 ch->cmt = cmt;
714 ch->base = cmt->mapbase_ch; 711 ch->base = cmt->mapbase_ch;
715 ch->index = index; 712 ch->index = index;
@@ -758,7 +755,6 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)
758 int ret; 755 int ret;
759 ret = -ENXIO; 756 ret = -ENXIO;
760 757
761 memset(cmt, 0, sizeof(*cmt));
762 cmt->pdev = pdev; 758 cmt->pdev = pdev;
763 759
764 if (!cfg) { 760 if (!cfg) {
@@ -861,7 +857,7 @@ static int sh_cmt_probe(struct platform_device *pdev)
861 goto out; 857 goto out;
862 } 858 }
863 859
864 cmt = kmalloc(sizeof(*cmt), GFP_KERNEL); 860 cmt = kzalloc(sizeof(*cmt), GFP_KERNEL);
865 if (cmt == NULL) { 861 if (cmt == NULL) {
866 dev_err(&pdev->dev, "failed to allocate driver data\n"); 862 dev_err(&pdev->dev, "failed to allocate driver data\n");
867 return -ENOMEM; 863 return -ENOMEM;