staging: axis-fifo: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230704095543.32812-1-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
db4479215c
commit
405f3d102c
@ -839,16 +839,8 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
||||
* ----------------------------
|
||||
*/
|
||||
|
||||
/* get iospace for the device */
|
||||
r_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!r_mem) {
|
||||
dev_err(fifo->dt_device, "invalid address\n");
|
||||
rc = -ENODEV;
|
||||
goto err_initial;
|
||||
}
|
||||
|
||||
/* request physical memory */
|
||||
fifo->base_addr = devm_ioremap_resource(fifo->dt_device, r_mem);
|
||||
/* get iospace for the device and request physical memory */
|
||||
fifo->base_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem);
|
||||
if (IS_ERR(fifo->base_addr)) {
|
||||
rc = PTR_ERR(fifo->base_addr);
|
||||
goto err_initial;
|
||||
|
Loading…
x
Reference in New Issue
Block a user