[IIO] Mistake in assumption about trigger names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux