iio: Simplify iio_map_array_unregister API

Instead of requiring the map to unregister, simply unregister all map entries
associated with the given iio device. This simplifies map removal and also works
for maps generated through devicetree.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Guenter Roeck
2013-01-31 21:43:00 +00:00
committed by Jonathan Cameron
parent ca7d98dbd7
commit 6cb2afd7c0
4 changed files with 18 additions and 42 deletions

View File

@@ -1611,7 +1611,7 @@ error_disable_reg:
error_put_reg:
regulator_put(st->reg);
error_unregister_map:
iio_map_array_unregister(indio_dev, client->dev.platform_data);
iio_map_array_unregister(indio_dev);
error_free_device:
iio_device_free(indio_dev);
error_out:
@@ -1630,7 +1630,7 @@ static int max1363_remove(struct i2c_client *client)
kfree(indio_dev->available_scan_masks);
regulator_disable(st->reg);
regulator_put(st->reg);
iio_map_array_unregister(indio_dev, client->dev.platform_data);
iio_map_array_unregister(indio_dev);
iio_device_free(indio_dev);
return 0;