diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-08-02 21:48:19 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-05 17:56:46 +0200 |
commit | b0a523fa9e9d61febb9e817f07b28927190c3c2f (patch) | |
tree | ed9b0a146925dd264697ae3341f102484ad00444 /drivers/w1/masters/mxc_w1.c | |
parent | 9e18a80c2e06c154c9c745091f7caec487423519 (diff) | |
download | talos-op-linux-b0a523fa9e9d61febb9e817f07b28927190c3c2f.tar.gz talos-op-linux-b0a523fa9e9d61febb9e817f07b28927190c3c2f.zip |
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>
Diffstat (limited to 'drivers/w1/masters/mxc_w1.c')
-rw-r--r-- | drivers/w1/masters/mxc_w1.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c index c3b2095ef6a9..1ca880e01476 100644 --- a/drivers/w1/masters/mxc_w1.c +++ b/drivers/w1/masters/mxc_w1.c @@ -92,7 +92,6 @@ static int mxc_w1_probe(struct platform_device *pdev) { struct mxc_w1_device *mdev; unsigned long clkrate; - struct resource *res; unsigned int clkdiv; int err; @@ -120,8 +119,7 @@ static int mxc_w1_probe(struct platform_device *pdev) dev_warn(&pdev->dev, "Incorrect time base frequency %lu Hz\n", clkrate); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mdev->regs = devm_ioremap_resource(&pdev->dev, res); + mdev->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mdev->regs)) { err = PTR_ERR(mdev->regs); goto out_disable_clk; |