diff options
Diffstat (limited to 'drivers/irqchip/qcom-irq-combiner.c')
-rw-r--r-- | drivers/irqchip/qcom-irq-combiner.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/irqchip/qcom-irq-combiner.c b/drivers/irqchip/qcom-irq-combiner.c index 067337ab3f20..d88e993aa66d 100644 --- a/drivers/irqchip/qcom-irq-combiner.c +++ b/drivers/irqchip/qcom-irq-combiner.c | |||
@@ -229,7 +229,6 @@ static int get_registers(struct platform_device *pdev, struct combiner *comb) | |||
229 | static int __init combiner_probe(struct platform_device *pdev) | 229 | static int __init combiner_probe(struct platform_device *pdev) |
230 | { | 230 | { |
231 | struct combiner *combiner; | 231 | struct combiner *combiner; |
232 | size_t alloc_sz; | ||
233 | int nregs; | 232 | int nregs; |
234 | int err; | 233 | int err; |
235 | 234 | ||
@@ -239,8 +238,8 @@ static int __init combiner_probe(struct platform_device *pdev) | |||
239 | return -EINVAL; | 238 | return -EINVAL; |
240 | } | 239 | } |
241 | 240 | ||
242 | alloc_sz = sizeof(*combiner) + sizeof(struct combiner_reg) * nregs; | 241 | combiner = devm_kzalloc(&pdev->dev, struct_size(combiner, regs, nregs), |
243 | combiner = devm_kzalloc(&pdev->dev, alloc_sz, GFP_KERNEL); | 242 | GFP_KERNEL); |
244 | if (!combiner) | 243 | if (!combiner) |
245 | return -ENOMEM; | 244 | return -ENOMEM; |
246 | 245 | ||