summaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/sh_tmu.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-01-27 22:04:17 +0100
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-04-16 12:03:20 +0200
commit3b77a83eeabb885c5fff02756eba50f446a2d83c (patch)
tree1d4c7b62c1144c12a90de5b67be69198ddd27baf /drivers/clocksource/sh_tmu.c
parentclocksource: sh_tmu: Add index to struct sh_tmu_channel (diff)
downloadlinux-3b77a83eeabb885c5fff02756eba50f446a2d83c.tar.xz
linux-3b77a83eeabb885c5fff02756eba50f446a2d83c.zip
clocksource: sh_tmu: 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_tmu.c')
-rw-r--r--drivers/clocksource/sh_tmu.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index e30430439bb1..26a9f7dadfbc 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -397,8 +397,6 @@ static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
struct clock_event_device *ced = &ch->ced;
int ret;
- memset(ced, 0, sizeof(*ced));
-
ced->name = name;
ced->features = CLOCK_EVT_FEAT_PERIODIC;
ced->features |= CLOCK_EVT_FEAT_ONESHOT;
@@ -441,7 +439,6 @@ static int sh_tmu_channel_setup(struct sh_tmu_channel *ch,
{
struct sh_timer_config *cfg = tmu->pdev->dev.platform_data;
- memset(ch, 0, sizeof(*ch));
ch->tmu = tmu;
/*
@@ -475,7 +472,6 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)
int ret;
ret = -ENXIO;
- memset(tmu, 0, sizeof(*tmu));
tmu->pdev = pdev;
if (!cfg) {
@@ -547,7 +543,7 @@ static int sh_tmu_probe(struct platform_device *pdev)
goto out;
}
- tmu = kmalloc(sizeof(*tmu), GFP_KERNEL);
+ tmu = kzalloc(sizeof(*tmu), GFP_KERNEL);
if (tmu == NULL) {
dev_err(&pdev->dev, "failed to allocate driver data\n");
return -ENOMEM;