From patchwork Fri Nov 22 12:14:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 3222321 Return-Path: X-Original-To: patchwork-linux-acpi@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 063749F3A0 for ; Fri, 22 Nov 2013 12:16:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94F0120715 for ; Fri, 22 Nov 2013 12:16:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0ADA8205F0 for ; Fri, 22 Nov 2013 12:16:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755535Ab3KVMOl (ORCPT ); Fri, 22 Nov 2013 07:14:41 -0500 Received: from mga11.intel.com ([192.55.52.93]:54222 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755165Ab3KVMOj (ORCPT ); Fri, 22 Nov 2013 07:14:39 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 22 Nov 2013 04:14:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,751,1378882800"; d="scan'208";a="432088720" Received: from blue.fi.intel.com ([10.237.72.156]) by fmsmga001.fm.intel.com with ESMTP; 22 Nov 2013 04:14:35 -0800 Received: by blue.fi.intel.com (Postfix, from userid 1004) id 325BCE0093; Fri, 22 Nov 2013 14:14:34 +0200 (EET) From: Mika Westerberg To: linux-acpi@vger.kernel.org Cc: "Rafael J. Wysocki" , Linus Walleij , Chris Ball , Johannes Berg , Rhyland Klein , Adrian Hunter , Alexandre Courbot , Mathias Nyman , Rob Landley , Heikki Krogerus , Stephen Warren , Thierry Reding , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/7] net: rfkill: gpio: remove gpio conversion support Date: Fri, 22 Nov 2013 14:14:30 +0200 Message-Id: <1385122474-14926-4-git-send-email-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1385122474-14926-1-git-send-email-mika.westerberg@linux.intel.com> References: <1385122474-14926-1-git-send-email-mika.westerberg@linux.intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Heikki Krogerus All platforms using this driver are now converted to the new descriptor-based GPIO interface. Signed-off-by: Heikki Krogerus Signed-off-by: Mika Westerberg --- net/rfkill/rfkill-gpio.c | 61 ++++++++++-------------------------------------- 1 file changed, 12 insertions(+), 49 deletions(-) diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 503432154616..bd2a5b90400c 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -68,35 +68,6 @@ static const struct rfkill_ops rfkill_gpio_ops = { .set_block = rfkill_gpio_set_power, }; -static int rfkill_gpio_convert_to_desc(struct platform_device *pdev, - struct rfkill_gpio_data *rfkill) -{ - struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data; - int ret; - - if (gpio_is_valid(pdata->reset_gpio)) { - ret = devm_gpio_request_one(&pdev->dev, pdata->reset_gpio, - 0, rfkill->reset_name); - if (ret) { - dev_err(&pdev->dev, "failed to get reset gpio.\n"); - return ret; - } - rfkill->reset_gpio = gpio_to_desc(pdata->reset_gpio); - } - - if (gpio_is_valid(pdata->shutdown_gpio)) { - ret = devm_gpio_request_one(&pdev->dev, pdata->shutdown_gpio, - 0, rfkill->shutdown_name); - if (ret) { - dev_err(&pdev->dev, "failed to get shutdown gpio.\n"); - return ret; - } - rfkill->shutdown_gpio = gpio_to_desc(pdata->shutdown_gpio); - } - - return 0; -} - static int rfkill_gpio_acpi_probe(struct device *dev, struct rfkill_gpio_data *rfkill) { @@ -117,6 +88,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev) struct rfkill_gpio_platform_data *pdata = pdev->dev.platform_data; struct rfkill_gpio_data *rfkill; const char *clk_name = NULL; + struct gpio_desc *gpio; int ret; int len; @@ -150,29 +122,20 @@ static int rfkill_gpio_probe(struct platform_device *pdev) rfkill->clk = devm_clk_get(&pdev->dev, clk_name); - if (pdata && (pdata->reset_gpio || pdata->shutdown_gpio)) { - ret = rfkill_gpio_convert_to_desc(pdev, rfkill); + gpio = devm_gpiod_get_index(&pdev->dev, rfkill->reset_name, 0); + if (!IS_ERR(gpio)) { + ret = gpiod_direction_output(gpio, 0); if (ret) return ret; - } else { - struct gpio_desc *gpio; - - gpio = devm_gpiod_get_index(&pdev->dev, rfkill->reset_name, 0); - if (!IS_ERR(gpio)) { - ret = gpiod_direction_output(gpio, 0); - if (ret) - return ret; - rfkill->reset_gpio = gpio; - } + rfkill->reset_gpio = gpio; + } - gpio = devm_gpiod_get_index(&pdev->dev, - rfkill->shutdown_name, 1); - if (!IS_ERR(gpio)) { - ret = gpiod_direction_output(gpio, 0); - if (ret) - return ret; - rfkill->shutdown_gpio = gpio; - } + gpio = devm_gpiod_get_index(&pdev->dev, rfkill->shutdown_name, 1); + if (!IS_ERR(gpio)) { + ret = gpiod_direction_output(gpio, 0); + if (ret) + return ret; + rfkill->shutdown_gpio = gpio; } /* Make sure at-least one of the GPIO is defined and that