From patchwork Mon Dec 2 10:27:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Jensen X-Patchwork-Id: 3264651 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 155A09F373 for ; Mon, 2 Dec 2013 10:29:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DAB3F20268 for ; Mon, 2 Dec 2013 10:29:25 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A3590201E7 for ; Mon, 2 Dec 2013 10:29:24 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VnQkg-0000zo-O3; Mon, 02 Dec 2013 10:29:18 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VnQke-0000gA-CW; Mon, 02 Dec 2013 10:29:16 +0000 Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VnQka-0000e3-Nk for linux-arm-kernel@lists.infradead.org; Mon, 02 Dec 2013 10:29:14 +0000 Received: by mail-lb0-f172.google.com with SMTP id z5so8423509lbh.3 for ; Mon, 02 Dec 2013 02:28:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aDXnnGuh6kOy3VsFai9YY5Pl+NLOJC0mKNxh31BZHfw=; b=UL901zSX6YjaezwXWVNeIFoY1lPbodVLoRcydxEngzgvtZVBucMESzwPMTMXCux58Y bwdxv06FK4OIq5nLKf8ocFdpiDGQGFQXHIknIw/v5XR+nE5/H6Ja+1mUEP64TIZPnwHz Eih+pSVqrZLpjmgXHeVBIhF1jTj9SxbAOIUYqdSCHqhcbo5wlg3gYFvp8fOWc9Aue9kj +2zYXZ4LLkK0bajYJj6hnCwTe8flnjRDYs/6tXX4f7ylpueFYilCWjzZUy3uaLfbXn+K Sk771MfQhklZTzlLt27w2vMpRNyMJQ9wCAvmB9FFCibZNMeZRa+EQ4SmZF8129zoJU8x jgWg== X-Received: by 10.152.120.102 with SMTP id lb6mr176195lab.37.1385980129629; Mon, 02 Dec 2013 02:28:49 -0800 (PST) Received: from Ildjarn.ath.cx (static-213-115-41-10.sme.bredbandsbolaget.se. [213.115.41.10]) by mx.google.com with ESMTPSA id np10sm39760254lbb.7.2013.12.02.02.28.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 02 Dec 2013 02:28:48 -0800 (PST) From: Jonas Jensen To: linux-gpio@vger.kernel.org Subject: [PATCH] gpio: MOXA ART: rename moxart_gpio_base to base Date: Mon, 2 Dec 2013 11:27:59 +0100 Message-Id: <1385980079-20175-1-git-send-email-jonas.jensen@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1385723494-8033-1-git-send-email-jonas.jensen@gmail.com> References: <1385723494-8033-1-git-send-email-jonas.jensen@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131202_052912_923898_1D85F9F4 X-CRM114-Status: GOOD ( 12.54 ) X-Spam-Score: -2.0 (--) Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, arnd@arndb.de, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, Jonas Jensen , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Renaming "moxart_gpio_base" to "base" allows better fit, remove line breaks in moxart_gpio_get(). While doing trivial cleanup, also remove fields initialized with zero in moxart_template_chip. Signed-off-by: Jonas Jensen --- Notes: Thanks for applying! This is a follow-up with trivial changes per your comments. Regarding Documentation/devicetree/bindings/vendor-prefixes.txt, there's already a patch submitted (Mark Rutland requested this): https://lkml.org/lkml/2013/10/8/451 Applies to next-20131202 drivers/gpio/gpio-moxart.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/gpio/gpio-moxart.c b/drivers/gpio/gpio-moxart.c index d662cde..4ecd195 100644 --- a/drivers/gpio/gpio-moxart.c +++ b/drivers/gpio/gpio-moxart.c @@ -30,7 +30,7 @@ struct moxart_gpio_chip { struct gpio_chip gpio; - void __iomem *moxart_gpio_base; + void __iomem *base; }; static inline struct moxart_gpio_chip *to_moxart_gpio(struct gpio_chip *chip) @@ -51,7 +51,7 @@ static void moxart_gpio_free(struct gpio_chip *chip, unsigned offset) static int moxart_gpio_direction_input(struct gpio_chip *chip, unsigned offset) { struct moxart_gpio_chip *gc = to_moxart_gpio(chip); - void __iomem *ioaddr = gc->moxart_gpio_base + GPIO_PIN_DIRECTION; + void __iomem *ioaddr = gc->base + GPIO_PIN_DIRECTION; writel(readl(ioaddr) & ~BIT(offset), ioaddr); return 0; @@ -61,7 +61,7 @@ static int moxart_gpio_direction_output(struct gpio_chip *chip, unsigned offset, int value) { struct moxart_gpio_chip *gc = to_moxart_gpio(chip); - void __iomem *ioaddr = gc->moxart_gpio_base + GPIO_PIN_DIRECTION; + void __iomem *ioaddr = gc->base + GPIO_PIN_DIRECTION; writel(readl(ioaddr) | BIT(offset), ioaddr); return 0; @@ -70,7 +70,7 @@ static int moxart_gpio_direction_output(struct gpio_chip *chip, static void moxart_gpio_set(struct gpio_chip *chip, unsigned offset, int value) { struct moxart_gpio_chip *gc = to_moxart_gpio(chip); - void __iomem *ioaddr = gc->moxart_gpio_base + GPIO_DATA_OUT; + void __iomem *ioaddr = gc->base + GPIO_DATA_OUT; u32 reg = readl(ioaddr); if (value) @@ -85,14 +85,12 @@ static void moxart_gpio_set(struct gpio_chip *chip, unsigned offset, int value) static int moxart_gpio_get(struct gpio_chip *chip, unsigned offset) { struct moxart_gpio_chip *gc = to_moxart_gpio(chip); - u32 ret = readl(gc->moxart_gpio_base + GPIO_PIN_DIRECTION); + u32 ret = readl(gc->base + GPIO_PIN_DIRECTION); if (ret & BIT(offset)) - return !!(readl(gc->moxart_gpio_base + GPIO_DATA_OUT) & - BIT(offset)); + return !!(readl(gc->base + GPIO_DATA_OUT) & BIT(offset)); else - return !!(readl(gc->moxart_gpio_base + GPIO_DATA_IN) & - BIT(offset)); + return !!(readl(gc->base + GPIO_DATA_IN) & BIT(offset)); } static struct gpio_chip moxart_template_chip = { @@ -103,9 +101,7 @@ static struct gpio_chip moxart_template_chip = { .direction_output = moxart_gpio_direction_output, .set = moxart_gpio_set, .get = moxart_gpio_get, - .base = 0, .ngpio = 32, - .can_sleep = 0, }; static int moxart_gpio_probe(struct platform_device *pdev) @@ -123,11 +119,11 @@ static int moxart_gpio_probe(struct platform_device *pdev) mgc->gpio = moxart_template_chip; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mgc->moxart_gpio_base = devm_ioremap_resource(dev, res); - if (IS_ERR(mgc->moxart_gpio_base)) { + mgc->base = devm_ioremap_resource(dev, res); + if (IS_ERR(mgc->base)) { dev_err(dev, "%s: devm_ioremap_resource res_gpio failed\n", dev->of_node->full_name); - return PTR_ERR(mgc->moxart_gpio_base); + return PTR_ERR(mgc->base); } mgc->gpio.dev = dev;