]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
regulator: Use of_node_name_eq for node name comparisons
authorRob Herring <robh@kernel.org>
Wed, 5 Dec 2018 19:50:37 +0000 (13:50 -0600)
committerMark Brown <broonie@kernel.org>
Thu, 6 Dec 2018 19:56:51 +0000 (19:56 +0000)
Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.

For instances using of_node_cmp, this has the side effect of now using
case sensitive comparisons. This should not matter for any FDT based
system which all of these are.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Support Opensource <support.opensource@diasemi.com>
Cc: Sangbeom Kim <sbkim73@samsung.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/88pm8607.c
drivers/regulator/da9052-regulator.c
drivers/regulator/max8997-regulator.c
drivers/regulator/mc13xxx-regulator-core.c
drivers/regulator/qcom-rpmh-regulator.c
drivers/regulator/s5m8767.c

index fd86446e499b23057a4def120b3baa02e1950c2d..28f55248eb9033bc2b2d0ee00fd2b39eaee65799 100644 (file)
@@ -328,7 +328,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
                return -ENODEV;
        }
        for_each_child_of_node(nproot, np) {
-               if (!of_node_cmp(np->name, info->desc.name)) {
+               if (of_node_name_eq(np, info->desc.name)) {
                        config->init_data =
                                of_get_regulator_init_data(&pdev->dev, np,
                                                           &info->desc);
index 37e4025203e34949c42edeb09378caa06d7f4ddc..207cb3859dcc664229dc2d39c592dea82f0a1dde 100644 (file)
@@ -435,7 +435,7 @@ static int da9052_regulator_probe(struct platform_device *pdev)
                        return -ENODEV;
 
                for_each_child_of_node(nproot, np) {
-                       if (!of_node_cmp(np->name,
+                       if (of_node_name_eq(np,
                                         regulator->info->reg_desc.name)) {
                                config.init_data = of_get_regulator_init_data(
                                        &pdev->dev, np,
index 3bf5ddfaaea89d0cbebc5e70588759a8aa5b7d1a..4d2487279a0a01bb93e3d901397458358459166c 100644 (file)
@@ -925,7 +925,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
        pdata->regulators = rdata;
        for_each_child_of_node(regulators_np, reg_np) {
                for (i = 0; i < ARRAY_SIZE(regulators); i++)
-                       if (!of_node_cmp(reg_np->name, regulators[i].name))
+                       if (of_node_name_eq(reg_np, regulators[i].name))
                                break;
 
                if (i == ARRAY_SIZE(regulators)) {
index 65eb1e0350cfd3dc3f6df6d167bcf5e70a52fa2c..2243138d8a58062821a401ac518c3b2ef1f2bd84 100644 (file)
@@ -186,7 +186,7 @@ struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt(
                for (i = 0; i < num_regulators; i++) {
                        if (!regulators[i].desc.name)
                                continue;
-                       if (!of_node_cmp(child->name,
+                       if (of_node_name_eq(child,
                                         regulators[i].desc.name)) {
                                p->id = i;
                                p->init_data = of_get_regulator_init_data(
index 39ccf53fdeb38f1d7f039a47e4cc5baaad981b56..b2c2d01d1637060192f0d1554f201d276ef1b901 100644 (file)
@@ -410,7 +410,7 @@ static int rpmh_regulator_init_vreg(struct rpmh_vreg *vreg, struct device *dev,
        vreg->dev = dev;
 
        for (rpmh_data = pmic_rpmh_data; rpmh_data->name; rpmh_data++)
-               if (!strcmp(rpmh_data->name, node->name))
+               if (of_node_name_eq(node, rpmh_data->name))
                        break;
 
        if (!rpmh_data->name) {
index 219b9afda0cb937c6cecd424c7481b339348c4d1..654f65abcb5a0cf17d896297a504b09e16a9c79c 100644 (file)
@@ -561,7 +561,7 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
        pdata->opmode = rmode;
        for_each_child_of_node(regulators_np, reg_np) {
                for (i = 0; i < ARRAY_SIZE(regulators); i++)
-                       if (!of_node_cmp(reg_np->name, regulators[i].name))
+                       if (of_node_name_eq(reg_np, regulators[i].name))
                                break;
 
                if (i == ARRAY_SIZE(regulators)) {