From patchwork Tue Sep 10 12:31:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2866351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 215C3BF43F for ; Tue, 10 Sep 2013 13:51:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70857202B9 for ; Tue, 10 Sep 2013 13:51:33 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 209B8202B1 for ; Tue, 10 Sep 2013 13:51:32 +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 1VJNTr-0002cK-I2; Tue, 10 Sep 2013 12:55:44 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJNTD-0003Le-Ie; Tue, 10 Sep 2013 12:55:03 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJNS8-0003DP-Aa for linux-arm-kernel@merlin.infradead.org; Tue, 10 Sep 2013 12:53:56 +0000 Received: from mail-la0-f45.google.com ([209.85.215.45]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJN6g-0002O9-5y for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2013 12:31:47 +0000 Received: by mail-la0-f45.google.com with SMTP id eh20so6152022lab.32 for ; Tue, 10 Sep 2013 05:31:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sXyMzoKOm0UNbgKZzKwgIzxdDUdX0K8jSNLMNU/hg7U=; b=WV0OOpQRqr7fcHkgaGGgKKq+pw4pYyM0ziAIkLPxU0wjeOa7XbIHqCVhL3PxyqWBBF 39Z0gqy9rM9V4TM9VSUJWia25gcAsEZDn/FgOq5QIsgqciGTz8+2j/k0/6qADkSLSNei SrSQ83Hk5dUNmxl0LdpgLqpaFtWpGl1dV+k2/5b2QemHovy4YhkSMLvE5qgklMLooekW LknvPEdqLPqW7Pl4Akan2ThZWgC2VnERjRLP/yoekIDDXQa/FO0VTNvkhlEkeiaGhZ7k Gvp/7j9gh4B2uwdMFgRcOmBGO5Y0FoL015QyOV3xif+vdY7OoYsik+An4axkEtjnVaVd XI8g== X-Gm-Message-State: ALoCoQlLdDAojWSdvOSHakx6qO+L3QRJjgONriqNtGON+WrvfeUJZc+fGy7j28avQf7XdIiVxzBz X-Received: by 10.152.115.176 with SMTP id jp16mr21082684lab.17.1378816266029; Tue, 10 Sep 2013 05:31:06 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id i3sm9039522laf.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:31:05 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Imre Kaloz , Krzysztof Halasa , Richard Cochran Subject: [PATCH 4/7] ptp: switch to use gpiolib Date: Tue, 10 Sep 2013 14:31:00 +0200 Message-Id: <1378816260-8091-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130910_053146_419478_B6ADA272 X-CRM114-Status: GOOD ( 12.68 ) X-Spam-Score: -0.7 (/) Cc: netdev@vger.kernel.org, Linus Walleij , Alexandre Courbot , 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 This platform supports gpiolib, so remove the custom API use and replace with calls to gpiolib. Also request the GPIO before starting to use it. Cc: Imre Kaloz Cc: Krzysztof Halasa Cc: Alexandre Courbot Cc: Richard Cochran Cc: netdev@vger.kernel.org Signed-off-by: Linus Walleij Acked-by: Richard Cochran --- Hi Richard, I'm seeking an ACK on this patch to take it throug the GPIO tree as part of a clean-out of custom GPIO implementations. --- drivers/ptp/ptp_ixp46x.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/ptp/ptp_ixp46x.c b/drivers/ptp/ptp_ixp46x.c index d49b851..4a08727 100644 --- a/drivers/ptp/ptp_ixp46x.c +++ b/drivers/ptp/ptp_ixp46x.c @@ -259,8 +259,15 @@ static struct ixp_clock ixp_clock; static int setup_interrupt(int gpio) { int irq; + int err; - gpio_line_config(gpio, IXP4XX_GPIO_IN); + err = gpio_request(gpio, "ixp4-ptp"); + if (err) + return err; + + err = gpio_direction_input(gpio); + if (err) + return err; irq = gpio_to_irq(gpio);