Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345032
b: refs/heads/master
c: 3c39c9c
h: refs/heads/master
v: v3
  • Loading branch information
Patil, Rachna authored and Samuel Ortiz committed Nov 25, 2012
1 parent 9b4666a commit 4735034
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 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: 5e393a2227ba97408ffb98d62cf362dfe2a59baa
refs/heads/master: 3c39c9c6e9bda4d234bd24aaf34606479f581f4a
25 changes: 11 additions & 14 deletions trunk/drivers/mfd/ti_am335x_tscadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev)
struct clk *clk;
struct mfd_tscadc_board *pdata = pdev->dev.platform_data;
struct mfd_cell *cell;
int irq;
int err, ctrl;
int clk_value, clock_rate;
int tsc_wires, adc_channels = 0, total_channels;
Expand All @@ -92,12 +91,6 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev)
return -EINVAL;
}

irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "no irq ID is specified.\n");
return -EINVAL;
}

/* Allocate memory for device */
tscadc = devm_kzalloc(&pdev->dev,
sizeof(struct ti_tscadc_dev), GFP_KERNEL);
Expand All @@ -106,30 +99,34 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev)
return -ENOMEM;
}
tscadc->dev = &pdev->dev;
tscadc->irq = irq;

err = platform_get_irq(pdev, 0);
if (err < 0) {
dev_err(&pdev->dev, "no irq ID is specified.\n");
goto ret;
} else
tscadc->irq = err;

res = devm_request_mem_region(&pdev->dev,
res->start, resource_size(res), pdev->name);
if (!res) {
dev_err(&pdev->dev, "failed to reserve registers.\n");
err = -EBUSY;
goto err;
return -EBUSY;
}

tscadc->tscadc_base = devm_ioremap(&pdev->dev,
res->start, resource_size(res));
if (!tscadc->tscadc_base) {
dev_err(&pdev->dev, "failed to map registers.\n");
err = -ENOMEM;
goto err;
return -ENOMEM;
}

tscadc->regmap_tscadc = devm_regmap_init_mmio(&pdev->dev,
tscadc->tscadc_base, &tscadc_regmap_config);
if (IS_ERR(tscadc->regmap_tscadc)) {
dev_err(&pdev->dev, "regmap init failed\n");
err = PTR_ERR(tscadc->regmap_tscadc);
goto err;
goto ret;
}

pm_runtime_enable(&pdev->dev);
Expand Down Expand Up @@ -201,7 +198,7 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev)
err_disable_clk:
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
err:
ret:
return err;
}

Expand Down

0 comments on commit 4735034

Please sign in to comment.