diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-01-27 16:04:17 -0500 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-04-16 06:03:20 -0400 |
commit | 3b77a83eeabb885c5fff02756eba50f446a2d83c (patch) | |
tree | 1d4c7b62c1144c12a90de5b67be69198ddd27baf /drivers/clocksource/sh_tmu.c | |
parent | fe68eb802ef8bf034735f37cb561ab814fb3b0d6 (diff) |
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.c | 6 |
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, | |||
397 | struct clock_event_device *ced = &ch->ced; | 397 | struct clock_event_device *ced = &ch->ced; |
398 | int ret; | 398 | int ret; |
399 | 399 | ||
400 | memset(ced, 0, sizeof(*ced)); | ||
401 | |||
402 | ced->name = name; | 400 | ced->name = name; |
403 | ced->features = CLOCK_EVT_FEAT_PERIODIC; | 401 | ced->features = CLOCK_EVT_FEAT_PERIODIC; |
404 | ced->features |= CLOCK_EVT_FEAT_ONESHOT; | 402 | ced->features |= CLOCK_EVT_FEAT_ONESHOT; |
@@ -441,7 +439,6 @@ static int sh_tmu_channel_setup(struct sh_tmu_channel *ch, | |||
441 | { | 439 | { |
442 | struct sh_timer_config *cfg = tmu->pdev->dev.platform_data; | 440 | struct sh_timer_config *cfg = tmu->pdev->dev.platform_data; |
443 | 441 | ||
444 | memset(ch, 0, sizeof(*ch)); | ||
445 | ch->tmu = tmu; | 442 | ch->tmu = tmu; |
446 | 443 | ||
447 | /* | 444 | /* |
@@ -475,7 +472,6 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) | |||
475 | int ret; | 472 | int ret; |
476 | ret = -ENXIO; | 473 | ret = -ENXIO; |
477 | 474 | ||
478 | memset(tmu, 0, sizeof(*tmu)); | ||
479 | tmu->pdev = pdev; | 475 | tmu->pdev = pdev; |
480 | 476 | ||
481 | if (!cfg) { | 477 | if (!cfg) { |
@@ -547,7 +543,7 @@ static int sh_tmu_probe(struct platform_device *pdev) | |||
547 | goto out; | 543 | goto out; |
548 | } | 544 | } |
549 | 545 | ||
550 | tmu = kmalloc(sizeof(*tmu), GFP_KERNEL); | 546 | tmu = kzalloc(sizeof(*tmu), GFP_KERNEL); |
551 | if (tmu == NULL) { | 547 | if (tmu == NULL) { |
552 | dev_err(&pdev->dev, "failed to allocate driver data\n"); | 548 | dev_err(&pdev->dev, "failed to allocate driver data\n"); |
553 | return -ENOMEM; | 549 | return -ENOMEM; |