Skip to content

Commit 64a6b57

Browse files
shramamoorthybroonie
authored andcommitted
regulator: tps65219: Remove debugging helper function
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>
1 parent ca321ef commit 64a6b57

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

drivers/regulator/tps65219-regulator.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -287,21 +287,6 @@ static irqreturn_t tps65219_regulator_irq_handler(int irq, void *data)
287287
return IRQ_HANDLED;
288288
}
289289

290-
static int tps65219_get_rdev_by_name(const char *regulator_name,
291-
struct regulator_dev *rdevtbl[7],
292-
struct regulator_dev **dev)
293-
{
294-
int i;
295-
296-
for (i = 0; i < ARRAY_SIZE(regulators); i++) {
297-
if (strcmp(regulator_name, regulators[i].name) == 0) {
298-
*dev = rdevtbl[i];
299-
return 0;
300-
}
301-
}
302-
return -EINVAL;
303-
}
304-
305290
static int tps65219_regulator_probe(struct platform_device *pdev)
306291
{
307292
struct tps65219 *tps = dev_get_drvdata(pdev->dev.parent);
@@ -312,23 +297,18 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
312297
int irq;
313298
struct tps65219_regulator_irq_data *irq_data;
314299
struct tps65219_regulator_irq_type *irq_type;
315-
struct regulator_dev *rdevtbl[7];
316300

317301
config.dev = tps->dev;
318302
config.driver_data = tps;
319303
config.regmap = tps->regmap;
320304

321305
for (i = 0; i < ARRAY_SIZE(regulators); i++) {
322-
dev_dbg(tps->dev, "%s regul i= %d START", __func__, i);
323306
rdev = devm_regulator_register(&pdev->dev, &regulators[i],
324307
&config);
325308
if (IS_ERR(rdev))
326309
return dev_err_probe(tps->dev, PTR_ERR(rdev),
327310
"Failed to register %s regulator\n",
328311
regulators[i].name);
329-
330-
rdevtbl[i] = rdev;
331-
dev_dbg(tps->dev, "%s regul i= %d COMPLETED", __func__, i);
332312
}
333313

334314
irq_data = devm_kmalloc(tps->dev,
@@ -348,14 +328,6 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
348328
irq_data[i].dev = tps->dev;
349329
irq_data[i].type = irq_type;
350330

351-
tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, &rdev);
352-
if (IS_ERR(rdev)) {
353-
dev_err(tps->dev, "Failed to get rdev for %s\n",
354-
irq_type->regulator_name);
355-
return -EINVAL;
356-
}
357-
irq_data[i].rdev = rdev;
358-
359331
error = devm_request_threaded_irq(tps->dev, irq, NULL,
360332
tps65219_regulator_irq_handler,
361333
IRQF_ONESHOT,

0 commit comments

Comments
 (0)