staging:iio: move id and device name setting to iio_device_allocate.
authorJonathan Cameron <jic23@cam.ac.uk>
Wed, 14 Sep 2011 12:01:25 +0000 (13:01 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 16 Sep 2011 18:32:00 +0000 (20:32 +0200)
commita9e39f9e80ac24367e375c8ea110dfaec837b020
tree3a65ba53bc8d9a7b8c00f13dd99641b8d755a507
parentcedd1a16bbe00456fb9abda237e9b1c2bc763edd
staging:iio: move id and device name setting to iio_device_allocate.

The recent reorganization of the sysfs attribute registration had
the side effect of moving iio_device_register after registration of
triggers etc.  The side effect of this is that the id hadn't been
allocated by the time of trigger registration. Thus all triggers
based on device got the name <dev_name>-dev0 instead of <dev_name>-devN
where N is the iio device id.

This should also fix the lack of device name for some error messages
that we have been seeing (and I'd been meaning to track down) as
that has now moved earlier as well.

Reported-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Tested-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/industrialio-core.c