Commit b97855354aaacd65d68805bce38af4af1ef703f9
Committed by
Jonathan Cameron
1 parent
1b791fadf3
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
iio: light: cm32181: Use devm_* APIs
This patch changes API from iio_device_register() to devm_* API. Using API make code simpler. Signed-off-by: Beomho Seo <beomho.seo@samsung.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Showing 1 changed file with 1 additions and 10 deletions Side-by-side Diff
drivers/iio/light/cm32181.c
... | ... | @@ -331,7 +331,7 @@ |
331 | 331 | return ret; |
332 | 332 | } |
333 | 333 | |
334 | - ret = iio_device_register(indio_dev); | |
334 | + ret = devm_iio_device_register(&client->dev, indio_dev); | |
335 | 335 | if (ret) { |
336 | 336 | dev_err(&client->dev, |
337 | 337 | "%s: regist device failed\n", |
... | ... | @@ -342,14 +342,6 @@ |
342 | 342 | return 0; |
343 | 343 | } |
344 | 344 | |
345 | -static int cm32181_remove(struct i2c_client *client) | |
346 | -{ | |
347 | - struct iio_dev *indio_dev = i2c_get_clientdata(client); | |
348 | - | |
349 | - iio_device_unregister(indio_dev); | |
350 | - return 0; | |
351 | -} | |
352 | - | |
353 | 345 | static const struct i2c_device_id cm32181_id[] = { |
354 | 346 | { "cm32181", 0 }, |
355 | 347 | { } |
... | ... | @@ -370,7 +362,6 @@ |
370 | 362 | }, |
371 | 363 | .id_table = cm32181_id, |
372 | 364 | .probe = cm32181_probe, |
373 | - .remove = cm32181_remove, | |
374 | 365 | }; |
375 | 366 | |
376 | 367 | module_i2c_driver(cm32181_driver); |