mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 19:43:40 +02:00
serial: 8250_ni: Switch to use platform_get_mem_or_io()
Switch to use new platform_get_mem_or_io() instead of home grown analogue. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Chaitanya Vadrevu <chaitanya.vadrevu@emerson.com> Reviewed-by: Chaitanya Vadrevu <chaitanya.vadrevu@emerson.com> Link: https://lore.kernel.org/r/20250321182119.454507-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9b4a192adf
commit
b4694a7618
|
|
@ -224,26 +224,26 @@ static int ni16550_get_regs(struct platform_device *pdev,
|
|||
{
|
||||
struct resource *regs;
|
||||
|
||||
regs = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
if (regs) {
|
||||
regs = platform_get_mem_or_io(pdev, 0);
|
||||
if (!regs)
|
||||
return dev_err_probe(&pdev->dev, -EINVAL, "no registers defined\n");
|
||||
|
||||
switch (resource_type(regs)) {
|
||||
case IORESOURCE_IO:
|
||||
port->iotype = UPIO_PORT;
|
||||
port->iobase = regs->start;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (regs) {
|
||||
case IORESOURCE_MEM:
|
||||
port->iotype = UPIO_MEM;
|
||||
port->mapbase = regs->start;
|
||||
port->mapsize = resource_size(regs);
|
||||
port->flags |= UPF_IOREMAP;
|
||||
|
||||
return 0;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dev_err(&pdev->dev, "no registers defined\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user