Merge tag 'regulator-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[sfrench/cifs-2.6.git] / drivers / regulator / mc13783-regulator.c
index fe4c7d677f9c7b3b37143bc1e71ed07eafaf1fd2..8fd1adc9c9a91871e98f0a887f81bf3d88473db9 100644 (file)
@@ -1,14 +1,10 @@
-/*
- * Regulator Driver for Freescale MC13783 PMIC
- *
- * Copyright 2010 Yong Shen <yong.shen@linaro.org>
- * Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
- * Copyright 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
- *
- * 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 MC13783 PMIC
+//
+// Copyright 2010 Yong Shen <yong.shen@linaro.org>
+// Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
+// Copyright 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
 
 #include <linux/mfd/mc13783.h>
 #include <linux/regulator/machine.h>
@@ -409,9 +405,9 @@ static int mc13783_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;