Merge remote-tracking branch 'regulator/topic/tps65218' into regulator-next
authorMark Brown <broonie@kernel.org>
Fri, 26 Jan 2018 17:57:05 +0000 (17:57 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 26 Jan 2018 17:57:05 +0000 (17:57 +0000)
drivers/regulator/tps65218-regulator.c

index bc489958fed7537ffd6bbb559796b8f95f5d39a4..1827185beacc4e7f9079ae68a170f9c39003560c 100644 (file)
@@ -28,9 +28,6 @@
 #include <linux/regulator/machine.h>
 #include <linux/mfd/tps65218.h>
 
-enum tps65218_regulators { DCDC1, DCDC2, DCDC3, DCDC4,
-                          DCDC5, DCDC6, LDO1, LS3 };
-
 #define TPS65218_REGULATOR(_name, _of, _id, _type, _ops, _n, _vr, _vm, _er, \
                           _em, _cr, _cm, _lr, _nlr, _delay, _fuv, _sr, _sm) \
        {                                                       \
@@ -329,6 +326,8 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
        /* Allocate memory for strobes */
        tps->strobes = devm_kzalloc(&pdev->dev, sizeof(u8) *
                                    TPS65218_NUM_REGULATOR, GFP_KERNEL);
+       if (!tps->strobes)
+               return -ENOMEM;
 
        for (i = 0; i < ARRAY_SIZE(regulators); i++) {
                rdev = devm_regulator_register(&pdev->dev, &regulators[i],