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

w1: mxc_w1: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190802134819.9088-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

YueHaibing and committed by
Greg Kroah-Hartman
b0a523fa 9e18a80c

+1 -3
+1 -3
drivers/w1/masters/mxc_w1.c
··· 92 92 { 93 93 struct mxc_w1_device *mdev; 94 94 unsigned long clkrate; 95 - struct resource *res; 96 95 unsigned int clkdiv; 97 96 int err; 98 97 ··· 119 120 dev_warn(&pdev->dev, 120 121 "Incorrect time base frequency %lu Hz\n", clkrate); 121 122 122 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 123 - mdev->regs = devm_ioremap_resource(&pdev->dev, res); 123 + mdev->regs = devm_platform_ioremap_resource(pdev, 0); 124 124 if (IS_ERR(mdev->regs)) { 125 125 err = PTR_ERR(mdev->regs); 126 126 goto out_disable_clk;