Commit 482c86cc authored by YueHaibing's avatar YueHaibing Committed by Greg Kroah-Hartman

char: xillybus: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Acked-by: default avatarEli Billauer <eli.billauer@gmail.com>
Link: https://lore.kernel.org/r/20191016092546.26332-1-yuehaibing@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8670b2b8
...@@ -116,7 +116,6 @@ static int xilly_drv_probe(struct platform_device *op) ...@@ -116,7 +116,6 @@ static int xilly_drv_probe(struct platform_device *op)
struct xilly_endpoint *endpoint; struct xilly_endpoint *endpoint;
int rc; int rc;
int irq; int irq;
struct resource *res;
struct xilly_endpoint_hardware *ephw = &of_hw; struct xilly_endpoint_hardware *ephw = &of_hw;
if (of_property_read_bool(dev->of_node, "dma-coherent")) if (of_property_read_bool(dev->of_node, "dma-coherent"))
...@@ -129,9 +128,7 @@ static int xilly_drv_probe(struct platform_device *op) ...@@ -129,9 +128,7 @@ static int xilly_drv_probe(struct platform_device *op)
dev_set_drvdata(dev, endpoint); dev_set_drvdata(dev, endpoint);
res = platform_get_resource(op, IORESOURCE_MEM, 0); endpoint->registers = devm_platform_ioremap_resource(op, 0);
endpoint->registers = devm_ioremap_resource(dev, res);
if (IS_ERR(endpoint->registers)) if (IS_ERR(endpoint->registers))
return PTR_ERR(endpoint->registers); return PTR_ERR(endpoint->registers);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment