summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/adc/adt7310.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-26 15:39:02 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-26 15:39:02 +0200
commitaa77677e0a288e08073620db5d2a31df83ca4788 (patch)
tree0d14b995a21c43f365d66b9ad101a334109fc4e4 /drivers/staging/iio/adc/adt7310.c
parentefb8d21b2c6db3497655cc6a033ae8a9883e4063 (diff)
parent43a3beb6da994549ec28a9f31727b997a025f958 (diff)
Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1519 commits) staging: et131x: Remove redundant check and return statement staging: et131x: Mainly whitespace changes to appease checkpatch staging: et131x: Remove last of the forward declarations staging: et131x: Remove even more forward declarations staging: et131x: Remove yet more forward declarations staging: et131x: Remove more forward declarations staging: et131x: Remove forward declaration of et131x_adapter_setup staging: et131x: Remove some forward declarations staging: et131x: Remove unused rx_ring.recv_packet_pool staging: et131x: Remove call to find pci pm capability staging: et131x: Remove redundant et131x_reset_recv() call staging: et131x: Remove unused rx_ring.recv_buffer_pool Staging: bcm: Fix three initialization errors in InterfaceDld.c Staging: bcm: Fix coding style issues in InterfaceDld.c staging:iio:dac: Add AD5360 driver staging:iio:trigger:bfin-timer: Fix compile error Staging: vt6655: add some range checks before memcpy() Staging: vt6655: whitespace fixes to iotcl.c Staging: vt6656: add some range checks before memcpy() Staging: vt6656: whitespace cleanups in ioctl.c ... Fix up conflicts in: - drivers/{Kconfig,Makefile}, drivers/staging/{Kconfig,Makefile}: vg driver movement - drivers/staging/brcm80211/brcmfmac/{dhd_linux.c,mac80211_if.c}: driver removal vs now stale changes - drivers/staging/rtl8192e/r8192E_core.c: driver removal vs now stale changes - drivers/staging/et131x/et131*: driver consolidation into one file, tried to do fixups
Diffstat (limited to 'drivers/staging/iio/adc/adt7310.c')
-rw-r--r--drivers/staging/iio/adc/adt7310.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/staging/iio/adc/adt7310.c b/drivers/staging/iio/adc/adt7310.c
index 1a41b8034405..c9e0be3b1cf3 100644
--- a/drivers/staging/iio/adc/adt7310.c
+++ b/drivers/staging/iio/adc/adt7310.c
@@ -13,6 +13,7 @@
#include <linux/sysfs.h>
#include <linux/list.h>
#include <linux/spi/spi.h>
+#include <linux/module.h>
#include "../iio.h"
#include "../sysfs.h"
@@ -399,19 +400,19 @@ static irqreturn_t adt7310_event_handler(int irq, void *private)
return ret;
if (status & ADT7310_STAT_T_HIGH)
- iio_push_event(indio_dev, 0,
+ iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
timestamp);
if (status & ADT7310_STAT_T_LOW)
- iio_push_event(indio_dev, 0,
+ iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING),
timestamp);
if (status & ADT7310_STAT_T_CRIT)
- iio_push_event(indio_dev, 0,
+ iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING),
@@ -740,14 +741,15 @@ static struct attribute *adt7310_event_ct_attributes[] = {
static struct attribute_group adt7310_event_attribute_group[ADT7310_IRQS] = {
{
.attrs = adt7310_event_int_attributes,
+ .name = "events",
}, {
.attrs = adt7310_event_ct_attributes,
+ .name = "events",
}
};
static const struct iio_info adt7310_info = {
.attrs = &adt7310_attribute_group,
- .num_interrupt_lines = ADT7310_IRQS,
.event_attrs = adt7310_event_attribute_group,
.driver_module = THIS_MODULE,
};
@@ -780,10 +782,6 @@ static int __devinit adt7310_probe(struct spi_device *spi_dev)
indio_dev->info = &adt7310_info;
indio_dev->modes = INDIO_DIRECT_MODE;
- ret = iio_device_register(indio_dev);
- if (ret)
- goto error_free_dev;
-
/* CT critcal temperature event. line 0 */
if (spi_dev->irq) {
if (adt7310_platform_data[2])
@@ -797,7 +795,7 @@ static int __devinit adt7310_probe(struct spi_device *spi_dev)
indio_dev->name,
indio_dev);
if (ret)
- goto error_unreg_dev;
+ goto error_free_dev;
}
/* INT bound temperature alarm event. line 1 */
@@ -834,6 +832,10 @@ static int __devinit adt7310_probe(struct spi_device *spi_dev)
}
}
+ ret = iio_device_register(indio_dev);
+ if (ret)
+ goto error_unreg_int_irq;
+
dev_info(&spi_dev->dev, "%s temperature sensor registered.\n",
indio_dev->name);
@@ -843,8 +845,6 @@ error_unreg_int_irq:
free_irq(adt7310_platform_data[0], indio_dev);
error_unreg_ct_irq:
free_irq(spi_dev->irq, indio_dev);
-error_unreg_dev:
- iio_device_unregister(indio_dev);
error_free_dev:
iio_free_device(indio_dev);
error_ret:
@@ -856,12 +856,12 @@ static int __devexit adt7310_remove(struct spi_device *spi_dev)
struct iio_dev *indio_dev = dev_get_drvdata(&spi_dev->dev);
unsigned long *adt7310_platform_data = spi_dev->dev.platform_data;
+ iio_device_unregister(indio_dev);
dev_set_drvdata(&spi_dev->dev, NULL);
if (adt7310_platform_data[0])
free_irq(adt7310_platform_data[0], indio_dev);
if (spi_dev->irq)
free_irq(spi_dev->irq, indio_dev);
- iio_device_unregister(indio_dev);
iio_free_device(indio_dev);
return 0;