Skip to content

Commit 877c76d

Browse files
krzkKAGA-KOKO
authored andcommitted
irqchip: keystone: Use syscon_regmap_lookup_by_phandle_args
Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over syscon_regmap_lookup_by_phandle() combined with getting the syscon argument. Except simpler code this annotates within one line that given phandle has arguments, so grepping for code would be easier. There is also no real benefit in printing errors on missing syscon argument, because this is done just too late: runtime check on static/build-time data. Dtschema and Devicetree bindings offer the static/build-time check for this already. Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent b4706d8 commit 877c76d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/irqchip/irq-keystone.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,11 @@ static int keystone_irq_probe(struct platform_device *pdev)
141141
if (!kirq)
142142
return -ENOMEM;
143143

144-
kirq->devctrl_regs =
145-
syscon_regmap_lookup_by_phandle(np, "ti,syscon-dev");
144+
kirq->devctrl_regs = syscon_regmap_lookup_by_phandle_args(np, "ti,syscon-dev",
145+
1, &kirq->devctrl_offset);
146146
if (IS_ERR(kirq->devctrl_regs))
147147
return PTR_ERR(kirq->devctrl_regs);
148148

149-
ret = of_property_read_u32_index(np, "ti,syscon-dev", 1,
150-
&kirq->devctrl_offset);
151-
if (ret) {
152-
dev_err(dev, "couldn't read the devctrl_offset offset!\n");
153-
return ret;
154-
}
155-
156149
kirq->irq = platform_get_irq(pdev, 0);
157150
if (kirq->irq < 0)
158151
return kirq->irq;

0 commit comments

Comments
 (0)