diff --git a/drivers/regulator/ad5398.c b/drivers/regulator/ad5398.c index 7d51793a072a5c530ea336aa772ce460b2112435..9ba69c431da8e0050ab758d4e9399d11df9a9252 100644 --- a/drivers/regulator/ad5398.c +++ b/drivers/regulator/ad5398.c @@ -184,7 +184,7 @@ static struct regulator_ops ad5398_ops = { .is_enabled = ad5398_is_enabled, }; -static struct regulator_desc ad5398_reg = { +static const struct regulator_desc ad5398_reg = { .name = "isink", .id = 0, .ops = &ad5398_ops, diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index c056abd7562a29b91666083371d888a698b85eef..c4b626789f8eb84895ef5cb7d39aab4720b7f608 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2829,7 +2829,8 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) * Called by regulator drivers to register a regulator. * Returns 0 on success. */ -struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, +struct regulator_dev * +regulator_register(const struct regulator_desc *regulator_desc, struct device *dev, const struct regulator_init_data *init_data, void *driver_data, struct device_node *of_node) { diff --git a/drivers/regulator/isl6271a-regulator.c b/drivers/regulator/isl6271a-regulator.c index 6539ef9337cf77c1876b18a53e72ff14bdbee4ae..eee6f6b85ebcf6c7fef90fdca91ec36349a95bbc 100644 --- a/drivers/regulator/isl6271a-regulator.c +++ b/drivers/regulator/isl6271a-regulator.c @@ -112,7 +112,7 @@ static struct regulator_ops isl_fixed_ops = { .list_voltage = isl6271a_list_fixed_voltage, }; -static struct regulator_desc isl_rd[] = { +static const struct regulator_desc isl_rd[] = { { .name = "Core Buck", .id = 0, diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c index 2013525f4bf9b08874c11615198c6929ed960634..499986e00fb200a9880930f2a63686d90c681277 100644 --- a/drivers/regulator/lp3971.c +++ b/drivers/regulator/lp3971.c @@ -281,7 +281,7 @@ static struct regulator_ops lp3971_dcdc_ops = { .set_voltage_sel = lp3971_dcdc_set_voltage_sel, }; -static struct regulator_desc regulators[] = { +static const struct regulator_desc regulators[] = { { .name = "LDO1", .id = LP3971_LDO1, diff --git a/drivers/regulator/lp3972.c b/drivers/regulator/lp3972.c index 4f28d36600a5754506229eca86c2bdd3bf4f663b..fbe3a58a71f2435cf893399625969d7eb15a647d 100644 --- a/drivers/regulator/lp3972.c +++ b/drivers/regulator/lp3972.c @@ -444,7 +444,7 @@ static struct regulator_ops lp3972_dcdc_ops = { .set_voltage_sel = lp3972_dcdc_set_voltage_sel, }; -static struct regulator_desc regulators[] = { +static const struct regulator_desc regulators[] = { { .name = "LDO1", .id = LP3972_LDO1, diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index 282d2ee0604eb89eb16ea2b56e97bff02f50c76c..fad0bee10c54340a8e0fd65cc162377ca8fb3b52 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c @@ -161,7 +161,7 @@ static struct regulator_ops max1586_v6_ops = { .list_voltage = max1586_v6_list, }; -static struct regulator_desc max1586_reg[] = { +static const struct regulator_desc max1586_reg[] = { { .name = "Output_V3", .id = MAX1586_V3, diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c index 2e9ffbec2e3b966fab050049539370059b4498b0..dca7835b381c4e909cc8aac657741ee0ca0e05b8 100644 --- a/drivers/regulator/max8649.c +++ b/drivers/regulator/max8649.c @@ -207,7 +207,7 @@ static struct regulator_ops max8649_dcdc_ops = { }; -static struct regulator_desc dcdc_desc = { +static const struct regulator_desc dcdc_desc = { .name = "max8649", .ops = &max8649_dcdc_ops, .type = REGULATOR_VOLTAGE, diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c index e42db5364ca500c833397df511bdd2d41e862d14..0e327871fd0e660d276729e94b4a546da4eb0483 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c @@ -313,7 +313,7 @@ static struct regulator_ops max8660_ldo67_ops = { .set_voltage = max8660_ldo67_set, }; -static struct regulator_desc max8660_reg[] = { +static const struct regulator_desc max8660_reg[] = { { .name = "V3(DCDC)", .id = MAX8660_V3, diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c index c35236a06cbb7879f825f9b4bfa91fe931160b49..b4084314c222e85e5b67ea9e07adba3c492092e7 100644 --- a/drivers/regulator/max8952.c +++ b/drivers/regulator/max8952.c @@ -159,7 +159,7 @@ static struct regulator_ops max8952_ops = { .set_suspend_disable = max8952_disable, }; -static struct regulator_desc regulator = { +static const struct regulator_desc regulator = { .name = "MAX8952_VOUT", .id = 0, .n_voltages = MAX8952_NUM_DVS_MODE, diff --git a/drivers/regulator/pcap-regulator.c b/drivers/regulator/pcap-regulator.c index 781bf343453b21a224a2bb93cbfe3bb0aac14cc1..b55128db07ccc26861e1f445642a13885a5fc43e 100644 --- a/drivers/regulator/pcap-regulator.c +++ b/drivers/regulator/pcap-regulator.c @@ -241,7 +241,7 @@ static struct regulator_ops pcap_regulator_ops = { .owner = THIS_MODULE, \ } -static struct regulator_desc pcap_regulators[] = { +static const struct regulator_desc pcap_regulators[] = { VREG(V1), VREG(V2), VREG(V3), VREG(V4), VREG(V5), VREG(V6), VREG(V7), VREG(V8), VREG(V9), VREG(V10), VREG(VAUX1), VREG(VAUX2), VREG(VAUX3), VREG(VAUX4), VREG(VSIM), VREG(VSIM2), VREG(VVIB), VREG(SW1), VREG(SW2), diff --git a/drivers/regulator/pcf50633-regulator.c b/drivers/regulator/pcf50633-regulator.c index b62f4c856821d9010a9bb370b9998e22b1efe113..43163f14bec73bdef103856573e0a4e26ee05e44 100644 --- a/drivers/regulator/pcf50633-regulator.c +++ b/drivers/regulator/pcf50633-regulator.c @@ -267,7 +267,7 @@ static struct regulator_ops pcf50633_regulator_ops = { .is_enabled = pcf50633_regulator_is_enabled, }; -static struct regulator_desc regulators[] = { +static const struct regulator_desc regulators[] = { [PCF50633_REGULATOR_AUTO] = PCF50633_REGULATOR("auto", PCF50633_REGULATOR_AUTO, 128), [PCF50633_REGULATOR_DOWN1] = diff --git a/drivers/regulator/tps6105x-regulator.c b/drivers/regulator/tps6105x-regulator.c index d9278da18a9e9cede299722093977e2c572ccd3d..3b788977cb7258b5d8b5eb9fb52366fd6b6196d3 100644 --- a/drivers/regulator/tps6105x-regulator.c +++ b/drivers/regulator/tps6105x-regulator.c @@ -123,7 +123,7 @@ static struct regulator_ops tps6105x_regulator_ops = { .list_voltage = tps6105x_regulator_list_voltage, }; -static struct regulator_desc tps6105x_regulator_desc = { +static const struct regulator_desc tps6105x_regulator_desc = { .name = "tps6105x-boost", .ops = &tps6105x_regulator_ops, .type = REGULATOR_VOLTAGE, diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c index e39521b427723179f192fecbbba69ee50d2d7e06..80fad2d3479e9bc32d91f92a1f63ce1ef948240e 100644 --- a/drivers/regulator/tps65217-regulator.c +++ b/drivers/regulator/tps65217-regulator.c @@ -312,7 +312,7 @@ static struct regulator_ops tps65217_pmic_ldo1_ops = { .list_voltage = tps65217_pmic_list_voltage, }; -static struct regulator_desc regulators[] = { +static const struct regulator_desc regulators[] = { TPS65217_REGULATOR("DCDC1", TPS65217_DCDC_1, tps65217_pmic_ops, 64), TPS65217_REGULATOR("DCDC2", TPS65217_DCDC_2, tps65217_pmic_ops, 64), TPS65217_REGULATOR("DCDC3", TPS65217_DCDC_3, tps65217_pmic_ops, 64), diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index ab1e183a74b51e3fcf779b4a07782d935e683105..552b1edf8091ac23ed10ca62941b479e31bedf99 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c @@ -1269,7 +1269,7 @@ static struct regulator_ops wm8350_isink_ops = { .enable_time = wm8350_isink_enable_time, }; -static struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = { +static const struct regulator_desc wm8350_reg[NUM_WM8350_REGULATORS] = { { .name = "DCDC1", .id = WM8350_DCDC_1, diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index 75ed402d9f43587553790bdf9b17f7aa15fc56b6..8a4897a35f28af1b869545a56da20d6a8a4a98eb 100644 --- a/drivers/regulator/wm8994-regulator.c +++ b/drivers/regulator/wm8994-regulator.c @@ -209,7 +209,7 @@ static struct regulator_ops wm8994_ldo2_ops = { .set_voltage = wm8994_ldo2_set_voltage, }; -static struct regulator_desc wm8994_ldo_desc[] = { +static const struct regulator_desc wm8994_ldo_desc[] = { { .name = "LDO1", .id = 1, diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index fa8b55b8191c980de60c32b5e1b3fe1d3016340f..1dcdf00e0db28e467b159b37f4e3fe247ea83c77 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -184,7 +184,7 @@ struct regulator_desc { * no other direct access). */ struct regulator_dev { - struct regulator_desc *desc; + const struct regulator_desc *desc; int exclusive; u32 use_count; u32 open_count; @@ -210,7 +210,8 @@ struct regulator_dev { struct dentry *debugfs; }; -struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, +struct regulator_dev * +regulator_register(const struct regulator_desc *regulator_desc, struct device *dev, const struct regulator_init_data *init_data, void *driver_data, struct device_node *of_node); void regulator_unregister(struct regulator_dev *rdev);