hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/regulator/max8997-regulator.c
....@@ -732,7 +732,7 @@
732732 return max8997_update_reg(i2c, reg, ~pattern, mask);
733733 }
734734
735
-static struct regulator_ops max8997_ldo_ops = {
735
+static const struct regulator_ops max8997_ldo_ops = {
736736 .list_voltage = max8997_list_voltage,
737737 .is_enabled = max8997_reg_is_enabled,
738738 .enable = max8997_reg_enable,
....@@ -742,7 +742,7 @@
742742 .set_suspend_disable = max8997_reg_disable_suspend,
743743 };
744744
745
-static struct regulator_ops max8997_buck_ops = {
745
+static const struct regulator_ops max8997_buck_ops = {
746746 .list_voltage = max8997_list_voltage,
747747 .is_enabled = max8997_reg_is_enabled,
748748 .enable = max8997_reg_enable,
....@@ -753,7 +753,7 @@
753753 .set_suspend_disable = max8997_reg_disable_suspend,
754754 };
755755
756
-static struct regulator_ops max8997_fixedvolt_ops = {
756
+static const struct regulator_ops max8997_fixedvolt_ops = {
757757 .list_voltage = max8997_list_voltage,
758758 .is_enabled = max8997_reg_is_enabled,
759759 .enable = max8997_reg_enable,
....@@ -761,7 +761,7 @@
761761 .set_suspend_disable = max8997_reg_disable_suspend,
762762 };
763763
764
-static struct regulator_ops max8997_safeout_ops = {
764
+static const struct regulator_ops max8997_safeout_ops = {
765765 .list_voltage = regulator_list_voltage_table,
766766 .is_enabled = max8997_reg_is_enabled,
767767 .enable = max8997_reg_enable,
....@@ -771,7 +771,7 @@
771771 .set_suspend_disable = max8997_reg_disable_suspend,
772772 };
773773
774
-static struct regulator_ops max8997_fixedstate_ops = {
774
+static const struct regulator_ops max8997_fixedstate_ops = {
775775 .list_voltage = max8997_list_voltage_charger_cv,
776776 .get_voltage_sel = max8997_get_voltage_sel,
777777 .set_voltage = max8997_set_voltage_charger_cv,
....@@ -805,7 +805,7 @@
805805 return max8997_list_voltage(rdev, sel);
806806 }
807807
808
-static struct regulator_ops max8997_charger_ops = {
808
+static const struct regulator_ops max8997_charger_ops = {
809809 .is_enabled = max8997_reg_is_enabled,
810810 .enable = max8997_reg_enable,
811811 .disable = max8997_reg_disable,
....@@ -813,7 +813,7 @@
813813 .set_current_limit = max8997_set_current_limit,
814814 };
815815
816
-static struct regulator_ops max8997_charger_fixedstate_ops = {
816
+static const struct regulator_ops max8997_charger_fixedstate_ops = {
817817 .get_current_limit = max8997_get_current_limit,
818818 .set_current_limit = max8997_set_current_limit,
819819 };
....@@ -925,12 +925,12 @@
925925 pdata->regulators = rdata;
926926 for_each_child_of_node(regulators_np, reg_np) {
927927 for (i = 0; i < ARRAY_SIZE(regulators); i++)
928
- if (!of_node_cmp(reg_np->name, regulators[i].name))
928
+ if (of_node_name_eq(reg_np, regulators[i].name))
929929 break;
930930
931931 if (i == ARRAY_SIZE(regulators)) {
932
- dev_warn(&pdev->dev, "don't know how to configure regulator %s\n",
933
- reg_np->name);
932
+ dev_warn(&pdev->dev, "don't know how to configure regulator %pOFn\n",
933
+ reg_np);
934934 continue;
935935 }
936936