From patchwork Mon Jul 24 14:55:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 792832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qONAFfnH"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xGPZ16yzyz9s4q for ; Tue, 25 Jul 2017 00:55:37 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756352AbdGXOzg (ORCPT ); Mon, 24 Jul 2017 10:55:36 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36393 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756244AbdGXOzP (ORCPT ); Mon, 24 Jul 2017 10:55:15 -0400 Received: by mail-wm0-f67.google.com with SMTP id 184so12939293wmo.3; Mon, 24 Jul 2017 07:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bxa7HwvitWWtViQQStVQoumY7dpp4ouJ+daNBeHl/NA=; b=qONAFfnHFmCgz+eHhwBrj7KXGJuKmysyO3EpQw2iKIX8JekZ7SEAlSaHvxdEHeHQKN WWHdp8ol7zzfFybKlr0BS6tP99gSIJg+Dy2FGdM8JrsWl9ka3uepMb7dXalMheaiIDYc peYDy/S9W3K/fyrKaFkOeOb0F8vBz+ZOWTKBrGqfUeIOe3s2Rtud+lWK7hYymneXG208 ogv6zNlx+ny1CS8FXorTGeC9hbB4aSS8vWlURMSjW4YXwRTwA8xTkOw9YJB2iAEDRFJd hOXxqhTOrp47ph2Ju3EWQkwhckkeA288Bn28pGI0zPBVqwpVQ7dzC6sYNE9r8RarVoXg rHMw== 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=bxa7HwvitWWtViQQStVQoumY7dpp4ouJ+daNBeHl/NA=; b=h0Q+5X/bRcmlbAQEzK4HsGOC081CToj5AE854PFMfC5cUVYe6Ot8yPNE8if6XpsA/t rLr0940WJf94khlZ43dsqgOap+8wwsjXSnoRxZFMtrRy331YGioJVXQI+ZS3q7ony/CD +X5ySfvNlKejN6F6ond3SD3aD83tz1bc3QCs0QGXVoO8r8j/30GAuKfKutZQqtcXzTEv Yv1A5E1QLbncspQKSWVTNlmRrrX7NL2q8hl9sdxlKNSxz7lVHNesY+YOJqIpjEzOwUPT 27WiX3qsTq0SFwCnpnzqc1O4HhbrHegx2zFDKFQ4xD5f1GpbjQnSAPFTCbutwRYX+SHe Grrg== X-Gm-Message-State: AIVw112K6TCykVZgxEM7RtOIutXf3JgpaXfQW8TXX7mmaZFJ8aN/jx31 9ewrvU9Rr7e/7Q== X-Received: by 10.28.69.197 with SMTP id l66mr4686329wmi.140.1500908113437; Mon, 24 Jul 2017 07:55:13 -0700 (PDT) Received: from localhost (p200300E41BDFF20076D02BFFFE273F51.dip0.t-ipconnect.de. [2003:e4:1bdf:f200:76d0:2bff:fe27:3f51]) by smtp.gmail.com with ESMTPSA id 62sm355150wrq.35.2017.07.24.07.55.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jul 2017 07:55:12 -0700 (PDT) From: Thierry Reding To: Linus Walleij Cc: Jonathan Hunter , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] gpio: tegra: Fix checkpatch warnings Date: Mon, 24 Jul 2017 16:55:07 +0200 Message-Id: <20170724145508.7388-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170724145508.7388-1-thierry.reding@gmail.com> References: <20170724145508.7388-1-thierry.reding@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Thierry Reding Fix a couple of checkpatch warnings, such as complaints about bare unsigned being used (instead of unsigned int) and missing blank lines after declarations. Signed-off-by: Thierry Reding Acked-by: Jon Hunter --- drivers/gpio/gpio-tegra.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 1d4df290d7ab..edc1a14557f0 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -138,12 +138,12 @@ static void tegra_gpio_disable(struct tegra_gpio_info *tgi, int gpio) tegra_gpio_mask_write(tgi, GPIO_MSK_CNF(tgi, gpio), gpio, 0); } -static int tegra_gpio_request(struct gpio_chip *chip, unsigned offset) +static int tegra_gpio_request(struct gpio_chip *chip, unsigned int offset) { return pinctrl_request_gpio(offset); } -static void tegra_gpio_free(struct gpio_chip *chip, unsigned offset) +static void tegra_gpio_free(struct gpio_chip *chip, unsigned int offset) { struct tegra_gpio_info *tgi = gpiochip_get_data(chip); @@ -151,14 +151,15 @@ static void tegra_gpio_free(struct gpio_chip *chip, unsigned offset) tegra_gpio_disable(tgi, offset); } -static void tegra_gpio_set(struct gpio_chip *chip, unsigned offset, int value) +static void tegra_gpio_set(struct gpio_chip *chip, unsigned int offset, + int value) { struct tegra_gpio_info *tgi = gpiochip_get_data(chip); tegra_gpio_mask_write(tgi, GPIO_MSK_OUT(tgi, offset), offset, value); } -static int tegra_gpio_get(struct gpio_chip *chip, unsigned offset) +static int tegra_gpio_get(struct gpio_chip *chip, unsigned int offset) { struct tegra_gpio_info *tgi = gpiochip_get_data(chip); int bval = BIT(GPIO_BIT(offset)); @@ -170,7 +171,8 @@ static int tegra_gpio_get(struct gpio_chip *chip, unsigned offset) return !!(tegra_gpio_readl(tgi, GPIO_IN(tgi, offset)) & bval); } -static int tegra_gpio_direction_input(struct gpio_chip *chip, unsigned offset) +static int tegra_gpio_direction_input(struct gpio_chip *chip, + unsigned int offset) { struct tegra_gpio_info *tgi = gpiochip_get_data(chip); @@ -179,8 +181,9 @@ static int tegra_gpio_direction_input(struct gpio_chip *chip, unsigned offset) return 0; } -static int tegra_gpio_direction_output(struct gpio_chip *chip, unsigned offset, - int value) +static int tegra_gpio_direction_output(struct gpio_chip *chip, + unsigned int offset, + int value) { struct tegra_gpio_info *tgi = gpiochip_get_data(chip); @@ -190,7 +193,8 @@ static int tegra_gpio_direction_output(struct gpio_chip *chip, unsigned offset, return 0; } -static int tegra_gpio_get_direction(struct gpio_chip *chip, unsigned offset) +static int tegra_gpio_get_direction(struct gpio_chip *chip, + unsigned int offset) { struct tegra_gpio_info *tgi = gpiochip_get_data(chip); u32 pin_mask = BIT(GPIO_BIT(offset)); @@ -250,7 +254,7 @@ static int tegra_gpio_set_config(struct gpio_chip *chip, unsigned int offset, return tegra_gpio_set_debounce(chip, offset, debounce); } -static int tegra_gpio_to_irq(struct gpio_chip *chip, unsigned offset) +static int tegra_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) { struct tegra_gpio_info *tgi = gpiochip_get_data(chip); @@ -413,7 +417,8 @@ static int tegra_gpio_resume(struct device *dev) struct tegra_gpio_bank *bank = &tgi->bank_info[b]; for (p = 0; p < ARRAY_SIZE(bank->oe); p++) { - unsigned int gpio = (b<<5) | (p<<3); + unsigned int gpio = (b << 5) | (p << 3); + tegra_gpio_writel(tgi, bank->cnf[p], GPIO_CNF(tgi, gpio)); @@ -452,7 +457,8 @@ static int tegra_gpio_suspend(struct device *dev) struct tegra_gpio_bank *bank = &tgi->bank_info[b]; for (p = 0; p < ARRAY_SIZE(bank->oe); p++) { - unsigned int gpio = (b<<5) | (p<<3); + unsigned int gpio = (b << 5) | (p << 3); + bank->cnf[p] = tegra_gpio_readl(tgi, GPIO_CNF(tgi, gpio)); bank->out[p] = tegra_gpio_readl(tgi, @@ -513,6 +519,7 @@ static int dbg_gpio_show(struct seq_file *s, void *unused) for (i = 0; i < tgi->bank_count; i++) { for (j = 0; j < 4; j++) { int gpio = tegra_gpio_compose(i, j, 0); + seq_printf(s, "%d:%d %02x %02x %02x %02x %02x %02x %06x\n", i, j, @@ -542,7 +549,7 @@ static const struct file_operations debug_fops = { static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) { - (void) debugfs_create_file("tegra_gpio", S_IRUGO, + (void) debugfs_create_file("tegra_gpio", 0444, NULL, tgi, &debug_fops); } @@ -653,6 +660,7 @@ static int tegra_gpio_probe(struct platform_device *pdev) for (i = 0; i < tgi->bank_count; i++) { for (j = 0; j < 4; j++) { int gpio = tegra_gpio_compose(i, j, 0); + tegra_gpio_writel(tgi, 0x00, GPIO_INT_ENB(tgi, gpio)); } }