From patchwork Fri Jan 19 06:40:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 125096 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp158562ljf; Thu, 18 Jan 2018 22:43:17 -0800 (PST) X-Google-Smtp-Source: ACJfBosGTPDYQYxTDayGdK4OCkrwdNI9k41qVk8ih4LfobN+HK8yxkXtI5g2yZg/6sdsQUXB9TaG X-Received: by 10.101.80.72 with SMTP id k8mr38554508pgo.6.1516344197142; Thu, 18 Jan 2018 22:43:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516344197; cv=none; d=google.com; s=arc-20160816; b=idJDfHtKXgSt9tK6IkukKQ8G/+vWCMOYNf9BAJTDbqUKOjgdvjxAqIGgj6LNyh72vE K3lW8ntlgGfpFqcsZA5rkKyLmMdjmYuFH7TWi9nCpdA8o5fIEk9CYMj64hVODOflI8Wb dIGqb1dsa2+xAiBdBAOGj397hRvj2NC35GcpdIIH6LrLDj0QTc96KzR4hWhi6ji/1APr PB+atcYY0XPJS2FvJe5HYniXfAuuM//hFhEvCCAnITk1oaPKyeDhK1TWh+FebCIXDBwD 7ricmOZ8qVfFX2XdX6Ap4E2PW9WA5IAN0ndRJ9sPdxfjf6wXV2GKAkWcr5Z3NgdXWjZs 1RVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=O0GiN5qx/o0XBnZrmozZJc57n52A/7UGs9+lOmlvd5Y=; b=yrR8q828uVdHqB/f0KUdKU7vt8UkYO+V0YEbuNIK/H4jViHvjneZ7PP+DqzTTV9oal x6aWQQxJx+YbeZQFnlkrOTnDQsc99jpSrTqcSnNRZ5D5CDqxf93pZUvsD4XR4pCSo4/b kgES8VpH6eu70grSY/+AQm8MTl149LCgMBqB6J3NYHoWsAAtW6AFJDVwLu7GYqs+/utS glX21Ruwf0xlXIaZI/2Rn5d6yidUlq68E90GOpCNFpKLuyQpe/i+FJhipGun1LKC0/Xj YUq4BUB8BUiZj+NTmh6Un2Wao3XL5tYerk13nS6jtzj5K/OZkkVsUqZ29gG4Go6aCzgk UEDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Ejs5y60B; 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 f63si8527755pfc.226.2018.01.18.22.43.16; Thu, 18 Jan 2018 22:43:17 -0800 (PST) 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=Ejs5y60B; 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 S1754117AbeASGnQ (ORCPT + 6 others); Fri, 19 Jan 2018 01:43:16 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:38963 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753773AbeASGnP (ORCPT ); Fri, 19 Jan 2018 01:43:15 -0500 Received: by mail-lf0-f65.google.com with SMTP id m8so803898lfc.6 for ; Thu, 18 Jan 2018 22:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IpEA0+EX+q0/rUB0WE6YIKr+ltSD2JHNs74GyjuFpOQ=; b=Ejs5y60BDaGNRIzi9PRY6eh9H47q1hbIvqlHFVm4d/6AvvTc/hrP5ozREvXy0mkF2W YIuYhjPLYnDAaPSw+9naYikItcWXtF0arlCx8TjPQsHOj8JfTtz6LkG5Yb/r6QONcKaH 3JaWCm3MlYAZhyjzzuowr7yw5E7vj8skEL8jM= 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; bh=IpEA0+EX+q0/rUB0WE6YIKr+ltSD2JHNs74GyjuFpOQ=; b=X50ZIDsjG8HX7qRpMM43ofx/RWn9AVuHHm6csMU9JZLZNp0Fs5JYpsXVb6vkDPdw+G 3GuAuywUMwJ+5k5RVne5/6aaedUtSkpFGZX8Ffi5HQcDk7GhEXRl1u/fssJRIX24RQR1 Ousrgz0aCe6TtS1Y7gcQJ+d0OAVEOv3pjxhZ+Xkm7Bg/wpai1D4Z89DwbGxZSy6CnqvO FTfMyDzibjeNMR/dagUNkMRXY7s7QvOQv71CSp2kKEmvXphzZhJuqL+F/u2mEEc0Y60v za6/DRzeajaJo8Yvz5KJ3hVyZlUZ5ES2zKUEdhXEWkjAjbcXRRVMdj2LmZ0rRKmDtdvz 5vDA== X-Gm-Message-State: AKwxytfQXLhEkfH53OqukxuTSldeT9jfmKJ/QAnTgHg2qatG/AqfC5uF KfbLVKPrfRdTyyx3eOsGg8ctyPu4y/U= X-Received: by 10.46.22.9 with SMTP id w9mr14269071ljd.91.1516344192967; Thu, 18 Jan 2018 22:43:12 -0800 (PST) Received: from localhost.localdomain (c-cb7471d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.116.203]) by smtp.gmail.com with ESMTPSA id w13sm1633073ljw.69.2018.01.18.22.43.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 22:43:12 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij Subject: [PATCH 07/12] gpio: bcm-kona: Include proper header Date: Fri, 19 Jan 2018 07:40:38 +0100 Message-Id: <20180119064043.18241-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180119064043.18241-1-linus.walleij@linaro.org> References: <20180119064043.18241-1-linus.walleij@linaro.org> 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-bcm-kona.c | 8 ++++---- 1 file changed, 4 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-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index dfcf56ee3c61..f4c793e9a92b 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -127,7 +127,7 @@ static int bcm_kona_gpio_get_dir(struct gpio_chip *chip, unsigned gpio) u32 val; val = readl(reg_base + GPIO_CONTROL(gpio)) & GPIO_GPCTR0_IOTR_MASK; - return val ? GPIOF_DIR_IN : GPIOF_DIR_OUT; + return !!val; } static void bcm_kona_gpio_set(struct gpio_chip *chip, unsigned gpio, int value) @@ -144,7 +144,7 @@ static void bcm_kona_gpio_set(struct gpio_chip *chip, unsigned gpio, int value) raw_spin_lock_irqsave(&kona_gpio->lock, flags); /* this function only applies to output pin */ - if (bcm_kona_gpio_get_dir(chip, gpio) == GPIOF_DIR_IN) + if (bcm_kona_gpio_get_dir(chip, gpio) == 1) goto out; reg_offset = value ? GPIO_OUT_SET(bank_id) : GPIO_OUT_CLEAR(bank_id); @@ -170,7 +170,7 @@ static int bcm_kona_gpio_get(struct gpio_chip *chip, unsigned gpio) reg_base = kona_gpio->reg_base; raw_spin_lock_irqsave(&kona_gpio->lock, flags); - if (bcm_kona_gpio_get_dir(chip, gpio) == GPIOF_DIR_IN) + if (bcm_kona_gpio_get_dir(chip, gpio) == 1) reg_offset = GPIO_IN_STATUS(bank_id); else reg_offset = GPIO_OUT_STATUS(bank_id);