From patchwork Thu Nov 8 16:52:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 995019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="2CWEW0LS"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42rTqt1N4qz9s8J for ; Fri, 9 Nov 2018 03:53:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727158AbeKIC3d (ORCPT ); Thu, 8 Nov 2018 21:29:33 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46222 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727155AbeKIC3c (ORCPT ); Thu, 8 Nov 2018 21:29:32 -0500 Received: by mail-wr1-f67.google.com with SMTP id 74-v6so21980678wrb.13 for ; Thu, 08 Nov 2018 08:53:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GwZ4kCn0pUIbC4Baifciq+tWo366hhq+7YU9gxlpjWY=; b=2CWEW0LSLbtDykunbHCkuFxjCRA5vxuhJKV8ZS3QfMfy6QPJHzB7zC/5BdlWkEQ3Be W6TVaUB/cKyilVRz0vdxNiliTTnP/WxbokNm2pNzyN07VQ7fEspGoPwAulFU92wz2Qkr vMwrTuRSEhq9enJsgex8Ffd7qgwDbYxTkmf2GoqSNyJxTPYgtafGeO+JrkA22nf+XI6b NzZaxPE2emQNZq93Lh5V78gqk6Q9gZqV8P3BEPaB8DWcPbyxuxvFXkU3mKa+C3vDlUXZ hZG3AdDOYv3xbEQVjnKUMd7XtGHFp0Us0dJle15pwK62pMrOlrCDa+9vm3FvTg2ywEtf WTIA== 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=GwZ4kCn0pUIbC4Baifciq+tWo366hhq+7YU9gxlpjWY=; b=kPUOe6ey+EGoUvexDvRP/WCxqiCp7ot8pWR4+EjIiBKKRc7x2HZ2w/sX4U/cNIy0vG aTwM5pckxBDNbDNFpd66CURWPBU19NkhUfVxeMbOrg/MtZj2xS2tc2J/9ZtCIA+LfLkC a6S/DhsugtXvUQYXaGEZaAnTWZRTkPEGyGazcJQi7JtEQ6LfLQXKamBm0Ow8uMLCifLD 7WY6kG0UOaEmEkX6T5YZfC335tKS+qfhTigE2208LG2cUK91wOm13TOSyZiEON8N8/r6 r2OaLhEckbSJJ4nfSIxUbUseNFoIjFsMAz7skGPBGrl+epyvbc8N4nFccGs2biajsTTB fAqw== X-Gm-Message-State: AGRZ1gJEgEfk3QXqEao8DSwrzv1kLUy7zVxxeEHNv3HEeuso2sdd58Vc jGqWn0tyXejXn/GM6QjS6VxapQ== X-Google-Smtp-Source: AJdET5ee5cpAXJcVHKhW/HPr3CcHrfLQt8SErOFqsrV9SVEkZRbZsbCfwxcjG2iMpYjcTovoMP7Aeg== X-Received: by 2002:adf:f148:: with SMTP id y8-v6mr4989094wro.303.1541695989486; Thu, 08 Nov 2018 08:53:09 -0800 (PST) Received: from debian-brgl.lan ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id h5-v6sm7815987wrs.51.2018.11.08.08.53.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Nov 2018 08:53:08 -0800 (PST) From: Bartosz Golaszewski To: Bamvor Jian Zhang , Linus Walleij , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 1/3] gpio: mockup: fix indicated direction Date: Thu, 8 Nov 2018 17:52:53 +0100 Message-Id: <20181108165255.9940-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108165255.9940-1-brgl@bgdev.pl> References: <20181108165255.9940-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Commit 3edfb7bd76bd ("gpiolib: Show correct direction from the beginning") fixed an existing issue but broke libgpiod tests by changing the default direction of dummy lines to output. We don't break user-space so make gpio-mockup behave as before. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-mockup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c index 8269cffc2967..6a50f9f59c90 100644 --- a/drivers/gpio/gpio-mockup.c +++ b/drivers/gpio/gpio-mockup.c @@ -35,8 +35,8 @@ #define gpio_mockup_err(...) pr_err(GPIO_MOCKUP_NAME ": " __VA_ARGS__) enum { - GPIO_MOCKUP_DIR_OUT = 0, - GPIO_MOCKUP_DIR_IN = 1, + GPIO_MOCKUP_DIR_IN = 0, + GPIO_MOCKUP_DIR_OUT = 1, }; /* @@ -131,7 +131,7 @@ static int gpio_mockup_get_direction(struct gpio_chip *gc, unsigned int offset) { struct gpio_mockup_chip *chip = gpiochip_get_data(gc); - return chip->lines[offset].dir; + return !chip->lines[offset].dir; } static int gpio_mockup_to_irq(struct gpio_chip *gc, unsigned int offset)