Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336357
b: refs/heads/master
c: b36bdc5
h: refs/heads/master
i:
  336355: 8be1176
v: v3
  • Loading branch information
Linus Walleij committed Nov 11, 2012
1 parent 7775962 commit 31591d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 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: 585583f54f577d7fd93247101b9f61c8bbbd21f1
refs/heads/master: b36bdc5911effe819e415b144388853bf07a543b
32 changes: 4 additions & 28 deletions trunk/drivers/pinctrl/pinctrl-u300.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,6 @@ static const struct pinctrl_pin_desc u300_pads[] = {
struct u300_pmx {
struct device *dev;
struct pinctrl_dev *pctl;
u32 phybase;
u32 physize;
void __iomem *virtbase;
};

Expand Down Expand Up @@ -1110,7 +1108,6 @@ static int __devinit u300_pmx_probe(struct platform_device *pdev)
struct u300_pmx *upmx;
struct resource *res;
struct gpio_chip *gpio_chip = dev_get_platdata(&pdev->dev);
int ret;
int i;

/* Create state holders etc for this driver */
Expand All @@ -1123,26 +1120,15 @@ static int __devinit u300_pmx_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENOENT;
upmx->phybase = res->start;
upmx->physize = resource_size(res);

if (request_mem_region(upmx->phybase, upmx->physize,
DRIVER_NAME) == NULL) {
ret = -ENOMEM;
goto out_no_memregion;
}

upmx->virtbase = ioremap(upmx->phybase, upmx->physize);
if (!upmx->virtbase) {
ret = -ENOMEM;
goto out_no_remap;
}
upmx->virtbase = devm_request_and_ioremap(&pdev->dev, res);
if (!upmx->virtbase)
return -ENOMEM;

upmx->pctl = pinctrl_register(&u300_pmx_desc, &pdev->dev, upmx);
if (!upmx->pctl) {
dev_err(&pdev->dev, "could not register U300 pinmux driver\n");
ret = -EINVAL;
goto out_no_pmx;
return -EINVAL;
}

/* We will handle a range of GPIO pins */
Expand All @@ -1156,23 +1142,13 @@ static int __devinit u300_pmx_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "initialized U300 pin control driver\n");

return 0;

out_no_pmx:
iounmap(upmx->virtbase);
out_no_remap:
platform_set_drvdata(pdev, NULL);
out_no_memregion:
release_mem_region(upmx->phybase, upmx->physize);
return ret;
}

static int __devexit u300_pmx_remove(struct platform_device *pdev)
{
struct u300_pmx *upmx = platform_get_drvdata(pdev);

pinctrl_unregister(upmx->pctl);
iounmap(upmx->virtbase);
release_mem_region(upmx->phybase, upmx->physize);
platform_set_drvdata(pdev, NULL);

return 0;
Expand Down

0 comments on commit 31591d9

Please sign in to comment.