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 65EF31CE4B3 for ; Tue, 29 May 2018 04:58:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 62E0223039 for ; Tue, 29 May 2018 04:58:17 +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 izhay5WxVD63 for ; Tue, 29 May 2018 04:58:17 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by silver.osuosl.org (Postfix) with ESMTPS id AD5DB22F23 for ; Tue, 29 May 2018 04:58:16 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id o78-v6so36885314wmg.0 for ; Mon, 28 May 2018 21:58:16 -0700 (PDT) From: Sergio Paracuellos Subject: [PATCH 4/6] staging: mt7621-gpio: use GPIOF_DIR_OUT and GPIOF_DIR_IN macros instead of custom values Date: Tue, 29 May 2018 06:58:07 +0200 Message-Id: <1527569889-9510-5-git-send-email-sergio.paracuellos@gmail.com> In-Reply-To: <1527569889-9510-1-git-send-email-sergio.paracuellos@gmail.com> References: <87efhwwv9y.fsf@notabene.neil.brown.name> <1527569889-9510-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 --- 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 9132963..e31ed67 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