Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1198414

Re: [PATCH v2 2/2] tools: iio: print error message when buffer enable fails

From Jonathan Cameron <jic23@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/2] tools: iio: print error message when buffer enable fails
Date 2015-08-02 19:50 +0200
Message-ID <pT5yy-2Cb-21@gated-at.bofh.it> (permalink)
References <pPLcZ-71j-9@gated-at.bofh.it> <pPLcZ-71j-7@gated-at.bofh.it> <pPPTk-5kZ-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 24/07/15 19:23, Hartmut Knaack wrote:
> Irina Tirdea schrieb am 24.07.2015 um 15:28:
>> Running generic_buffer without enabling any channel of the
>> sensor will fail without printing any error message.
>>
>> Add an error message that indicates buffer enable failed.
>>
>> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
> Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Applied.

Thanks

Jonathan
>> ---
>>  tools/iio/generic_buffer.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c
>> index 32f389eb..9f7b85b 100644
>> --- a/tools/iio/generic_buffer.c
>> +++ b/tools/iio/generic_buffer.c
>> @@ -364,8 +364,11 @@ int main(int argc, char **argv)
>>  
>>  	/* Enable the buffer */
>>  	ret = write_sysfs_int("enable", buf_dir_name, 1);
>> -	if (ret < 0)
>> +	if (ret < 0) {
>> +		fprintf(stderr,
>> +			"Failed to enable buffer: %s\n", strerror(-ret));
>>  		goto error_free_buf_dir_name;
>> +	}
>>  
>>  	scan_size = size_from_channelarray(channels, num_channels);
>>  	data = malloc(scan_size * buf_len);
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2 2/2] tools: iio: print error message when buffer enable fails Irina Tirdea <irina.tirdea@intel.com> - 2015-07-24 15:30 +0200
  Re: [PATCH v2 2/2] tools: iio: print error message when buffer enable  fails Jonathan Cameron <jic23@kernel.org> - 2015-08-02 19:50 +0200

csiph-web