mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
serial: 8250_omap: Switch to use platform_get_irq()
platform_get_irq() provides an established error code and error message. Also, it's better to use dedicated API to retrieve Linux IRQ resource. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200618122024.87170-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2a1dbd259e
commit
9167cc78bd
1 changed files with 10 additions and 6 deletions
|
@ -1209,17 +1209,21 @@ MODULE_DEVICE_TABLE(of, omap8250_dt_ids);
|
|||
|
||||
static int omap8250_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
struct resource *irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct omap8250_priv *priv;
|
||||
const struct omap8250_platdata *pdata;
|
||||
struct uart_8250_port up;
|
||||
int ret;
|
||||
struct resource *regs;
|
||||
void __iomem *membase;
|
||||
int irq, ret;
|
||||
|
||||
if (!regs || !irq) {
|
||||
dev_err(&pdev->dev, "missing registers or irq\n");
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!regs) {
|
||||
dev_err(&pdev->dev, "missing registers\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1236,7 +1240,7 @@ static int omap8250_probe(struct platform_device *pdev)
|
|||
up.port.dev = &pdev->dev;
|
||||
up.port.mapbase = regs->start;
|
||||
up.port.membase = membase;
|
||||
up.port.irq = irq->start;
|
||||
up.port.irq = irq;
|
||||
/*
|
||||
* It claims to be 16C750 compatible however it is a little different.
|
||||
* It has EFR and has no FCR7_64byte bit. The AFE (which it claims to
|
||||
|
|
Loading…
Reference in a new issue