diff options
author | Patil, Rachna <rachna@ti.com> | 2012-11-06 03:09:03 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-11-25 18:36:21 -0500 |
commit | 3c39c9c6e9bda4d234bd24aaf34606479f581f4a (patch) | |
tree | 7b52e0b68d455da61fe4747d945b9a4a17d5d525 /drivers/mfd | |
parent | 5e393a2227ba97408ffb98d62cf362dfe2a59baa (diff) |
MFD: ti_am335x_tscadc: Pass correct error message
Pass on the correct error message from platform_get_irq()
instead of hard coding it to "EINVAL".
Also change label from "err" to "ret" for better
readability and update the same in error path.
Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/ti_am335x_tscadc.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c index e947dd8bbcc..8ca3bf023fb 100644 --- a/drivers/mfd/ti_am335x_tscadc.c +++ b/drivers/mfd/ti_am335x_tscadc.c | |||
@@ -65,7 +65,6 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev) | |||
65 | struct clk *clk; | 65 | struct clk *clk; |
66 | struct mfd_tscadc_board *pdata = pdev->dev.platform_data; | 66 | struct mfd_tscadc_board *pdata = pdev->dev.platform_data; |
67 | struct mfd_cell *cell; | 67 | struct mfd_cell *cell; |
68 | int irq; | ||
69 | int err, ctrl; | 68 | int err, ctrl; |
70 | int clk_value, clock_rate; | 69 | int clk_value, clock_rate; |
71 | int tsc_wires, adc_channels = 0, total_channels; | 70 | int tsc_wires, adc_channels = 0, total_channels; |
@@ -92,12 +91,6 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev) | |||
92 | return -EINVAL; | 91 | return -EINVAL; |
93 | } | 92 | } |
94 | 93 | ||
95 | irq = platform_get_irq(pdev, 0); | ||
96 | if (irq < 0) { | ||
97 | dev_err(&pdev->dev, "no irq ID is specified.\n"); | ||
98 | return -EINVAL; | ||
99 | } | ||
100 | |||
101 | /* Allocate memory for device */ | 94 | /* Allocate memory for device */ |
102 | tscadc = devm_kzalloc(&pdev->dev, | 95 | tscadc = devm_kzalloc(&pdev->dev, |
103 | sizeof(struct ti_tscadc_dev), GFP_KERNEL); | 96 | sizeof(struct ti_tscadc_dev), GFP_KERNEL); |
@@ -106,22 +99,26 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev) | |||
106 | return -ENOMEM; | 99 | return -ENOMEM; |
107 | } | 100 | } |
108 | tscadc->dev = &pdev->dev; | 101 | tscadc->dev = &pdev->dev; |
109 | tscadc->irq = irq; | 102 | |
103 | err = platform_get_irq(pdev, 0); | ||
104 | if (err < 0) { | ||
105 | dev_err(&pdev->dev, "no irq ID is specified.\n"); | ||
106 | goto ret; | ||
107 | } else | ||
108 | tscadc->irq = err; | ||
110 | 109 | ||
111 | res = devm_request_mem_region(&pdev->dev, | 110 | res = devm_request_mem_region(&pdev->dev, |
112 | res->start, resource_size(res), pdev->name); | 111 | res->start, resource_size(res), pdev->name); |
113 | if (!res) { | 112 | if (!res) { |
114 | dev_err(&pdev->dev, "failed to reserve registers.\n"); | 113 | dev_err(&pdev->dev, "failed to reserve registers.\n"); |
115 | err = -EBUSY; | 114 | return -EBUSY; |
116 | goto err; | ||
117 | } | 115 | } |
118 | 116 | ||
119 | tscadc->tscadc_base = devm_ioremap(&pdev->dev, | 117 | tscadc->tscadc_base = devm_ioremap(&pdev->dev, |
120 | res->start, resource_size(res)); | 118 | res->start, resource_size(res)); |
121 | if (!tscadc->tscadc_base) { | 119 | if (!tscadc->tscadc_base) { |
122 | dev_err(&pdev->dev, "failed to map registers.\n"); | 120 | dev_err(&pdev->dev, "failed to map registers.\n"); |
123 | err = -ENOMEM; | 121 | return -ENOMEM; |
124 | goto err; | ||
125 | } | 122 | } |
126 | 123 | ||
127 | tscadc->regmap_tscadc = devm_regmap_init_mmio(&pdev->dev, | 124 | tscadc->regmap_tscadc = devm_regmap_init_mmio(&pdev->dev, |
@@ -129,7 +126,7 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev) | |||
129 | if (IS_ERR(tscadc->regmap_tscadc)) { | 126 | if (IS_ERR(tscadc->regmap_tscadc)) { |
130 | dev_err(&pdev->dev, "regmap init failed\n"); | 127 | dev_err(&pdev->dev, "regmap init failed\n"); |
131 | err = PTR_ERR(tscadc->regmap_tscadc); | 128 | err = PTR_ERR(tscadc->regmap_tscadc); |
132 | goto err; | 129 | goto ret; |
133 | } | 130 | } |
134 | 131 | ||
135 | pm_runtime_enable(&pdev->dev); | 132 | pm_runtime_enable(&pdev->dev); |
@@ -201,7 +198,7 @@ static int __devinit ti_tscadc_probe(struct platform_device *pdev) | |||
201 | err_disable_clk: | 198 | err_disable_clk: |
202 | pm_runtime_put_sync(&pdev->dev); | 199 | pm_runtime_put_sync(&pdev->dev); |
203 | pm_runtime_disable(&pdev->dev); | 200 | pm_runtime_disable(&pdev->dev); |
204 | err: | 201 | ret: |
205 | return err; | 202 | return err; |
206 | } | 203 | } |
207 | 204 | ||