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

w1: sgi_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.

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

authored by

YueHaibing and committed by
Greg Kroah-Hartman
71200fcb 3e917975

+1 -3
+1 -3
drivers/w1/masters/sgi_w1.c
··· 77 77 { 78 78 struct sgi_w1_device *sdev; 79 79 struct sgi_w1_platform_data *pdata; 80 - struct resource *res; 81 80 82 81 sdev = devm_kzalloc(&pdev->dev, sizeof(struct sgi_w1_device), 83 82 GFP_KERNEL); 84 83 if (!sdev) 85 84 return -ENOMEM; 86 85 87 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 88 - sdev->mcr = devm_ioremap_resource(&pdev->dev, res); 86 + sdev->mcr = devm_platform_ioremap_resource(pdev, 0); 89 87 if (IS_ERR(sdev->mcr)) 90 88 return PTR_ERR(sdev->mcr); 91 89