Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2047640pxk; Sat, 5 Sep 2020 06:52:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9yWixcEF9rsQa43RkY3GtolroSyzyiEYnuREbMCuvpy32JqVOe5lIZbqCnElsfbpKoZKh X-Received: by 2002:a17:906:af42:: with SMTP id ly2mr11971768ejb.362.1599313920079; Sat, 05 Sep 2020 06:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599313920; cv=none; d=google.com; s=arc-20160816; b=crRDFBltkWwycj4Js0IvzXgKNuQoOIo4thh94nbhe8fvwFc9vSMdZxP1ma9xVYBG9Q t9wDtpKHiuvawGPRya6zP92f/9FB6sILY+zi7iSFvWjF9riMTGdei09FoI0f4OUT1Zpe 8NyseFAT5/192cQU3jzddz2900pijc1MoexOr2aXV2VZCcXBfKZ4jV09kkzNEokkiWKD JNs8skROmr1NnKL9jMuth1TtyLLB/Oxb1fGRnSU1+excPOY35EZZ0+eB1647gAA9FuNj Ju0ijQccE9hIYoKCROC1bsL1M5svE3Nc+Y9Hfh3y0JrsiX8HWnhUKMbIjE0/ad7iyBSL g9Iw== 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=i3aT2p0Va0hrSSqK5RUYbotBYCyGk26XqYQggAhQ/uLzwjTPoaJqHacGvAtLdAyFfy 9kEujGuk19mU4scmJh/4TxuBBluz1FUfzp3+FwIk8yRv0ZmvPNhS+4bZI5L38C7E9yru Kmp4ETcjQ/unAZU/Y9Ya2wdhxIwgefYnDwUshNdoxR4FjTnicC98IWFBTBkEdlPX68Le ugiPjBmiIVcrhpm2PTmhF9gsxafeQjnEx/vs391G7WN+uBRizJn4ED/2GWrw9ZdykLLU 5NFRFAUdIrD26eXfki6avJHtRh0JedH3DkyJiX7tsYTAe5JtbiqZlVLnnxp/xmZTUVqe S6Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vCI9nuIh; 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 v23si6050767ejh.356.2020.09.05.06.51.37; Sat, 05 Sep 2020 06:52:00 -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=vCI9nuIh; 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 S1728708AbgIENsT (ORCPT + 99 others); Sat, 5 Sep 2020 09:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728658AbgIENjB (ORCPT ); Sat, 5 Sep 2020 09:39:01 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D13CC061263; Sat, 5 Sep 2020 06:38:45 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id o20so6146057pfp.11; Sat, 05 Sep 2020 06:38:45 -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=vCI9nuIh/ZyX+ZZOs5S6EcWhoFxDgEq27lkoPSrh0fGqHz8gJUaSTghFLPm6FEx643 S6M78ktCGAIl1gwall86ACUvkkVLM30k+3PEPeP8H3Mg7mTbskavXPYeZD0kju8VNVnN 5XAE9o+GhN+HhEHWZRBcgEgqbYYU04XtT9gDmaLIDdV95IPqbL7YpKiIsgm+kVMqG3zF dWLU1ZJgZ+R10Se0Te+QD7d84wKJseR9gcEykq0GfmM2SOo8YA7sZrtPHf9bFHLSRQeX OSi9fP211lsNYDYnpzxYlYwihlS2oX6ymb12IuIyobHNKqNfkwnm9TqMhUF9q0W4znoy iKPw== 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=eKZ6YHHUdj2rsGvs2OzgsIAbaxw0yuGfTENb/f/OJpdGRU7YauKuaVVQRMPnI6PGqn cWs2UqQVNO1CwgLq7554uiMs/HkaSVyDSGXTC57gtC13MNVjRXd8xwEkC0ksI9Z2WJ59 8ffppSGNeqQPJo7QxS/IRsh5p03feWnuAOTkuw7phrr/VQerPqAnuz97vGXH2zthdeEf fRDsoOHPu0BDlNvaYKb4aUID7i9ji8mZfOBK4384uA361f5eYTypoM+7LtdhZorzVlOW KssmXHw6SAKcoGI+Lkp7FV9NVFid4hvSR1tC5VAu9wC0XzLGIRR5JuZ1AxIugBq4o1ua 5sBQ== X-Gm-Message-State: AOAM532qR8A3F50q7TjBONU37m/BTAx8CiWeB/AY4gHWyUIWtBzjCrI9 VYjQ9aoxl3v2cVDV7owj5gy5XVUc2bA= X-Received: by 2002:a63:595a:: with SMTP id j26mr11227616pgm.406.1599313124738; Sat, 05 Sep 2020 06:38:44 -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 u3sm7556717pjn.29.2020.09.05.06.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 06:38:44 -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 v7 15/20] tools: gpio: port gpio-watch to v2 uAPI Date: Sat, 5 Sep 2020 21:35:44 +0800 Message-Id: <20200905133549.24606-16-warthog618@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200905133549.24606-1-warthog618@gmail.com> References: <20200905133549.24606-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