diff options
author | Jaikumar Ganesh <jaikumar@google.com> | 2010-11-19 18:23:29 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:36:44 -0800 |
commit | c7b6c4155ae8967d7872d3fbeca53d7f1e671c7b (patch) | |
tree | eaa8545083baa2f336b173dc08cce942701f338e /drivers/serial/tegra_hsuart.c | |
parent | 2795f0e625f3305a1fe91bdcfb5ca7048443bec8 (diff) |
serial: tegra_hsuart: Use resources instead of platform data.
Use resources to pass data to tegra_hsuart to set
mapbase, irq.
Signed-off-by: Jaikumar Ganesh <jaikumar@google.com>
Diffstat (limited to 'drivers/serial/tegra_hsuart.c')
-rw-r--r-- | drivers/serial/tegra_hsuart.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/serial/tegra_hsuart.c b/drivers/serial/tegra_hsuart.c index 292863ccaaa0..09f5f454683c 100644 --- a/drivers/serial/tegra_hsuart.c +++ b/drivers/serial/tegra_hsuart.c @@ -1221,8 +1221,8 @@ static int __devexit tegra_uart_remove(struct platform_device *pdev) static int tegra_uart_probe(struct platform_device *pdev) { struct tegra_uart_port *t; - struct plat_serial8250_port *pdata = pdev->dev.platform_data; struct uart_port *u; + struct resource *resource; int ret; char name[64]; if (pdev->id < 0 || pdev->id > tegra_uart_driver.nr) { @@ -1242,9 +1242,20 @@ static int tegra_uart_probe(struct platform_device *pdev) u->ops = &tegra_uart_ops; u->type = ~PORT_UNKNOWN; u->fifosize = 32; - u->mapbase = pdata->mapbase; - u->membase = pdata->membase; - u->irq = pdata->irq; + + resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (unlikely(!resource)) + return -ENXIO; + + u->mapbase = resource->start; + u->membase = IO_ADDRESS(u->mapbase); + if (unlikely(!u->membase)) + return -ENOMEM; + + u->irq = platform_get_irq(pdev, 0); + if (unlikely(u->irq < 0)) + return -ENXIO; + u->regshift = 2; t->clk = clk_get(&pdev->dev, NULL); |