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

pinctrl: spear: Convert to devm_ioremap_resource

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Axel Lin and committed by
Linus Walleij
dff5a99c 0be9e70d

+4 -9
+4 -9
drivers/pinctrl/spear/pinctrl-spear.c
··· 367 367 if (!machdata) 368 368 return -ENODEV; 369 369 370 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 371 - if (!res) 372 - return -EINVAL; 373 - 374 370 pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL); 375 371 if (!pmx) { 376 372 dev_err(&pdev->dev, "Can't alloc spear_pmx\n"); 377 373 return -ENOMEM; 378 374 } 379 375 380 - pmx->vbase = devm_ioremap(&pdev->dev, res->start, resource_size(res)); 381 - if (!pmx->vbase) { 382 - dev_err(&pdev->dev, "Couldn't ioremap at index 0\n"); 383 - return -ENODEV; 384 - } 376 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 377 + pmx->vbase = devm_ioremap_resource(&pdev->dev, res); 378 + if (IS_ERR(pmx->vbase)) 379 + return PTR_ERR(pmx->vbase); 385 380 386 381 pmx->dev = &pdev->dev; 387 382 pmx->machdata = machdata;