.. | .. |
---|
137 | 137 | struct spi_device *spi; |
---|
138 | 138 | struct mutex lock; |
---|
139 | 139 | struct regulator_desc desc[N_REGULATORS]; |
---|
140 | | - struct regulator_dev *rdev[N_REGULATORS]; |
---|
141 | 140 | }; |
---|
142 | 141 | |
---|
143 | 142 | static int __read_reg(struct tps6524x *hw, int reg) |
---|
.. | .. |
---|
565 | 564 | return read_field(hw, &info->enable); |
---|
566 | 565 | } |
---|
567 | 566 | |
---|
568 | | -static struct regulator_ops regulator_ops = { |
---|
| 567 | +static const struct regulator_ops regulator_ops = { |
---|
569 | 568 | .is_enabled = is_supply_enabled, |
---|
570 | 569 | .enable = enable_supply, |
---|
571 | 570 | .disable = disable_supply, |
---|
.. | .. |
---|
584 | 583 | const struct supply_info *info = supply_info; |
---|
585 | 584 | struct regulator_init_data *init_data; |
---|
586 | 585 | struct regulator_config config = { }; |
---|
| 586 | + struct regulator_dev *rdev; |
---|
587 | 587 | int i; |
---|
588 | 588 | |
---|
589 | 589 | init_data = dev_get_platdata(dev); |
---|
.. | .. |
---|
616 | 616 | config.init_data = init_data; |
---|
617 | 617 | config.driver_data = hw; |
---|
618 | 618 | |
---|
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); |
---|
623 | 622 | } |
---|
624 | 623 | |
---|
625 | 624 | return 0; |
---|