diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-06-10 05:30:17 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-06-10 05:30:17 -0300 |
commit | d635711daa98be86d4c7fd01499c34f566b54ccb (patch) | |
tree | aa5cc3760a27c3d57146498cb82fa549547de06c /drivers/staging/iio/meter/ade7854.c | |
parent | c91265cd0efb83778f015b4d4b1129bd2cfd075e (diff) |
Linux-libre 4.6.2-gnu
Diffstat (limited to 'drivers/staging/iio/meter/ade7854.c')
-rw-r--r-- | drivers/staging/iio/meter/ade7854.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/staging/iio/meter/ade7854.c b/drivers/staging/iio/meter/ade7854.c index a83883596..9e439af71 100644 --- a/drivers/staging/iio/meter/ade7854.c +++ b/drivers/staging/iio/meter/ade7854.c @@ -417,7 +417,7 @@ static int ade7854_set_irq(struct device *dev, bool enable) ret = st->read_reg_32(dev, ADE7854_MASK0, &irqen); if (ret) - goto error_ret; + return ret; if (enable) irqen |= BIT(17); /* 1: interrupt enabled when all periodical @@ -426,10 +426,7 @@ static int ade7854_set_irq(struct device *dev, bool enable) irqen &= ~BIT(17); ret = st->write_reg_32(dev, ADE7854_MASK0, irqen); - if (ret) - goto error_ret; -error_ret: return ret; } @@ -548,31 +545,15 @@ int ade7854_probe(struct iio_dev *indio_dev, struct device *dev) indio_dev->info = &ade7854_info; indio_dev->modes = INDIO_DIRECT_MODE; - ret = iio_device_register(indio_dev); + ret = devm_iio_device_register(dev, indio_dev); if (ret) return ret; /* Get the device into a sane initial state */ - ret = ade7854_initial_setup(indio_dev); - if (ret) - goto error_unreg_dev; - - return 0; - -error_unreg_dev: - iio_device_unregister(indio_dev); - return ret; + return ade7854_initial_setup(indio_dev); } EXPORT_SYMBOL(ade7854_probe); -int ade7854_remove(struct iio_dev *indio_dev) -{ - iio_device_unregister(indio_dev); - - return 0; -} -EXPORT_SYMBOL(ade7854_remove); - MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); MODULE_DESCRIPTION("Analog Devices ADE7854/58/68/78 Polyphase Energy Meter"); MODULE_LICENSE("GPL v2"); |