From patchwork Mon Mar 19 00:50:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 131974 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp2139540ljb; Sun, 18 Mar 2018 17:51:07 -0700 (PDT) X-Google-Smtp-Source: AG47ELsu78TPoTHaOaitxwzHs4dNOA3+Xhvas10YmgsKLRjSzG58ynmVqYzPQL+eJsiR/MxPeYI5 X-Received: by 10.99.186.14 with SMTP id k14mr7789504pgf.43.1521420667518; Sun, 18 Mar 2018 17:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521420667; cv=none; d=google.com; s=arc-20160816; b=VF9QTtnjdEDMLwfmK1iTdTdvqKJuZbpH1sR1N65NE0zZndejua9OHMVitZ+JeiXTcu sxdyimu3W2rBefn4Ec/a9enuRTGepLwDYq67N2z/cHU5tszuW3Lz90w08HUoU7lXq9bI Dc0sbZyF+0HMkovTr4qU2pQZLPtnriWifAHNJM8xA8RC4jx8YVUBfn+/0VeV5gGyazRk 2VIzPMUm3FYn+eM21yBoT9C+xksDWgRJ7OL56cksO/o2quvIYKX4dogtDF7muoyNcS2a QuJfPwyXEOJfLOlIFP+0X8aIwWAr1HJ4bQsCiPJXuW13rdg7+2ljuJsR/PuXxHtMo3QO KIIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=/d7LPB3CtGadzHgmgDfTO4Wli927CVGw0q03F/rRU4Y=; b=mLhgtRE401BjGkW/rsqILcPNqXu3aOLbgUlXjSWnYPnagW6uw93LhcsY8dSmHGLRll yqTEjhiSQHrygMZKLnYtFpEjGmqTlVm31vQFttYiMaK/559tppax7SvWxesLeBZrMMkS KhlivMV+OPwJ1Zfrf/MbRix1/xNr6YkGqs1AmKZcLdAeXSJbqxoCA4xkDHYef+l93pzE PI6TxdD7IsZAVh4phOtItCS1PREJlw6uDM8lc/KXkMoyFUXDBIX3KifpGdK3tFkqDx1o 3THkk4y4aJ5lG7Rc+kfOQGievkzNI4AQX634sbgrabzI3G4Ptq89toxnd1vPUZiXd2Vj IGOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EG9M66Gu; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l12-v6si11286527plc.696.2018.03.18.17.51.07; Sun, 18 Mar 2018 17:51:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EG9M66Gu; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754646AbeCSAvF (ORCPT + 5 others); Sun, 18 Mar 2018 20:51:05 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38031 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754531AbeCSAvF (ORCPT ); Sun, 18 Mar 2018 20:51:05 -0400 Received: by mail-pl0-f67.google.com with SMTP id m22-v6so9247276pls.5 for ; Sun, 18 Mar 2018 17:51:05 -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=BqakYE3j33eXv/sx6C2inBzVzfk0T9O15R2Vongdod4=; b=EG9M66Gumh/3krmtAUYVuHteFmG5JbyViWYG5S3zwXcmLWV+W6OwKtzQtivWpCRsfv DKSC0/fRh20YxyxO7ge5onpogGKhcVPDCfllmtRFstf9hPjxKzpQVPgZx6Pvnwya0Imt gJ3qFCvLN06fb0Yifs3vpgR4VMeDC3uNBK+kg= 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=BqakYE3j33eXv/sx6C2inBzVzfk0T9O15R2Vongdod4=; b=ddK7vQjBQS/du91zxrtGG1g0jgec3cIZGezWhc0i+v9dRpD1w/PdOTwN5R5pExgDcK 4q4R2xCiIGd72c8eitO9fXqb8qkjLXTaUz5HCjaMkN6Msi9N9mWqrhPkMCg+okmXNzUr ooXaH2ODXnA7WD/81WX6ICjwNUzO4JnNCSWuWGhwB6ywuWd3UwL+f4Bajk1vdBCFMyhq X7lV46bzFzxxk77kmDyjq4ZvEuJPfEqAXFRYg0hqlYRhfAswUWIMNULLQOJ14Za4dOjQ 93dU4NAfIN6hE8iLaMOT0eC25SfRYBOeAw8oNCyoU16oGXXIqnGkd8k7LJQEUp4wnDT5 yArg== X-Gm-Message-State: AElRT7Eo3YncAIrcWsulg5QFcD+MGxZhwEKkxYZXhtZ9EjWJQBP1YYUW eg4qlmV1G1erHGWr90rgm8BGL8nL6acU4g== X-Received: by 2002:a17:902:42e:: with SMTP id 43-v6mr10323304ple.186.1521420664472; Sun, 18 Mar 2018 17:51:04 -0700 (PDT) Received: from localhost.localdomain ([218.255.99.6]) by smtp.gmail.com with ESMTPSA id z15sm21766373pgr.68.2018.03.18.17.51.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Mar 2018 17:51:03 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij Subject: [PATCH 01/13] gpio: dln2: Include proper header Date: Mon, 19 Mar 2018 01:50:44 +0100 Message-Id: <20180319005056.7380-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This driver has no business including , it is a driver so include . GPIOF_DIR_IN/GPIOF_DIR_OUT are for consumers and should not be used in drivers to use just 1/0 instead. Signed-off-by: Linus Walleij --- drivers/gpio/gpio-dln2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpio/gpio-dln2.c b/drivers/gpio/gpio-dln2.c index 1dada68b9a27..c4e7953c093e 100644 --- a/drivers/gpio/gpio-dln2.c +++ b/drivers/gpio/gpio-dln2.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -204,9 +203,9 @@ static int dln2_gpio_get_direction(struct gpio_chip *chip, unsigned offset) struct dln2_gpio *dln2 = gpiochip_get_data(chip); if (test_bit(offset, dln2->output_enabled)) - return GPIOF_DIR_OUT; + return 0; - return GPIOF_DIR_IN; + return 1; } static int dln2_gpio_get(struct gpio_chip *chip, unsigned int offset) @@ -218,7 +217,7 @@ static int dln2_gpio_get(struct gpio_chip *chip, unsigned int offset) if (dir < 0) return dir; - if (dir == GPIOF_DIR_IN) + if (dir == 1) return dln2_gpio_pin_get_in_val(dln2, offset); return dln2_gpio_pin_get_out_val(dln2, offset);