aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/max1363.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/adc/max1363.c')
-rw-r--r--drivers/iio/adc/max1363.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
index b5669be6f396..03b25b3dc71e 100644
--- a/drivers/iio/adc/max1363.c
+++ b/drivers/iio/adc/max1363.c
@@ -1605,19 +1605,20 @@ static int max1363_probe(struct i2c_client *client,
1605 1605
1606 return 0; 1606 return 0;
1607error_free_irq: 1607error_free_irq:
1608 free_irq(st->client->irq, indio_dev); 1608 if (client->irq)
1609 free_irq(st->client->irq, indio_dev);
1609error_uninit_buffer: 1610error_uninit_buffer:
1610 iio_buffer_unregister(indio_dev); 1611 iio_buffer_unregister(indio_dev);
1611error_cleanup_buffer: 1612error_cleanup_buffer:
1612 max1363_buffer_cleanup(indio_dev); 1613 max1363_buffer_cleanup(indio_dev);
1613error_free_available_scan_masks: 1614error_free_available_scan_masks:
1614 kfree(indio_dev->available_scan_masks); 1615 kfree(indio_dev->available_scan_masks);
1615error_unregister_map:
1616 iio_map_array_unregister(indio_dev, client->dev.platform_data);
1617error_disable_reg: 1616error_disable_reg:
1618 regulator_disable(st->reg); 1617 regulator_disable(st->reg);
1619error_put_reg: 1618error_put_reg:
1620 regulator_put(st->reg); 1619 regulator_put(st->reg);
1620error_unregister_map:
1621 iio_map_array_unregister(indio_dev, client->dev.platform_data);
1621error_free_device: 1622error_free_device:
1622 iio_device_free(indio_dev); 1623 iio_device_free(indio_dev);
1623error_out: 1624error_out:
@@ -1635,10 +1636,8 @@ static int max1363_remove(struct i2c_client *client)
1635 iio_buffer_unregister(indio_dev); 1636 iio_buffer_unregister(indio_dev);
1636 max1363_buffer_cleanup(indio_dev); 1637 max1363_buffer_cleanup(indio_dev);
1637 kfree(indio_dev->available_scan_masks); 1638 kfree(indio_dev->available_scan_masks);
1638 if (!IS_ERR(st->reg)) { 1639 regulator_disable(st->reg);
1639 regulator_disable(st->reg); 1640 regulator_put(st->reg);
1640 regulator_put(st->reg);
1641 }
1642 iio_map_array_unregister(indio_dev, client->dev.platform_data); 1641 iio_map_array_unregister(indio_dev, client->dev.platform_data);
1643 iio_device_free(indio_dev); 1642 iio_device_free(indio_dev);
1644 1643