mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
9e18a80c2e
commit
b0a523fa9e
1 changed files with 1 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue