All of lore.kernel.org
 help / color / mirror / Atom feed
* [IIO] Mistake in assumption about trigger names
@ 2011-09-09 14:01 Manuel Stahl
  2011-09-09 14:40 ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Manuel Stahl @ 2011-09-09 14:01 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio

Hi Jonathan,

I'm currently updating the iioutils SF project. By doing so I encountered a 
problem in your generic_buffer.c example.

You generate the trigger name from the device name:
> 	if (trigger_name == NULL) {
> 		/*
> 		 * Build the trigger name. If it is device associated it's
> 		 * name is <device_name>_dev[n] where n matches the device
> 		 * number found above
> 		 */
> 		ret = asprintf(&trigger_name,
> 			       "%s-dev%d", device_name, dev_num);
> 		if (ret < 0) {
> 			ret = -ENOMEM;
> 			goto error_ret;
> 		}
> 	}

That will not work if a device has no trigger and is enumerated before the 
device you are looking at.

I think we need a symlink in the device directory to it's own trigger.
Also the current_trigger attribute should go into the buffer directory, as 
this is the place, where it is actually used.

-- 
Regards,
Manuel Stahl

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-09-12  8:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-09 14:01 [IIO] Mistake in assumption about trigger names Manuel Stahl
2011-09-09 14:40 ` Jonathan Cameron
2011-09-09 14:56   ` [PATCH] staging:iio: move id and device name setting to iio_device_allocate Jonathan Cameron
2011-09-09 14:57     ` Jonathan Cameron
2011-09-12  8:27     ` Manuel Stahl
2011-09-12  8:37       ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.