diff options
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/greybus/audio_topology.c | 2 | ||||
-rw-r--r-- | drivers/staging/media/imx/imx-media-dev.c | 6 | ||||
-rw-r--r-- | drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 24 |
3 files changed, 20 insertions, 12 deletions
diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index 15e57f701630..b71078339e86 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -144,7 +144,7 @@ static const char **gb_generate_enum_strings(struct gbaudio_module_info *gb, __u8 *data; items = le32_to_cpu(gbenum->items); - strings = devm_kzalloc(gb->dev, sizeof(char *) * items, GFP_KERNEL); + strings = devm_kcalloc(gb->dev, items, sizeof(char *), GFP_KERNEL); data = gbenum->names; for (i = 0; i < items; i++) { diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c index 289d775c4820..b0be80f05767 100644 --- a/drivers/staging/media/imx/imx-media-dev.c +++ b/drivers/staging/media/imx/imx-media-dev.c @@ -303,9 +303,9 @@ static int imx_media_alloc_pad_vdev_lists(struct imx_media_dev *imxmd) list_for_each_entry(sd, &imxmd->v4l2_dev.subdevs, list) { entity = &sd->entity; - vdev_lists = devm_kzalloc( + vdev_lists = devm_kcalloc( imxmd->md.dev, - entity->num_pads * sizeof(*vdev_lists), + entity->num_pads, sizeof(*vdev_lists), GFP_KERNEL); if (!vdev_lists) return -ENOMEM; @@ -544,7 +544,7 @@ static int imx_media_probe(struct platform_device *pdev) goto unreg_dev; } - subdevs = devm_kzalloc(imxmd->md.dev, sizeof(*subdevs) * num_subdevs, + subdevs = devm_kcalloc(imxmd->md.dev, num_subdevs, sizeof(*subdevs), GFP_KERNEL); if (!subdevs) { ret = -ENOMEM; diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index 04b1a0950387..0c3e498ae99c 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -287,7 +287,8 @@ static int rt2880_pinmux_index(struct rt2880_priv *p) } /* allocate the group names array needed by the gpio function */ - p->group_names = devm_kzalloc(p->dev, sizeof(char *) * p->group_count, GFP_KERNEL); + p->group_names = devm_kcalloc(p->dev, p->group_count, sizeof(char *), + GFP_KERNEL); if (!p->group_names) return -1; @@ -300,8 +301,12 @@ static int rt2880_pinmux_index(struct rt2880_priv *p) p->func_count++; /* allocate our function and group mapping index buffers */ - f = p->func = devm_kzalloc(p->dev, sizeof(struct rt2880_pmx_func) * p->func_count, GFP_KERNEL); - gpio_func.groups = devm_kzalloc(p->dev, sizeof(int) * p->group_count, GFP_KERNEL); + f = p->func = devm_kcalloc(p->dev, + p->func_count, + sizeof(struct rt2880_pmx_func), + GFP_KERNEL); + gpio_func.groups = devm_kcalloc(p->dev, p->group_count, sizeof(int), + GFP_KERNEL); if (!f || !gpio_func.groups) return -1; @@ -337,7 +342,10 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p) if (!p->func[i]->pin_count) continue; - p->func[i]->pins = devm_kzalloc(p->dev, sizeof(int) * p->func[i]->pin_count, GFP_KERNEL); + p->func[i]->pins = devm_kcalloc(p->dev, + p->func[i]->pin_count, + sizeof(int), + GFP_KERNEL); for (j = 0; j < p->func[i]->pin_count; j++) p->func[i]->pins[j] = p->func[i]->pin_first + j; @@ -347,11 +355,11 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p) } /* the buffer that tells us which pins are gpio */ - p->gpio = devm_kzalloc(p->dev,sizeof(uint8_t) * p->max_pins, - GFP_KERNEL); + p->gpio = devm_kcalloc(p->dev,p->max_pins, sizeof(uint8_t), + GFP_KERNEL); /* the pads needed to tell pinctrl about our pins */ - p->pads = devm_kzalloc(p->dev, - sizeof(struct pinctrl_pin_desc) * p->max_pins, + p->pads = devm_kcalloc(p->dev, + p->max_pins, sizeof(struct pinctrl_pin_desc), GFP_KERNEL); if (!p->pads || !p->gpio ) { dev_err(p->dev, "Failed to allocate gpio data\n"); |