فهرست منبع

tools: gpio: Small updates for output format

Use %2d for the GPIO line number. This should align the results
horziontally for most gpio chips.

The GPIO label uses quotes for real values. For GPIO names this is
currently missing. The patch adds the missing quote.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Markus Pargmann 9 سال پیش
والد
کامیت
bb91d345b4
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      tools/gpio/lsgpio.c

+ 2 - 2
tools/gpio/lsgpio.c

@@ -111,9 +111,9 @@ int list_device(const char *device_name)
 			perror("Failed to issue LINEINFO IOCTL\n");
 			perror("Failed to issue LINEINFO IOCTL\n");
 			goto exit_close_error;
 			goto exit_close_error;
 		}
 		}
-		fprintf(stdout, "\tline %d:", linfo.line_offset);
+		fprintf(stdout, "\tline %2d:", linfo.line_offset);
 		if (linfo.name[0])
 		if (linfo.name[0])
-			fprintf(stdout, " %s", linfo.name);
+			fprintf(stdout, " \"%s\"", linfo.name);
 		else
 		else
 			fprintf(stdout, " unnamed");
 			fprintf(stdout, " unnamed");
 		if (linfo.label[0])
 		if (linfo.label[0])