This is a note to let you know that I've just added the patch titled Subject: staging: iio: Function iio_get_new_idr_val() return negative value if fails. to my gregkh-2.6 tree. Its filename is staging-iio-function-iio_get_new_idr_val-return-negative-value-if-fails.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ >From jic23@xxxxxxxxx Thu Apr 22 16:40:17 2010 From: Sonic Zhang <sonic.adi@xxxxxxxxx> Date: Mon, 22 Mar 2010 12:27:05 +0000 Subject: staging: iio: Function iio_get_new_idr_val() return negative value if fails. To: sonic zhang <sonic.adi@xxxxxxxxx> Cc: Linux Kernel <linux-kernel@xxxxxxxxxxxxxxx>, linux-iio <linux-iio@xxxxxxxxxxxxxxx>, Greg KH <greg@xxxxxxxxx> Message-ID: <4BA76219.4030606@xxxxxxxxx> Function iio_get_new_idr_val() return negative value if fails. So, only error when ret < 0 in iio_device_register_eventset(). Signed-off-by: Sonic Zhang <sonic.adi@xxxxxxxxx> Acked-by: Jonathan Cameron <jic23@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx> --- drivers/staging/iio/industrialio-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/staging/iio/industrialio-core.c +++ b/drivers/staging/iio/industrialio-core.c @@ -537,6 +537,7 @@ static void iio_device_unregister_sysfs( sysfs_remove_group(&dev_info->dev.kobj, dev_info->attrs); } +/* This function return negative value if fails. */ int iio_get_new_idr_val(struct idr *this_idr) { int ret; @@ -660,7 +661,7 @@ static int iio_device_register_eventset( for (i = 0; i < dev_info->num_interrupt_lines; i++) { dev_info->event_interfaces[i].owner = dev_info->driver_module; ret = iio_get_new_idr_val(&iio_event_idr); - if (ret) + if (ret < 0) goto error_free_setup_ev_ints; else dev_info->event_interfaces[i].id = ret; -- 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