Merge remote-tracking branches 'regulator/fix/88pm800', 'regulator/fix/max8973', 'regulator/fix/s2mps11' and 'regulator/fix/supply' into regulator-linus
···3434#include <linux/mfd/samsung/s2mps14.h>3535#include <linux/mfd/samsung/s2mpu02.h>36363737+/* The highest number of possible regulators for supported devices. */3838+#define S2MPS_REGULATOR_MAX S2MPS13_REGULATOR_MAX3739struct s2mps11_info {3840 unsigned int rdev_num;3941 int ramp_delay2;···5149 * One bit for each S2MPS13/S2MPS14/S2MPU02 regulator whether5250 * the suspend mode was enabled.5351 */5454- unsigned long long s2mps14_suspend_state:50;5252+ DECLARE_BITMAP(suspend_state, S2MPS_REGULATOR_MAX);55535654 /* Array of size rdev_num with GPIO-s for external sleep control */5755 int *ext_control_gpio;···502500 switch (s2mps11->dev_type) {503501 case S2MPS13X:504502 case S2MPS14X:505505- if (s2mps11->s2mps14_suspend_state & (1 << rdev_get_id(rdev)))503503+ if (test_bit(rdev_get_id(rdev), s2mps11->suspend_state))506504 val = S2MPS14_ENABLE_SUSPEND;507505 else if (gpio_is_valid(s2mps11->ext_control_gpio[rdev_get_id(rdev)]))508506 val = S2MPS14_ENABLE_EXT_CONTROL;···510508 val = rdev->desc->enable_mask;511509 break;512510 case S2MPU02:513513- if (s2mps11->s2mps14_suspend_state & (1 << rdev_get_id(rdev)))511511+ if (test_bit(rdev_get_id(rdev), s2mps11->suspend_state))514512 val = S2MPU02_ENABLE_SUSPEND;515513 else516514 val = rdev->desc->enable_mask;···564562 if (ret < 0)565563 return ret;566564567567- s2mps11->s2mps14_suspend_state |= (1 << rdev_get_id(rdev));565565+ set_bit(rdev_get_id(rdev), s2mps11->suspend_state);568566 /*569567 * Don't enable suspend mode if regulator is already disabled because570568 * this would effectively for a short time turn on the regulator after···962960 case S2MPS11X:963961 s2mps11->rdev_num = ARRAY_SIZE(s2mps11_regulators);964962 regulators = s2mps11_regulators;963963+ BUILD_BUG_ON(S2MPS_REGULATOR_MAX < s2mps11->rdev_num);965964 break;966965 case S2MPS13X:967966 s2mps11->rdev_num = ARRAY_SIZE(s2mps13_regulators);968967 regulators = s2mps13_regulators;968968+ BUILD_BUG_ON(S2MPS_REGULATOR_MAX < s2mps11->rdev_num);969969 break;970970 case S2MPS14X:971971 s2mps11->rdev_num = ARRAY_SIZE(s2mps14_regulators);972972 regulators = s2mps14_regulators;973973+ BUILD_BUG_ON(S2MPS_REGULATOR_MAX < s2mps11->rdev_num);973974 break;974975 case S2MPU02:975976 s2mps11->rdev_num = ARRAY_SIZE(s2mpu02_regulators);976977 regulators = s2mpu02_regulators;978978+ BUILD_BUG_ON(S2MPS_REGULATOR_MAX < s2mps11->rdev_num);977979 break;978980 default:979981 dev_err(&pdev->dev, "Invalid device type: %u\n",