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

MIPS: OCTEON: octeon-usb: Use devm_platform_get_and_ioremap_resource()

Remove unneeded error handling on the result of a call
to platform_get_resource() when the value is passed to
devm_ioremap_resource().

And use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Yang Yingliang and committed by
Thomas Bogendoerfer
f9cd46a4 ed914d48

+1 -8
+1 -8
arch/mips/cavium-octeon/octeon-usb.c
··· 516 516 if (!pdev) 517 517 return -ENODEV; 518 518 519 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 520 - if (res == NULL) { 521 - put_device(&pdev->dev); 522 - dev_err(&pdev->dev, "No memory resources\n"); 523 - return -ENXIO; 524 - } 525 - 526 519 /* 527 520 * The code below maps in the registers necessary for 528 521 * setting up the clocks and reseting PHYs. We must 529 522 * release the resources so the dwc3 subsystem doesn't 530 523 * know the difference. 531 524 */ 532 - base = devm_ioremap_resource(&pdev->dev, res); 525 + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); 533 526 if (IS_ERR(base)) { 534 527 put_device(&pdev->dev); 535 528 return PTR_ERR(base);