Skip to contentSkip to conversation

naming IIO_IN_DIFF in-in

DISCUSSION Michael Hennerich 2 participants 3 messages Jun 7, 2011 IIO

lore
Share & tools
lore
#0 lore raw

Hi Jonathan,

I wonder if naming IIO_IN_DIFF in-in is really a good idea. Declaring the attribute in a conventional fashion doesn't work.

static IIO_DEVICE_ATTR(in-in_scale_available, S_IRUGO, \
ad7793_show_scale_available, NULL, 0);

static struct attribute *ad7793_attributes[] =3D { &iio_dev_attr_sampling_frequency.dev_attr.attr, &iio_const_attr_sampling_frequency_available.dev_attr.attr, &iio_dev_attr_in-in_scale_available.dev_attr.attr, NULL
};

drivers/staging/iio/adc/ad7793.c:681: error: expected =91=3D=92, =91,=92,= =91;=92,=20
=91asm=92 or =91__attribute__=92 before =91-=92 token drivers/staging/iio/adc/ad7793.c:688: error: =91iio_dev_attr_in=92=20 undeclared here (not in a function) drivers/staging/iio/adc/ad7793.c:688: error: =91in_scale_available=92=20 undeclared here (not in a function)

--=20
Greetings,
Michael

--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif

#1 lore raw
Quoted 7 lines · Michael Hennerich

Hi Jonathan,
=20
I wonder if naming IIO_IN_DIFF in-in is really a good idea. Declaring the attribute in a conventional fashion doesn't work. =20
static IIO_DEVICE_ATTR(in-in_scale_available, S_IRUGO, \
ad7793_show_scale_available, NULL, 0);

Yup, that's why we have IIO_DEVICE_ATTR_NAMED.

static IIO_DEVICE_ATTR_NAMED(in_m_in_scale_available, in-in_scale_avail= able,
S_IRUGO, ad7793_show_scale_available, NULL, 0)

should give you an iio_dev_attr_in_m_in_scale_available to use in the attribute table. It will show up in sysfs as in-in_scale_available.

Quoted 9 lines

=20
static struct attribute *ad7793_attributes[] =3D { &iio_dev_attr_sampling_frequency.dev_attr.attr, &iio_const_attr_sampling_frequency_available.dev_attr.attr, &iio_dev_attr_in-in_scale_available.dev_attr.attr,
NULL
};
=20
drivers/staging/iio/adc/ad7793.c:681: error: expected =91=3D=92, =91,=

=92, =91;=92, =91asm=92 or =91__attribute__=92 before =91-=92 token

Quoted 1 line

drivers/staging/iio/adc/ad7793.c:688: error: =91iio_dev_attr_in=92 un=

declared here (not in a function)

Quoted 1 line

drivers/staging/iio/adc/ad7793.c:688: error: =91in_scale_available=92=

undeclared here (not in a function)

Quoted 1 line

=20

#2 lore raw

Jonathan Cameron wrote on 2011-06-07:

Quoted 8 lines · Michael Hennerich
Quoted 7 lines

Hi Jonathan,

I wonder if naming IIO_IN_DIFF in-in is really a good idea. Declaring the attribute in a conventional fashion doesn't work.

static IIO_DEVICE_ATTR(in-in_scale_available, S_IRUGO, \
ad7793_show_scale_available, NULL, 0);

Quoted 7 lines

Yup, that's why we have IIO_DEVICE_ATTR_NAMED.

static IIO_DEVICE_ATTR_NAMED(in_m_in_scale_available, in- in_scale_available, S_IRUGO, ad7793_show_scale_available, NULL, 0)

should give you an iio_dev_attr_in_m_in_scale_available to use in the attribute table. It will show up in sysfs as in-in_scale_available.

Hi Jonathan,

Thanks!

Quoted 8 lines
Quoted 8 lines

static struct attribute *ad7793_attributes[] =3D { &iio_dev_attr_sampling_frequency.dev_attr.attr, &iio_const_attr_sampling_frequency_available.dev_attr.attr, &iio_dev_attr_in-in_scale_available.dev_attr.attr, NULL
};

Quoted 8 lines
Quoted 7 lines

drivers/staging/iio/adc/ad7793.c:681: error: expected '=3D', ',', ';', 'asm' or '__attribute__' before '-' token drivers/staging/iio/adc/ad7793.c:688: error: 'iio_dev_attr_in' undeclared here (not in a function) drivers/staging/iio/adc/ad7793.c:688: error: 'in_scale_available' undeclared here (not in a function)

Greetings,
Michael

--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Gesch= aeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret=
Seif