diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-10-29 07:39:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-11-24 16:07:15 -0500 |
commit | 2191d0fba75c77efef8e4fd50641fb19772b72eb (patch) | |
tree | 58ebc140d978abeff39bdfdcf058e36e3bbdbd95 /drivers/iio/adc/viperboard_adc.c | |
parent | 27b832427e060d4e963c610d07860e5dbe1daafa (diff) |
iio: adc: viperboard: Use devm_iio_device_register
devm_iio_device_register simplifies the code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc/viperboard_adc.c')
-rw-r--r-- | drivers/iio/adc/viperboard_adc.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/iio/adc/viperboard_adc.c b/drivers/iio/adc/viperboard_adc.c index ee695e50cfa3..d0add8f9416b 100644 --- a/drivers/iio/adc/viperboard_adc.c +++ b/drivers/iio/adc/viperboard_adc.c | |||
@@ -133,7 +133,7 @@ static int vprbrd_adc_probe(struct platform_device *pdev) | |||
133 | indio_dev->channels = vprbrd_adc_iio_channels; | 133 | indio_dev->channels = vprbrd_adc_iio_channels; |
134 | indio_dev->num_channels = ARRAY_SIZE(vprbrd_adc_iio_channels); | 134 | indio_dev->num_channels = ARRAY_SIZE(vprbrd_adc_iio_channels); |
135 | 135 | ||
136 | ret = iio_device_register(indio_dev); | 136 | ret = devm_iio_device_register(&pdev->dev, indio_dev); |
137 | if (ret) { | 137 | if (ret) { |
138 | dev_err(&pdev->dev, "could not register iio (adc)"); | 138 | dev_err(&pdev->dev, "could not register iio (adc)"); |
139 | return ret; | 139 | return ret; |
@@ -144,22 +144,12 @@ static int vprbrd_adc_probe(struct platform_device *pdev) | |||
144 | return 0; | 144 | return 0; |
145 | } | 145 | } |
146 | 146 | ||
147 | static int vprbrd_adc_remove(struct platform_device *pdev) | ||
148 | { | ||
149 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); | ||
150 | |||
151 | iio_device_unregister(indio_dev); | ||
152 | |||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | static struct platform_driver vprbrd_adc_driver = { | 147 | static struct platform_driver vprbrd_adc_driver = { |
157 | .driver = { | 148 | .driver = { |
158 | .name = "viperboard-adc", | 149 | .name = "viperboard-adc", |
159 | .owner = THIS_MODULE, | 150 | .owner = THIS_MODULE, |
160 | }, | 151 | }, |
161 | .probe = vprbrd_adc_probe, | 152 | .probe = vprbrd_adc_probe, |
162 | .remove = vprbrd_adc_remove, | ||
163 | }; | 153 | }; |
164 | 154 | ||
165 | module_platform_driver(vprbrd_adc_driver); | 155 | module_platform_driver(vprbrd_adc_driver); |