diff options
Diffstat (limited to 'drivers/regulator/mc13892-regulator.c')
-rw-r--r-- | drivers/regulator/mc13892-regulator.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c index 0d17c9206816..f3fba1cc1379 100644 --- a/drivers/regulator/mc13892-regulator.c +++ b/drivers/regulator/mc13892-regulator.c @@ -1,14 +1,10 @@ -/* - * Regulator Driver for Freescale MC13892 PMIC - * - * Copyright 2010 Yong Shen <yong.shen@linaro.org> - * - * Based on draft driver from Arnaud Patard <arnaud.patard@rtp-net.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ +// SPDX-License-Identifier: GPL-2.0 +// +// Regulator Driver for Freescale MC13892 PMIC +// +// Copyright 2010 Yong Shen <yong.shen@linaro.org> +// +// Based on draft driver from Arnaud Patard <arnaud.patard@rtp-net.org> #include <linux/mfd/mc13892.h> #include <linux/regulator/machine.h> @@ -547,9 +543,9 @@ static int mc13892_regulator_probe(struct platform_device *pdev) if (num_regulators <= 0) return -EINVAL; - priv = devm_kzalloc(&pdev->dev, sizeof(*priv) + - num_regulators * sizeof(priv->regulators[0]), - GFP_KERNEL); + priv = devm_kzalloc(&pdev->dev, + struct_size(priv, regulators, num_regulators), + GFP_KERNEL); if (!priv) return -ENOMEM; |