aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpio/gpio-utils.c
diff options
context:
space:
mode:
authorKent Gibson <warthog618@gmail.com>2020-09-28 08:28:03 +0800
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2020-09-30 10:57:17 +0200
commited60aee0edcda1fabc39ab27c9650fa172f461b4 (patch)
tree1e85d400423a1e7508850d17e7e1e4e7186bd234 /tools/gpio/gpio-utils.c
parenttools: gpio: port gpio-watch to v2 uAPI (diff)
downloadlinux-dev-ed60aee0edcda1fabc39ab27c9650fa172f461b4.tar.xz
linux-dev-ed60aee0edcda1fabc39ab27c9650fa172f461b4.zip
tools: gpio: rename nlines to num_lines
Rename nlines to num_lines to be consistent with other usage for fields describing the number of entries in an array. Signed-off-by: Kent Gibson <warthog618@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'tools/gpio/gpio-utils.c')
-rw-r--r--tools/gpio/gpio-utils.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/gpio/gpio-utils.c b/tools/gpio/gpio-utils.c
index 16a5d9cb9da2..d527980bcb94 100644
--- a/tools/gpio/gpio-utils.c
+++ b/tools/gpio/gpio-utils.c
@@ -38,7 +38,7 @@
* such as "gpiochip0"
* @lines: An array desired lines, specified by offset
* index for the associated GPIO device.
- * @nline: The number of lines to request.
+ * @num_lines: The number of lines to request.
* @flag: The new flag for requsted gpio. Reference
* "linux/gpio.h" for the meaning of flag.
* @data: Default value will be set to gpio when flag is
@@ -56,7 +56,7 @@
* On failure return the errno.
*/
int gpiotools_request_linehandle(const char *device_name, unsigned int *lines,
- unsigned int nlines, unsigned int flag,
+ unsigned int num_lines, unsigned int flag,
struct gpiohandle_data *data,
const char *consumer_label)
{
@@ -78,12 +78,12 @@ int gpiotools_request_linehandle(const char *device_name, unsigned int *lines,
goto exit_free_name;
}
- for (i = 0; i < nlines; i++)
+ for (i = 0; i < num_lines; i++)
req.lineoffsets[i] = lines[i];
req.flags = flag;
strcpy(req.consumer_label, consumer_label);
- req.lines = nlines;
+ req.lines = num_lines;
if (flag & GPIOHANDLE_REQUEST_OUTPUT)
memcpy(req.default_values, data, sizeof(req.default_values));
@@ -194,20 +194,20 @@ int gpiotools_get(const char *device_name, unsigned int line)
* such as "gpiochip0".
* @lines: An array desired lines, specified by offset
* index for the associated GPIO device.
- * @nline: The number of lines to request.
+ * @num_lines: The number of lines to request.
* @data: The array of values get from gpiochip.
*
* Return: On success return 0;
* On failure return the errno.
*/
int gpiotools_gets(const char *device_name, unsigned int *lines,
- unsigned int nlines, struct gpiohandle_data *data)
+ unsigned int num_lines, struct gpiohandle_data *data)
{
int fd;
int ret;
int ret_close;
- ret = gpiotools_request_linehandle(device_name, lines, nlines,
+ ret = gpiotools_request_linehandle(device_name, lines, num_lines,
GPIOHANDLE_REQUEST_INPUT, data,
CONSUMER);
if (ret < 0)
@@ -245,7 +245,7 @@ int gpiotools_set(const char *device_name, unsigned int line,
* such as "gpiochip0".
* @lines: An array desired lines, specified by offset
* index for the associated GPIO device.
- * @nline: The number of lines to request.
+ * @num_lines: The number of lines to request.
* @data: The array of values set to gpiochip, must be
* 0(low) or 1(high).
*
@@ -253,11 +253,11 @@ int gpiotools_set(const char *device_name, unsigned int line,
* On failure return the errno.
*/
int gpiotools_sets(const char *device_name, unsigned int *lines,
- unsigned int nlines, struct gpiohandle_data *data)
+ unsigned int num_lines, struct gpiohandle_data *data)
{
int ret;
- ret = gpiotools_request_linehandle(device_name, lines, nlines,
+ ret = gpiotools_request_linehandle(device_name, lines, num_lines,
GPIOHANDLE_REQUEST_OUTPUT, data,
CONSUMER);
if (ret < 0)