From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 9028C1C11AD for ; Fri, 1 Jun 2018 09:31:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 83E0F2261E for ; Fri, 1 Jun 2018 09:31:05 +0000 (UTC) Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F5NshiIdCIkc for ; Fri, 1 Jun 2018 09:31:04 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by silver.osuosl.org (Postfix) with ESMTPS id 5C18622164 for ; Fri, 1 Jun 2018 09:31:03 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id v13-v6so23976328wrp.13 for ; Fri, 01 Jun 2018 02:31:03 -0700 (PDT) From: Sergio Paracuellos Subject: [RESEND PATCH 4/6] staging: mt7621-gpio: use GPIOF_DIR_OUT and GPIOF_DIR_IN macros instead of custom values Date: Fri, 1 Jun 2018 11:30:54 +0200 Message-Id: <1527845456-1221-4-git-send-email-sergio.paracuellos@gmail.com> In-Reply-To: <1527845456-1221-1-git-send-email-sergio.paracuellos@gmail.com> References: <20180601091807.GA9257@kroah.com> <1527845456-1221-1-git-send-email-sergio.paracuellos@gmail.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org Cc: neil@brown.name, driverdev-devel@linuxdriverproject.org There are macros in gpio kernel's headers to define direction of a gpio. Use them instead of return custom '0' and '1' values. Signed-off-by: Sergio Paracuellos Reviewed-by: NeilBrown --- drivers/staging/mt7621-gpio/gpio-mt7621.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621-gpio/gpio-mt7621.c index a8adee3..390cc56 100644 --- a/drivers/staging/mt7621-gpio/gpio-mt7621.c +++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -127,7 +128,7 @@ mediatek_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) struct mtk_gc *rg = to_mediatek_gpio(chip); u32 t = mtk_gpio_r32(rg, GPIO_REG_CTRL); - return (t & BIT(offset)) ? 0 : 1; + return (t & BIT(offset)) ? GPIOF_DIR_OUT : GPIOF_DIR_IN; } static int -- 2.7.4 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel