Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'regulator-v3.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
"Mostly driver specific fixes here, though one of them uncovered the
issue Stephen Warren fixed with multiple OF matches getting upset due
to a lack of cleanup."

* tag 'regulator-v3.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
regulator: s2mps11: fix incorrect register for buck10
regulator: clear state each invocation of of_regulator_match
regulator: max8997: Fix using wrong dev argument at various places
regulator: max77686: Fix using wrong dev argument at various places
regulator: max8907: Fix using wrong dev argument for calling of_regulator_match
regulator: max8998: fix incorrect min_uV value for ldo10
regulator: tps65910: Fix using wrong dev argument for calling of_regulator_match
regulator: tps65217: Fix using wrong dev argument for calling of_regulator_match

+40 -35
+8 -7
drivers/regulator/max77686.c
··· 379 379 }; 380 380 381 381 #ifdef CONFIG_OF 382 - static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, 382 + static int max77686_pmic_dt_parse_pdata(struct platform_device *pdev, 383 383 struct max77686_platform_data *pdata) 384 384 { 385 + struct max77686_dev *iodev = dev_get_drvdata(pdev->dev.parent); 385 386 struct device_node *pmic_np, *regulators_np; 386 387 struct max77686_regulator_data *rdata; 387 388 struct of_regulator_match rmatch; ··· 391 390 pmic_np = iodev->dev->of_node; 392 391 regulators_np = of_find_node_by_name(pmic_np, "voltage-regulators"); 393 392 if (!regulators_np) { 394 - dev_err(iodev->dev, "could not find regulators sub-node\n"); 393 + dev_err(&pdev->dev, "could not find regulators sub-node\n"); 395 394 return -EINVAL; 396 395 } 397 396 398 397 pdata->num_regulators = ARRAY_SIZE(regulators); 399 - rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * 398 + rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * 400 399 pdata->num_regulators, GFP_KERNEL); 401 400 if (!rdata) { 402 - dev_err(iodev->dev, 401 + dev_err(&pdev->dev, 403 402 "could not allocate memory for regulator data\n"); 404 403 return -ENOMEM; 405 404 } ··· 408 407 rmatch.name = regulators[i].name; 409 408 rmatch.init_data = NULL; 410 409 rmatch.of_node = NULL; 411 - of_regulator_match(iodev->dev, regulators_np, &rmatch, 1); 410 + of_regulator_match(&pdev->dev, regulators_np, &rmatch, 1); 412 411 rdata[i].initdata = rmatch.init_data; 413 412 rdata[i].of_node = rmatch.of_node; 414 413 } ··· 418 417 return 0; 419 418 } 420 419 #else 421 - static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, 420 + static int max77686_pmic_dt_parse_pdata(struct platform_device *pdev, 422 421 struct max77686_platform_data *pdata) 423 422 { 424 423 return 0; ··· 441 440 } 442 441 443 442 if (iodev->dev->of_node) { 444 - ret = max77686_pmic_dt_parse_pdata(iodev, pdata); 443 + ret = max77686_pmic_dt_parse_pdata(pdev, pdata); 445 444 if (ret) 446 445 return ret; 447 446 }
+1 -2
drivers/regulator/max8907-regulator.c
··· 237 237 return -EINVAL; 238 238 } 239 239 240 - ret = of_regulator_match(pdev->dev.parent, regulators, 241 - max8907_matches, 240 + ret = of_regulator_match(&pdev->dev, regulators, max8907_matches, 242 241 ARRAY_SIZE(max8907_matches)); 243 242 if (ret < 0) { 244 243 dev_err(&pdev->dev, "Error parsing regulator init data: %d\n",
+19 -20
drivers/regulator/max8997.c
··· 934 934 }; 935 935 936 936 #ifdef CONFIG_OF 937 - static int max8997_pmic_dt_parse_dvs_gpio(struct max8997_dev *iodev, 937 + static int max8997_pmic_dt_parse_dvs_gpio(struct platform_device *pdev, 938 938 struct max8997_platform_data *pdata, 939 939 struct device_node *pmic_np) 940 940 { ··· 944 944 gpio = of_get_named_gpio(pmic_np, 945 945 "max8997,pmic-buck125-dvs-gpios", i); 946 946 if (!gpio_is_valid(gpio)) { 947 - dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio); 947 + dev_err(&pdev->dev, "invalid gpio[%d]: %d\n", i, gpio); 948 948 return -EINVAL; 949 949 } 950 950 pdata->buck125_gpios[i] = gpio; ··· 952 952 return 0; 953 953 } 954 954 955 - static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, 955 + static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, 956 956 struct max8997_platform_data *pdata) 957 957 { 958 + struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent); 958 959 struct device_node *pmic_np, *regulators_np, *reg_np; 959 960 struct max8997_regulator_data *rdata; 960 961 unsigned int i, dvs_voltage_nr = 1, ret; 961 962 962 963 pmic_np = iodev->dev->of_node; 963 964 if (!pmic_np) { 964 - dev_err(iodev->dev, "could not find pmic sub-node\n"); 965 + dev_err(&pdev->dev, "could not find pmic sub-node\n"); 965 966 return -ENODEV; 966 967 } 967 968 968 969 regulators_np = of_find_node_by_name(pmic_np, "regulators"); 969 970 if (!regulators_np) { 970 - dev_err(iodev->dev, "could not find regulators sub-node\n"); 971 + dev_err(&pdev->dev, "could not find regulators sub-node\n"); 971 972 return -EINVAL; 972 973 } 973 974 ··· 977 976 for_each_child_of_node(regulators_np, reg_np) 978 977 pdata->num_regulators++; 979 978 980 - rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * 979 + rdata = devm_kzalloc(&pdev->dev, sizeof(*rdata) * 981 980 pdata->num_regulators, GFP_KERNEL); 982 981 if (!rdata) { 983 - dev_err(iodev->dev, "could not allocate memory for " 984 - "regulator data\n"); 982 + dev_err(&pdev->dev, "could not allocate memory for regulator data\n"); 985 983 return -ENOMEM; 986 984 } 987 985 ··· 991 991 break; 992 992 993 993 if (i == ARRAY_SIZE(regulators)) { 994 - dev_warn(iodev->dev, "don't know how to configure " 995 - "regulator %s\n", reg_np->name); 994 + dev_warn(&pdev->dev, "don't know how to configure regulator %s\n", 995 + reg_np->name); 996 996 continue; 997 997 } 998 998 999 999 rdata->id = i; 1000 - rdata->initdata = of_get_regulator_init_data( 1001 - iodev->dev, reg_np); 1000 + rdata->initdata = of_get_regulator_init_data(&pdev->dev, 1001 + reg_np); 1002 1002 rdata->reg_node = reg_np; 1003 1003 rdata++; 1004 1004 } ··· 1014 1014 1015 1015 if (pdata->buck1_gpiodvs || pdata->buck2_gpiodvs || 1016 1016 pdata->buck5_gpiodvs) { 1017 - ret = max8997_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np); 1017 + ret = max8997_pmic_dt_parse_dvs_gpio(pdev, pdata, pmic_np); 1018 1018 if (ret) 1019 1019 return -EINVAL; 1020 1020 ··· 1025 1025 } else { 1026 1026 if (pdata->buck125_default_idx >= 8) { 1027 1027 pdata->buck125_default_idx = 0; 1028 - dev_info(iodev->dev, "invalid value for " 1029 - "default dvs index, using 0 instead\n"); 1028 + dev_info(&pdev->dev, "invalid value for default dvs index, using 0 instead\n"); 1030 1029 } 1031 1030 } 1032 1031 ··· 1039 1040 if (of_property_read_u32_array(pmic_np, 1040 1041 "max8997,pmic-buck1-dvs-voltage", 1041 1042 pdata->buck1_voltage, dvs_voltage_nr)) { 1042 - dev_err(iodev->dev, "buck1 voltages not specified\n"); 1043 + dev_err(&pdev->dev, "buck1 voltages not specified\n"); 1043 1044 return -EINVAL; 1044 1045 } 1045 1046 1046 1047 if (of_property_read_u32_array(pmic_np, 1047 1048 "max8997,pmic-buck2-dvs-voltage", 1048 1049 pdata->buck2_voltage, dvs_voltage_nr)) { 1049 - dev_err(iodev->dev, "buck2 voltages not specified\n"); 1050 + dev_err(&pdev->dev, "buck2 voltages not specified\n"); 1050 1051 return -EINVAL; 1051 1052 } 1052 1053 1053 1054 if (of_property_read_u32_array(pmic_np, 1054 1055 "max8997,pmic-buck5-dvs-voltage", 1055 1056 pdata->buck5_voltage, dvs_voltage_nr)) { 1056 - dev_err(iodev->dev, "buck5 voltages not specified\n"); 1057 + dev_err(&pdev->dev, "buck5 voltages not specified\n"); 1057 1058 return -EINVAL; 1058 1059 } 1059 1060 1060 1061 return 0; 1061 1062 } 1062 1063 #else 1063 - static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev, 1064 + static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, 1064 1065 struct max8997_platform_data *pdata) 1065 1066 { 1066 1067 return 0; ··· 1084 1085 } 1085 1086 1086 1087 if (iodev->dev->of_node) { 1087 - ret = max8997_pmic_dt_parse_pdata(iodev, pdata); 1088 + ret = max8997_pmic_dt_parse_pdata(pdev, pdata); 1088 1089 if (ret) 1089 1090 return ret; 1090 1091 }
+1 -1
drivers/regulator/max8998.c
··· 65 65 .min = 2800000, .step = 100000, .max = 3100000, 66 66 }; 67 67 static const struct voltage_map_desc ldo10_voltage_map_desc = { 68 - .min = 95000, .step = 50000, .max = 1300000, 68 + .min = 950000, .step = 50000, .max = 1300000, 69 69 }; 70 70 static const struct voltage_map_desc ldo1213_voltage_map_desc = { 71 71 .min = 800000, .step = 100000, .max = 3300000,
+6
drivers/regulator/of_regulator.c
··· 120 120 if (!dev || !node) 121 121 return -EINVAL; 122 122 123 + for (i = 0; i < num_matches; i++) { 124 + struct of_regulator_match *match = &matches[i]; 125 + match->init_data = NULL; 126 + match->of_node = NULL; 127 + } 128 + 123 129 for_each_child_of_node(node, child) { 124 130 name = of_get_property(child, 125 131 "regulator-compatible", NULL);
+2 -2
drivers/regulator/s2mps11.c
··· 174 174 .min_uV = S2MPS11_BUCK_MIN2, \ 175 175 .uV_step = S2MPS11_BUCK_STEP2, \ 176 176 .n_voltages = S2MPS11_BUCK_N_VOLTAGES, \ 177 - .vsel_reg = S2MPS11_REG_B9CTRL2, \ 177 + .vsel_reg = S2MPS11_REG_B10CTRL2, \ 178 178 .vsel_mask = S2MPS11_BUCK_VSEL_MASK, \ 179 - .enable_reg = S2MPS11_REG_B9CTRL1, \ 179 + .enable_reg = S2MPS11_REG_B10CTRL1, \ 180 180 .enable_mask = S2MPS11_ENABLE_MASK \ 181 181 } 182 182
+2 -2
drivers/regulator/tps65217-regulator.c
··· 305 305 if (!regs) 306 306 return NULL; 307 307 308 - count = of_regulator_match(pdev->dev.parent, regs, 309 - reg_matches, TPS65217_NUM_REGULATOR); 308 + count = of_regulator_match(&pdev->dev, regs, reg_matches, 309 + TPS65217_NUM_REGULATOR); 310 310 of_node_put(regs); 311 311 if ((count < 0) || (count > TPS65217_NUM_REGULATOR)) 312 312 return NULL;
+1 -1
drivers/regulator/tps65910-regulator.c
··· 998 998 return NULL; 999 999 } 1000 1000 1001 - ret = of_regulator_match(pdev->dev.parent, regulators, matches, count); 1001 + ret = of_regulator_match(&pdev->dev, regulators, matches, count); 1002 1002 if (ret < 0) { 1003 1003 dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", 1004 1004 ret);