Skip to content

Commit 12b1114

Browse files
ye xingchendtor
authored andcommitted
Input: apbps2 - use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 6cb86b0 commit 12b1114

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/input/serio/apbps2.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ static int apbps2_of_probe(struct platform_device *ofdev)
132132
struct apbps2_priv *priv;
133133
int irq, err;
134134
u32 freq_hz;
135-
struct resource *res;
136135

137136
priv = devm_kzalloc(&ofdev->dev, sizeof(*priv), GFP_KERNEL);
138137
if (!priv) {
@@ -141,8 +140,7 @@ static int apbps2_of_probe(struct platform_device *ofdev)
141140
}
142141

143142
/* Find Device Address */
144-
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
145-
priv->regs = devm_ioremap_resource(&ofdev->dev, res);
143+
priv->regs = devm_platform_get_and_ioremap_resource(ofdev, 0, NULL);
146144
if (IS_ERR(priv->regs))
147145
return PTR_ERR(priv->regs);
148146

0 commit comments

Comments
 (0)