Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp698745pxk; Sun, 30 Aug 2020 20:27:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRebRBziJkOHfSqIpqdnaCL++j8EqvL1P90yaxMkZqbatnrSTLLfiCuT83TtbGfZ9wHioN X-Received: by 2002:a50:e846:: with SMTP id k6mr9340629edn.27.1598844435135; Sun, 30 Aug 2020 20:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598844435; cv=none; d=google.com; s=arc-20160816; b=wPUtIrya9iubYGuMVI2pvarqWM5hcgcsClQloo4JpjlhIbwAnJO+cABK+4ehoIAxMR 2+ksI/ZTOxSsWV5yp55DToxiymcHj/G+VshGibUeojLoMED6ReM48Ruj3oNoMKqMI12n qGQdQKg9A0CkithstywHFenMxBPv9p5om3qrpH733rW8jcJcvdvzx5MY7jRBSraTXkeY ggb+zOqrhUq53c7NsugzWdiAZBPKtDR5MVR+fl30hWnrSekFN2pYjz0f9YZPrOPFpxpV aslIPya6Hbg1UQvXclok2uIyBKwv7zc38ttMdeoI3kEEdGZwyh9PLpeO48YQOO5R2ny6 PN4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LIt8SU895oGklP+2kcXOf7XSm/B7RkLFz7bfNOknIlU=; b=vqWE4/VjxmsmzSixrBmj0Ai6KaHtJsD75WOtaQkPqQFbynvN0snHMABH0Z7AJFb5Pf gERVlEpWIxggrIhWAphrEpMy0APHIKDm5Kjt7yPXxpQkaNtQ7VFPOOG4Q/fMzhoY8zW3 pl5OOvjfx9TSFzVWXL4eynEJohie8MTHO7B7xKNu5+Uzelgmgr0L34kWm7BbpGTloIVw tfGJVSbb8Nh7R2+IGx0D9NCpwqGauFCyD+bqTwW5cBHJxWjo9w030mq4s7SsgIWnQ9zf 4JvO1AnFmlrwm2b+h15meGrSeGfgZSEDUcWj8zx9+c2WbHKJwIc6o6Gj5Gj2X+W+0TBr VNTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TL7V4Loj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mc3si522772ejb.404.2020.08.30.20.26.52; Sun, 30 Aug 2020 20:27:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TL7V4Loj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727092AbgHaDYB (ORCPT + 99 others); Sun, 30 Aug 2020 23:24:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726692AbgHaDX7 (ORCPT ); Sun, 30 Aug 2020 23:23:59 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E4BAC061573; Sun, 30 Aug 2020 20:23:59 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id j11so2361415plk.9; Sun, 30 Aug 2020 20:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LIt8SU895oGklP+2kcXOf7XSm/B7RkLFz7bfNOknIlU=; b=TL7V4LojCV9AdG4FSJRXpEgng1qDns4dtZ2SuklwRniakzhDwDXeW3YgYDpvC3hzZI ruBGwCuMZE9gMzWjgbvcDQa7MewRD9HerwM4FfN9jRZ2hXxuo/r2YWjYB1hXNwmm/pKx 2qrErvy83LnbZ4KawAKxOkFuj1YBAdlhYroApyHSGxvSSwi7GuABgLkA4GyETwad2y8+ xQWEPdxMyM+E7w13BLkBkFT4BbG4AkLcY+dOblN+64ypdReM7odiZdj5c9t3dFL2l7RD lgWQGmiq5H+8+iQrXgp6scaePPZbHmhM8Nx9W3boZyuoK8UgqV8nTIeLYiSePpwgZP5w n/wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LIt8SU895oGklP+2kcXOf7XSm/B7RkLFz7bfNOknIlU=; b=qPfpshix+1AEfaWOmAbA3wvnDl9TkkuVtb4LGV+/8rf61f8gjOrEpTnfA98+DYQeie /fNX6cM3EU6Xa0hNASvB3Jd2CUrrbzh2Z6WhtMsnF2iGkWljP6zCXwFL9wLoUrn1dJB8 OtJYvPj8JpJdmSWZMb9YjsKyvmLbCdV/bncIUAC+WGD2dbjlq57Koxj8X8MoPy9P76Lk MuRjzY+uAkXFUFjibIjGsZgJRWtsvE0F5YmivxxxldeJYjAONoJVEfIAMGwGM1Nnr0F5 JBc7Uoi0JqyCOL0/5vBw4NT35d1e/cjtVUALXMhDhRgnEB3bbvvjEHm7zVJ+Z8ZLcoQZ CiGw== X-Gm-Message-State: AOAM531+4OIQM+pdnchwZYkmzGMoezJjBgJyytxDzECEQDa15y39j0Gd 29JhhR5PSZ9R9l5VZKzaLDttBC6YqVk= X-Received: by 2002:a17:902:6bc3:: with SMTP id m3mr7084806plt.137.1598844238570; Sun, 30 Aug 2020 20:23:58 -0700 (PDT) Received: from sol.lan (106-69-184-100.dyn.iinet.net.au. [106.69.184.100]) by smtp.gmail.com with ESMTPSA id z17sm6095733pfq.38.2020.08.30.20.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Aug 2020 20:23:57 -0700 (PDT) From: Kent Gibson To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, bgolaszewski@baylibre.com, linus.walleij@linaro.org Cc: Kent Gibson Subject: [PATCH v6 15/20] tools: gpio: port gpio-watch to v2 uAPI Date: Mon, 31 Aug 2020 11:20:01 +0800 Message-Id: <20200831032006.1019978-16-warthog618@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200831032006.1019978-1-warthog618@gmail.com> References: <20200831032006.1019978-1-warthog618@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Port the gpio-watch tool to the latest GPIO uAPI. Signed-off-by: Kent Gibson --- tools/gpio/gpio-watch.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/gpio/gpio-watch.c b/tools/gpio/gpio-watch.c index 5cea24fddfa7..6f048350a27e 100644 --- a/tools/gpio/gpio-watch.c +++ b/tools/gpio/gpio-watch.c @@ -21,8 +21,8 @@ int main(int argc, char **argv) { - struct gpioline_info_changed chg; - struct gpioline_info req; + struct gpio_v2_line_info_changed chg; + struct gpio_v2_line_info req; struct pollfd pfd; int fd, i, j, ret; char *event, *end; @@ -40,11 +40,11 @@ int main(int argc, char **argv) for (i = 0, j = 2; i < argc - 2; i++, j++) { memset(&req, 0, sizeof(req)); - req.line_offset = strtoul(argv[j], &end, 0); + req.offset = strtoul(argv[j], &end, 0); if (*end != '\0') goto err_usage; - ret = ioctl(fd, GPIO_GET_LINEINFO_WATCH_IOCTL, &req); + ret = ioctl(fd, GPIO_V2_GET_LINEINFO_WATCH_IOCTL, &req); if (ret) { perror("unable to set up line watch"); return EXIT_FAILURE; @@ -71,13 +71,13 @@ int main(int argc, char **argv) } switch (chg.event_type) { - case GPIOLINE_CHANGED_REQUESTED: + case GPIO_V2_LINE_CHANGED_REQUESTED: event = "requested"; break; - case GPIOLINE_CHANGED_RELEASED: + case GPIO_V2_LINE_CHANGED_RELEASED: event = "released"; break; - case GPIOLINE_CHANGED_CONFIG: + case GPIO_V2_LINE_CHANGED_CONFIG: event = "config changed"; break; default: @@ -87,7 +87,7 @@ int main(int argc, char **argv) } printf("line %u: %s at %llu\n", - chg.info.line_offset, event, chg.timestamp); + chg.info.offset, event, chg.timestamp); } } -- 2.28.0