hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/regulator/tps6524x-regulator.c
....@@ -137,7 +137,6 @@
137137 struct spi_device *spi;
138138 struct mutex lock;
139139 struct regulator_desc desc[N_REGULATORS];
140
- struct regulator_dev *rdev[N_REGULATORS];
141140 };
142141
143142 static int __read_reg(struct tps6524x *hw, int reg)
....@@ -565,7 +564,7 @@
565564 return read_field(hw, &info->enable);
566565 }
567566
568
-static struct regulator_ops regulator_ops = {
567
+static const struct regulator_ops regulator_ops = {
569568 .is_enabled = is_supply_enabled,
570569 .enable = enable_supply,
571570 .disable = disable_supply,
....@@ -584,6 +583,7 @@
584583 const struct supply_info *info = supply_info;
585584 struct regulator_init_data *init_data;
586585 struct regulator_config config = { };
586
+ struct regulator_dev *rdev;
587587 int i;
588588
589589 init_data = dev_get_platdata(dev);
....@@ -616,10 +616,9 @@
616616 config.init_data = init_data;
617617 config.driver_data = hw;
618618
619
- hw->rdev[i] = devm_regulator_register(dev, &hw->desc[i],
620
- &config);
621
- if (IS_ERR(hw->rdev[i]))
622
- return PTR_ERR(hw->rdev[i]);
619
+ rdev = devm_regulator_register(dev, &hw->desc[i], &config);
620
+ if (IS_ERR(rdev))
621
+ return PTR_ERR(rdev);
623622 }
624623
625624 return 0;