Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: YueHaibing <yuehaibing@huawei.com>
Acked-by: Eli Billauer <eli.billauer@gmail.com>
Link: https://lore.kernel.org/r/20191016092546.26332-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

YueHaibing and committed by
Greg Kroah-Hartman
482c86cc 8670b2b8

+1 -4
+1 -4
drivers/char/xillybus/xillybus_of.c
··· 116 116 struct xilly_endpoint *endpoint; 117 117 int rc; 118 118 int irq; 119 - struct resource *res; 120 119 struct xilly_endpoint_hardware *ephw = &of_hw; 121 120 122 121 if (of_property_read_bool(dev->of_node, "dma-coherent")) ··· 128 129 129 130 dev_set_drvdata(dev, endpoint); 130 131 131 - res = platform_get_resource(op, IORESOURCE_MEM, 0); 132 - endpoint->registers = devm_ioremap_resource(dev, res); 133 - 132 + endpoint->registers = devm_platform_ioremap_resource(op, 0); 134 133 if (IS_ERR(endpoint->registers)) 135 134 return PTR_ERR(endpoint->registers); 136 135