Skip to content

Commit 16d1a9b

Browse files
mwallebroonie
authored andcommitted
regulator: tps6594-regulator: remove interrupt_count
In .probe() interrupt_count and nr_types is essentially the same. It contains the number of different interrupt per LDO or buck converter. Drop one. This is a preparation patch to further simplify the handling of different variants of this PMIC. This patch is only compile-time tested. Signed-off-by: Michael Walle <[email protected]> Acked-by: Mark Brown <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0c1ff10 commit 16d1a9b

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

drivers/regulator/tps6594-regulator.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -577,18 +577,15 @@ static int tps6594_regulator_probe(struct platform_device *pdev)
577577
const struct regulator_desc *multi_regs;
578578
const struct tps6594_regulator_irq_type **ldos_irq_types;
579579
const struct regulator_desc *ldo_regs;
580-
size_t interrupt_count;
581580

582581
if (tps->chip_id == TPS65224) {
583582
bucks_irq_types = tps65224_bucks_irq_types;
584-
interrupt_count = ARRAY_SIZE(tps65224_buck1_irq_types);
585583
multi_regs = tps65224_multi_regs;
586584
ldos_irq_types = tps65224_ldos_irq_types;
587585
ldo_regs = tps65224_ldo_regs;
588586
multi_phase_cnt = ARRAY_SIZE(tps65224_multi_regs);
589587
} else {
590588
bucks_irq_types = tps6594_bucks_irq_types;
591-
interrupt_count = ARRAY_SIZE(tps6594_buck1_irq_types);
592589
multi_regs = tps6594_multi_regs;
593590
ldos_irq_types = tps6594_ldos_irq_types;
594591
ldo_regs = tps6594_ldo_regs;
@@ -686,29 +683,27 @@ static int tps6594_regulator_probe(struct platform_device *pdev)
686683

687684
error = tps6594_request_reg_irqs(pdev, rdev, irq_data,
688685
bucks_irq_types[buck_idx],
689-
interrupt_count, &irq_idx);
686+
nr_types, &irq_idx);
690687
if (error)
691688
return error;
692689

693690
error = tps6594_request_reg_irqs(pdev, rdev, irq_data,
694691
bucks_irq_types[buck_idx + 1],
695-
interrupt_count, &irq_idx);
692+
nr_types, &irq_idx);
696693
if (error)
697694
return error;
698695

699696
if (i == MULTI_BUCK123 || i == MULTI_BUCK1234) {
700697
error = tps6594_request_reg_irqs(pdev, rdev, irq_data,
701698
tps6594_bucks_irq_types[buck_idx + 2],
702-
interrupt_count,
703-
&irq_idx);
699+
nr_types, &irq_idx);
704700
if (error)
705701
return error;
706702
}
707703
if (i == MULTI_BUCK1234) {
708704
error = tps6594_request_reg_irqs(pdev, rdev, irq_data,
709705
tps6594_bucks_irq_types[buck_idx + 3],
710-
interrupt_count,
711-
&irq_idx);
706+
nr_types, &irq_idx);
712707
if (error)
713708
return error;
714709
}
@@ -727,7 +722,7 @@ static int tps6594_regulator_probe(struct platform_device *pdev)
727722
"failed to register %s regulator\n", pdev->name);
728723

729724
error = tps6594_request_reg_irqs(pdev, rdev, irq_data,
730-
bucks_irq_types[i], interrupt_count, &irq_idx);
725+
bucks_irq_types[i], nr_types, &irq_idx);
731726
if (error)
732727
return error;
733728
}
@@ -742,7 +737,7 @@ static int tps6594_regulator_probe(struct platform_device *pdev)
742737
pdev->name);
743738

744739
error = tps6594_request_reg_irqs(pdev, rdev, irq_data,
745-
ldos_irq_types[i], interrupt_count,
740+
ldos_irq_types[i], nr_types,
746741
&irq_idx);
747742
if (error)
748743
return error;

0 commit comments

Comments
 (0)