]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
regulator: tps65219: Remove debugging helper function
authorShree Ramamoorthy <s-ramamoorthy@ti.com>
Tue, 17 Dec 2024 20:45:26 +0000 (14:45 -0600)
committerMark Brown <broonie@kernel.org>
Tue, 17 Dec 2024 21:20:01 +0000 (21:20 +0000)
This helper function is primarily used by developers for debugging & is
not a standard feature included in other PMIC drivers. The purpose of
debugging function is to check if rdev is determine if the regulator has
been registered prior to requesting a threaded irq. This case is already
handled with the ISERR(rdev) check because the error code is returned.

Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
Link: https://patch.msgid.link/20241217204526.1010989-5-s-ramamoorthy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/tps65219-regulator.c

index f57a046f9deab69960c5b377b6af457c560a618d..aa65077f9d4189484412b99cf3c42a8848c3fd17 100644 (file)
@@ -287,21 +287,6 @@ static irqreturn_t tps65219_regulator_irq_handler(int irq, void *data)
        return IRQ_HANDLED;
 }
 
-static int tps65219_get_rdev_by_name(const char *regulator_name,
-                                    struct regulator_dev *rdevtbl[7],
-                                    struct regulator_dev **dev)
-{
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(regulators); i++) {
-               if (strcmp(regulator_name, regulators[i].name) == 0) {
-                       *dev = rdevtbl[i];
-                       return 0;
-               }
-       }
-       return -EINVAL;
-}
-
 static int tps65219_regulator_probe(struct platform_device *pdev)
 {
        struct tps65219 *tps = dev_get_drvdata(pdev->dev.parent);
@@ -312,23 +297,18 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
        int irq;
        struct tps65219_regulator_irq_data *irq_data;
        struct tps65219_regulator_irq_type *irq_type;
-       struct regulator_dev *rdevtbl[7];
 
        config.dev = tps->dev;
        config.driver_data = tps;
        config.regmap = tps->regmap;
 
        for (i = 0; i < ARRAY_SIZE(regulators); i++) {
-               dev_dbg(tps->dev, "%s regul i= %d START", __func__, i);
                rdev = devm_regulator_register(&pdev->dev, &regulators[i],
                                               &config);
                if (IS_ERR(rdev))
                        return dev_err_probe(tps->dev, PTR_ERR(rdev),
                                        "Failed to register %s regulator\n",
                                        regulators[i].name);
-
-               rdevtbl[i] = rdev;
-               dev_dbg(tps->dev, "%s regul i= %d COMPLETED", __func__, i);
        }
 
        irq_data = devm_kmalloc(tps->dev,
@@ -348,14 +328,6 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
                irq_data[i].dev = tps->dev;
                irq_data[i].type = irq_type;
 
-               tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, &rdev);
-               if (IS_ERR(rdev)) {
-                       dev_err(tps->dev, "Failed to get rdev for %s\n",
-                               irq_type->regulator_name);
-                       return -EINVAL;
-               }
-               irq_data[i].rdev = rdev;
-
                error = devm_request_threaded_irq(tps->dev, irq, NULL,
                                                  tps65219_regulator_irq_handler,
                                                  IRQF_ONESHOT,