Skip to content

Commit

Permalink
Staging: iio: fix duplicate dev_attr_name
Browse files Browse the repository at this point in the history
device attr's should be static, otherwise duplicate identifiers are
created:

drivers/staging/iio/trigger/iio-trig-gpio.o:(.data+0x1c): multiple definition of `dev_attr_name'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Randy Dunlap authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent 3860dc8 commit 2fdec57
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/iio/accel/lis3l02dq_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ static int lis3l02dq_data_rdy_trigger_set_state(struct iio_trigger *trig,
&t);
return ret;
}
DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);

static struct attribute *lis3l02dq_trigger_attrs[] = {
&dev_attr_name.attr,
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/iio/trigger/iio-trig-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static irqreturn_t iio_gpio_trigger_poll(int irq, void *private)
return IRQ_HANDLED;
}

DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);

static struct attribute *iio_gpio_trigger_attrs[] = {
&dev_attr_name.attr,
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ static ssize_t iio_trig_periodic_read_name(struct device *dev,
return sprintf(buf, "%s\n", trig_info->name);
}

DEVICE_ATTR(name, S_IRUGO,
static DEVICE_ATTR(name, S_IRUGO,
iio_trig_periodic_read_name,
NULL);
DEVICE_ATTR(frequency, S_IRUGO | S_IWUSR,
static DEVICE_ATTR(frequency, S_IRUGO | S_IWUSR,
iio_trig_periodic_read_freq,
iio_trig_periodic_write_freq);

Expand Down

0 comments on commit 2fdec57

Please sign in to comment.