commit acf50b3586
"tools:iio:lsiio: add error handling"
introduced error handling of errors returned from
read_sysfs_string(), but with a simple if (retval),
missing the fact that these functions return a positive
value if the read was successful.
As a result lsiio regresses and does not show any
devices on my filesystem. Fix this by checking for
only negative error codes.
Cc: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch indends to make some cleanup and send printf
error messages to stderr. The changes were performed with coccinelle
for failure messages and manual for other cases, such as wrong usage
messages.
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Remove explicit NULL comparison and write it in its simpler form as
recommended by checkpatch.pl.
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use more appropriate/common variable names:
* namepf instead of nameFile in iio_utils.c
* ret instead of retval in lsiio.c
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
In generic_buffer.c: sort program parameters alphabetically and provide
usage information
In lsiio.c: drop unused parameters
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Add error handling to calls which can indicate a major problem by
returning an error code.
This also involves to change the type of dump_devices() from void to int.
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch catches errors in string allocation in generic_buffer.c,
iio_event_monitor.c, iio_utils.c and lsiio.c.
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
In dump_channels() the DIR *dp was left open on exit. Close it and check
for errors.
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch removes unused variables from lsiio.c in order
to get rid of the warnings regarding them.
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This patch moves iio userspace applications out of staging, to tools/iio/
and adds a Makefile in order to compile them easily. It also adds tools/iio/
to MAINTAINERS file.
Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>