Skip to content

Commit 46bec7a

Browse files
Mukesh Ojhadtor
authored andcommitted
Input: mxs-lradc-ts - use devm_platform_ioremap_resource()
devm_platform_ioremap_resource() internally have platform_get_resource() and devm_ioremap_resource() in it. So instead of calling them separately use devm_platform_ioremap_resource() directly. Signed-off-by: Mukesh Ojha <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 9d41cbe commit 46bec7a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/input/touchscreen/mxs-lradc-ts.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,6 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
606606
struct device_node *node = dev->parent->of_node;
607607
struct mxs_lradc *lradc = dev_get_drvdata(dev->parent);
608608
struct mxs_lradc_ts *ts;
609-
struct resource *iores;
610609
int ret, irq, virq, i;
611610
u32 ts_wires = 0, adapt;
612611

@@ -620,12 +619,9 @@ static int mxs_lradc_ts_probe(struct platform_device *pdev)
620619
ts->dev = dev;
621620
spin_lock_init(&ts->lock);
622621

623-
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
624-
if (!iores)
625-
return -EINVAL;
626-
ts->base = devm_ioremap(dev, iores->start, resource_size(iores));
627-
if (!ts->base)
628-
return -ENOMEM;
622+
ts->base = devm_platform_ioremap_resource(pdev, 0);
623+
if (IS_ERR(ts->base))
624+
return PTR_ERR(ts->base);
629625

630626
ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
631627
&ts_wires);

0 commit comments

Comments
 (0)