Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp582400ybx; Tue, 5 Nov 2019 02:16:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwlnGK9UGX8CPibixIxfydDunUi9qgqOewEnkDCVcds/u30IKZSy5EoVkLiNY6uwhkOYv3s X-Received: by 2002:aa7:c44a:: with SMTP id n10mr24029487edr.282.1572948972144; Tue, 05 Nov 2019 02:16:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572948972; cv=none; d=google.com; s=arc-20160816; b=tQxHZmkOi3P/eqGTMse53c8SA77t+BvRe3kd+fZacA40VUZBhDriZSE2tK7/fVJ6DA BqeLo1hZWl7P4tR3qvUY6svFtwdTaNHu4gBAEkbagmWYCjmV3CbmzfUhJtuMwJTsYi/K RvWsIBMPAUJlc/n93S5nlGD0SbTf9LXbfWbilv1VqI8MkcO82A3Y7KDXqzeCwlLtplWq JEom5cbv0bDLhddStEDKl0BRLXy32tpRdgwvWEpVUmIwL39ZZxtWC1uTaWnceh8xtsr8 wyLDTuTvnE5qqomkoO/SBmwU3dQpT29L21M/URc042o9GTiTNUWMT9jNiST5iVOVzeei EwUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=V7qLFq4K93vUH8fK9wNC+b3dmkN6TfhoYmCQsWeu7yY=; b=Uu4cTLi52V0FUAoJnUA7cgubfv1DVfZzSvY9oUkAUE41k6vBUe2u7N79uV+OKXha2N 9w2hjy6pfOdUz3zKrkpykGBVXfzSgQHV9CX3QAjmzQ4lyPuFtePMOS5iDkHHWD3SzWsQ hJFHm1mTmb02IS+QEofnxkMFHrNs/9GayBi0fcwpl/bP+SteINsoQG46sRSes2toXYG9 VLTwa327p7zyKJaxbUf1Sx4IYS0bhSDyvEuwYaRykxlv8oNX8VqHCTo+CL+OGZ6FY3Js +yyv04iODs/LS3S9VAzeKqWpzdXQW1o/XdBpjVHkWe1ys9CJsOcTY5eY4eVuqcG0WFcy DbFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si9073228ejt.202.2019.11.05.02.15.48; Tue, 05 Nov 2019 02:16:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388230AbfKEKMo (ORCPT + 99 others); Tue, 5 Nov 2019 05:12:44 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45072 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387832AbfKEKMo (ORCPT ); Tue, 5 Nov 2019 05:12:44 -0500 Received: by mail-lj1-f196.google.com with SMTP id n21so7498444ljg.12; Tue, 05 Nov 2019 02:12:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=V7qLFq4K93vUH8fK9wNC+b3dmkN6TfhoYmCQsWeu7yY=; b=GRl+eYtlXh8Tlc9+vvBqJKMumuMmm9CUAZg97vp9HS0Jjc4xZ2+wE96e7QgheAyl8O KdoMBP8P1sF0oy4N1Z7KAFSYEl9TAhjpvl+JT93UXSmHgr50B5KuzTwFjmOeYjQE2dKt BsNd9fKTeIeDDYpu0imlve4AOFnJP5J3XgVl/XdmWtrb6wVMnbJ/48IlNuX7Ktj7l2Yi umdW1aV2gxqxIAK7SgVfblZpLZ4Ic61jAUzIVr53yikLSdJMUEH2FFuPZ8A1KbokmUrR K7nn8GzUzr2K622UmbIt7irEI8GGlrcjBruSdsnqCWXUrMZDzFPBzjBiW/YMfUIZmd1W YUlg== X-Gm-Message-State: APjAAAXz4pjNOaK9PGjGDi9OzW9O5dfzuV7+L2QH07wKyNWG70w0SbY4 lwJEYJd6vpGjpnq5nR8eGN4= X-Received: by 2002:a2e:28a:: with SMTP id y10mr20290638lje.155.1572948760228; Tue, 05 Nov 2019 02:12:40 -0800 (PST) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id k9sm1362903lfj.97.2019.11.05.02.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2019 02:12:39 -0800 (PST) Date: Tue, 5 Nov 2019 12:12:30 +0200 From: Matti Vaittinen To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com Cc: Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/62] gpio: gpio-aspeed: Use new GPIO_LINE_DIRECTION Message-ID: <493e2f9ed5aff112519adcdf2d3044bf54c2d91a.1572945709.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's hard for occasional GPIO code reader/writer to know if values 0/1 equal to IN or OUT. Use defined GPIO_LINE_DIRECTION_IN and GPIO_LINE_DIRECTION_OUT to help them out. Signed-off-by: Matti Vaittinen --- drivers/gpio/gpio-aspeed.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index 09e53c5f3b0a..f1037b61f763 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -487,10 +487,10 @@ static int aspeed_gpio_get_direction(struct gpio_chip *gc, unsigned int offset) u32 val; if (!have_input(gpio, offset)) - return 0; + return GPIO_LINE_DIRECTION_OUT; if (!have_output(gpio, offset)) - return 1; + return GPIO_LINE_DIRECTION_IN; spin_lock_irqsave(&gpio->lock, flags); @@ -498,8 +498,7 @@ static int aspeed_gpio_get_direction(struct gpio_chip *gc, unsigned int offset) spin_unlock_irqrestore(&gpio->lock, flags); - return !val; - + return val ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN; } static inline int irqd_to_aspeed_gpio_data(struct irq_data *d, -- 2.21.0 -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =]