summaryrefslogtreecommitdiff
path: root/drivers/reset/sti/reset-syscfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/reset/sti/reset-syscfg.c')
-rw-r--r--drivers/reset/sti/reset-syscfg.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/reset/sti/reset-syscfg.c b/drivers/reset/sti/reset-syscfg.c
index 9bd57a5eee72..7e0f2aa55ba7 100644
--- a/drivers/reset/sti/reset-syscfg.c
+++ b/drivers/reset/sti/reset-syscfg.c
@@ -145,16 +145,14 @@ static int syscfg_reset_controller_register(struct device *dev,
const struct syscfg_reset_controller_data *data)
{
struct syscfg_reset_controller *rc;
- size_t size;
int i, err;
rc = devm_kzalloc(dev, sizeof(*rc), GFP_KERNEL);
if (!rc)
return -ENOMEM;
- size = sizeof(struct syscfg_reset_channel) * data->nr_channels;
-
- rc->channels = devm_kzalloc(dev, size, GFP_KERNEL);
+ rc->channels = devm_kcalloc(dev, data->nr_channels,
+ sizeof(*rc->channels), GFP_KERNEL);
if (!rc->channels)
return -ENOMEM;