forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-20 ea08eeccae9297f7aabd2ef7f0c2517ac4549acc
kernel/drivers/regulator/isl6271a-regulator.c
....@@ -31,7 +31,6 @@
3131 /* PMIC details */
3232 struct isl_pmic {
3333 struct i2c_client *client;
34
- struct regulator_dev *rdev[3];
3534 struct mutex mtx;
3635 };
3736
....@@ -66,14 +65,14 @@
6665 return err;
6766 }
6867
69
-static struct regulator_ops isl_core_ops = {
68
+static const struct regulator_ops isl_core_ops = {
7069 .get_voltage_sel = isl6271a_get_voltage_sel,
7170 .set_voltage_sel = isl6271a_set_voltage_sel,
7271 .list_voltage = regulator_list_voltage_linear,
7372 .map_voltage = regulator_map_voltage_linear,
7473 };
7574
76
-static struct regulator_ops isl_fixed_ops = {
75
+static const struct regulator_ops isl_fixed_ops = {
7776 .list_voltage = regulator_list_voltage_linear,
7877 };
7978
....@@ -109,6 +108,7 @@
109108 static int isl6271a_probe(struct i2c_client *i2c,
110109 const struct i2c_device_id *id)
111110 {
111
+ struct regulator_dev *rdev;
112112 struct regulator_config config = { };
113113 struct regulator_init_data *init_data = dev_get_platdata(&i2c->dev);
114114 struct isl_pmic *pmic;
....@@ -133,11 +133,10 @@
133133 config.init_data = NULL;
134134 config.driver_data = pmic;
135135
136
- pmic->rdev[i] = devm_regulator_register(&i2c->dev, &isl_rd[i],
137
- &config);
138
- if (IS_ERR(pmic->rdev[i])) {
136
+ rdev = devm_regulator_register(&i2c->dev, &isl_rd[i], &config);
137
+ if (IS_ERR(rdev)) {
139138 dev_err(&i2c->dev, "failed to register %s\n", id->name);
140
- return PTR_ERR(pmic->rdev[i]);
139
+ return PTR_ERR(rdev);
141140 }
142141 }
143142