From patchwork Wed Jun 6 17:44:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael David Tinoco X-Patchwork-Id: 10450791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6EE0960146 for ; Wed, 6 Jun 2018 17:44:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F2282995D for ; Wed, 6 Jun 2018 17:44:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5346C29A26; Wed, 6 Jun 2018 17:44:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 071AA2995D for ; Wed, 6 Jun 2018 17:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752026AbeFFRoa (ORCPT ); Wed, 6 Jun 2018 13:44:30 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:33511 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752398AbeFFRo3 (ORCPT ); Wed, 6 Jun 2018 13:44:29 -0400 Received: by mail-qt0-f193.google.com with SMTP id l10-v6so2053472qtj.0 for ; Wed, 06 Jun 2018 10:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=o04SUTGAO/i8KRV5fbYYbE9ZQXszNrVB9tM/Ct/KSdU=; b=ADV0BQpkfzo26GVfTeD9tlEknSzTezkcSFRPAEXicLlRQjyzyLunC07aUTTZMA/Htt tq1ORQOWxaqKPpoa1JAZceisFTpetomwFIagU74DM78m2byyvQSTrujuX88RZkmP6mTE HEN6RTNWelvUPzet5BN+fjgcaNrY6y9HJoJdM= 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; bh=o04SUTGAO/i8KRV5fbYYbE9ZQXszNrVB9tM/Ct/KSdU=; b=BInfX+1cZKdoiFr5E6fxMBFwNxQwdkPwT/YhwEjoimiHEUxs3vn5sNMkYNZ5g+hM4D BheiBLhtedA3NjQeY30pNlt+3jYFIyaM4UZGQq09ACjBs3ZCRgedtNiUWsWJa4e/amJx gtO1BtsFi/Cr0FNfp6R5wO6F90u3FykLcM9F5sY1H0ZAB4dCpfBafy4jfi3E7OCwkS+C miV47P8h7pIrNNOquoJaMZFaMn8LiAQAFav/bh9ZRevFw9ZdCldvqjZRJNfhRoZOzPIW PEaVQjbtldk88J9uZwodvyjeuCLqieu89TRwCTPEXeJTubsG+APwXYReU6giIn1CVFh1 xXTA== X-Gm-Message-State: APt69E1mavXDR3V82pdO0KqXXks0pGiX99dNdTURftgkw0Ip2jzMWlor CjFRZnEm0C+4/0EZbTFDIjnI5g== X-Google-Smtp-Source: ADUXVKIxQi7Slbz/4uZxEColbO22KHfygo3U2F/3F9eOwBpWMWNaTmThOG+QTN4DMAKYNOywyuQA0Q== X-Received: by 2002:ac8:25f2:: with SMTP id f47-v6mr3885398qtf.12.1528307068672; Wed, 06 Jun 2018 10:44:28 -0700 (PDT) Received: from workstation.celeiro.br ([138.204.25.57]) by smtp.gmail.com with ESMTPSA id 47-v6sm42941210qtw.4.2018.06.06.10.44.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jun 2018 10:44:28 -0700 (PDT) From: Rafael David Tinoco To: bamv2005@gmail.com Cc: brgl@bgdev.pl, shuah@kernel.org, linux-gpio@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, rafael.tinoco@linaro.org Subject: [PATCH] selftests: gpio: gpio-mockup-chardev GPIOHANDLE_REQUEST_OUTPUT fix Date: Wed, 6 Jun 2018 14:44:24 -0300 Message-Id: <20180606174424.9630-1-rafael.tinoco@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Following logic from commit: 22f6592b23, GPIOHANDLE_REQUEST_OUTPUT should handle errors same way as GPIOHANDLE_REQUEST_INPUT does, or else the following error occurs: gpio-mockup-chardev: gpio line<0> test flag<0x2> value<0>: No such file or directory despite the real result of gpio_pin_test(), gpio_debugfs_get() and gpiotools_request_linehandle() functions. Signed-off-by: Rafael David Tinoco --- tools/testing/selftests/gpio/gpio-mockup-chardev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/gpio/gpio-mockup-chardev.c b/tools/testing/selftests/gpio/gpio-mockup-chardev.c index 667e916fa7cc..f8d468f54e98 100644 --- a/tools/testing/selftests/gpio/gpio-mockup-chardev.c +++ b/tools/testing/selftests/gpio/gpio-mockup-chardev.c @@ -225,10 +225,10 @@ int gpio_pin_test(struct gpiochip_info *cinfo, int line, int flag, int value) if (flag & GPIOHANDLE_REQUEST_ACTIVE_LOW) debugfs_value = !debugfs_value; - if (!(debugfs_dir == OUT && value == debugfs_value)) + if (!(debugfs_dir == OUT && value == debugfs_value)) { errno = -EINVAL; - ret = -errno; - + ret = -errno; + } } gpiotools_release_linehandle(fd);