Skip to content

Commit fcc7f3b

Browse files
andredlag-linaro
authored andcommitted
mfd: sec-irq: s2dos05 doesn't support interrupts
The commit bf231e5 ("mfd: sec-core: Add support for the Samsung s2dos05") adding s2dos05 support didn't add anything related to IRQ support, so I assume this works without IRQs. Rather than printing a warning message in sec_irq_init() due to the missing IRQ number, or returning an error due to a missing irq chip regmap, just return early explicitly. This will become particularly important once errors from sec_irq_init() aren't ignored anymore in an upcoming patch and helps the reader of this code while reasoning about what the intention might be here. Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: André Draszik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 1cea1b6 commit fcc7f3b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/mfd/sec-irq.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,16 +452,12 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
452452
int type = sec_pmic->device_type;
453453
const struct regmap_irq_chip *sec_irq_chip;
454454

455-
if (!sec_pmic->irq) {
456-
dev_warn(sec_pmic->dev,
457-
"No interrupt specified, no interrupts\n");
458-
return 0;
459-
}
460-
461455
switch (type) {
462456
case S5M8767X:
463457
sec_irq_chip = &s5m8767_irq_chip;
464458
break;
459+
case S2DOS05:
460+
return 0;
465461
case S2MPA01:
466462
sec_irq_chip = &s2mps14_irq_chip;
467463
break;
@@ -492,6 +488,12 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
492488
sec_pmic->device_type);
493489
}
494490

491+
if (!sec_pmic->irq) {
492+
dev_warn(sec_pmic->dev,
493+
"No interrupt specified, no interrupts\n");
494+
return 0;
495+
}
496+
495497
ret = devm_regmap_add_irq_chip(sec_pmic->dev, sec_pmic->regmap_pmic,
496498
sec_pmic->irq, IRQF_ONESHOT,
497499
0, sec_irq_chip, &sec_pmic->irq_data);

0 commit comments

Comments
 (0)