Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338384
b: refs/heads/master
c: de60958
h: refs/heads/master
v: v3
  • Loading branch information
Linus Walleij authored and Greg Kroah-Hartman committed Oct 25, 2012
1 parent 27ff644 commit dbc89b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40477d0e04fd8d004ee9c70ad57e397a6b6ead63
refs/heads/master: de609582072af195673e72d9e7647d5cba8eb7e4
25 changes: 9 additions & 16 deletions trunk/drivers/tty/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
#include <linux/of_device.h>
#include <linux/pinctrl/consumer.h>
#include <linux/sizes.h>

#include <asm/io.h>
#include <linux/io.h>

#define UART_NR 14

Expand Down Expand Up @@ -1973,24 +1972,26 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
goto out;
}

uap = kzalloc(sizeof(struct uart_amba_port), GFP_KERNEL);
uap = devm_kzalloc(&dev->dev, sizeof(struct uart_amba_port),
GFP_KERNEL);
if (uap == NULL) {
ret = -ENOMEM;
goto out;
}

i = pl011_probe_dt_alias(i, &dev->dev);

base = ioremap(dev->res.start, resource_size(&dev->res));
base = devm_ioremap(&dev->dev, dev->res.start,
resource_size(&dev->res));
if (!base) {
ret = -ENOMEM;
goto free;
goto out;
}

uap->pinctrl = devm_pinctrl_get(&dev->dev);
if (IS_ERR(uap->pinctrl)) {
ret = PTR_ERR(uap->pinctrl);
goto unmap;
goto out;
}
uap->pins_default = pinctrl_lookup_state(uap->pinctrl,
PINCTRL_STATE_DEFAULT);
Expand All @@ -2002,10 +2003,10 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
if (IS_ERR(uap->pins_sleep))
dev_dbg(&dev->dev, "could not get sleep pinstate\n");

uap->clk = clk_get(&dev->dev, NULL);
uap->clk = devm_clk_get(&dev->dev, NULL);
if (IS_ERR(uap->clk)) {
ret = PTR_ERR(uap->clk);
goto unmap;
goto out;
}

uap->vendor = vendor;
Expand Down Expand Up @@ -2038,11 +2039,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
amba_set_drvdata(dev, NULL);
amba_ports[i] = NULL;
pl011_dma_remove(uap);
clk_put(uap->clk);
unmap:
iounmap(base);
free:
kfree(uap);
}
out:
return ret;
Expand All @@ -2062,9 +2058,6 @@ static int pl011_remove(struct amba_device *dev)
amba_ports[i] = NULL;

pl011_dma_remove(uap);
iounmap(uap->port.membase);
clk_put(uap->clk);
kfree(uap);
return 0;
}

Expand Down

0 comments on commit dbc89b5

Please sign in to comment.