#include "../sysfs.h"
#include "../events.h"
#include "../buffer.h"
+#include "../driver.h"
#include "max1363.h"
ret = -ENOMEM;
goto error_disable_reg;
}
+ ret = iio_map_array_register(indio_dev, client->dev.platform_data);
+ if (ret < 0)
+ goto error_free_device;
st = iio_priv(indio_dev);
st->reg = reg;
/* this is only used for device removal purposes */
ret = max1363_alloc_scan_masks(indio_dev);
if (ret)
- goto error_free_device;
+ goto error_unregister_map;
/* Estabilish that the iio_dev is a child of the i2c device */
indio_dev->dev.parent = &client->dev;
max1363_ring_cleanup(indio_dev);
error_free_available_scan_masks:
kfree(indio_dev->available_scan_masks);
+error_unregister_map:
+ iio_map_array_unregister(indio_dev, client->dev.platform_data);
error_free_device:
iio_free_device(indio_dev);
error_disable_reg:
regulator_disable(reg);
regulator_put(reg);
}
+ iio_map_array_unregister(indio_dev, client->dev.platform_data);
iio_free_device(indio_dev);
return 0;