From patchwork Thu Oct 23 08:15:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 5138411 Return-Path: X-Original-To: patchwork-alsa-devel@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 34B859F3ED for ; Thu, 23 Oct 2014 08:15:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 616492021A for ; Thu, 23 Oct 2014 08:15:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C258F20204 for ; Thu, 23 Oct 2014 08:15:51 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B1C89260424; Thu, 23 Oct 2014 10:15:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 52597260417; Thu, 23 Oct 2014 10:15:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 131D126041A; Thu, 23 Oct 2014 10:15:37 +0200 (CEST) Received: from hqemgate15.nvidia.com (hqemgate15.nvidia.com [216.228.121.64]) by alsa0.perex.cz (Postfix) with ESMTP id BCD40260416 for ; Thu, 23 Oct 2014 10:15:28 +0200 (CEST) Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Thu, 23 Oct 2014 01:15:51 -0700 Received: from hqemhub02.nvidia.com ([172.20.12.94]) by hqnvupgp07.nvidia.com (PGP Universal service); Thu, 23 Oct 2014 01:11:25 -0700 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Thu, 23 Oct 2014 01:11:25 -0700 Received: from percival.nvidia.com (172.20.144.16) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server (TLS) id 8.3.342.0; Thu, 23 Oct 2014 01:15:26 -0700 From: Alexandre Courbot To: Liam Girdwood , Mark Brown Date: Thu, 23 Oct 2014 17:15:18 +0900 Message-ID: <1414052118-19742-1-git-send-email-acourbot@nvidia.com> X-Mailer: git-send-email 2.1.2 X-NVConfidentiality: public MIME-Version: 1.0 Cc: gnurou@gmail.com, alsa-devel@alsa-project.org, Alexandre Courbot , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: jack: update calls to gpiod_get*() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Add the new flags argument to calls of (devm_)gpiod_get*() and remove any direction setting code afterwards. Currently both forms (with or without the flags argument) are valid thanks to transitional macros in . These macros will be removed once all consumers are updated and the flags argument will become compulsary. Signed-off-by: Alexandre Courbot --- sound/soc/soc-jack.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index ab47fea997a3..f921d0098518 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -309,7 +309,7 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, /* GPIO descriptor */ gpios[i].desc = gpiod_get_index(gpios[i].gpiod_dev, gpios[i].name, - gpios[i].idx); + gpios[i].idx, GPIOD_IN); if (IS_ERR(gpios[i].desc)) { ret = PTR_ERR(gpios[i].desc); dev_err(gpios[i].gpiod_dev, @@ -327,17 +327,14 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, goto undo; } - ret = gpio_request(gpios[i].gpio, gpios[i].name); + ret = gpio_request_one(gpios[i].gpio, GPIOF_IN, + gpios[i].name); if (ret) goto undo; gpios[i].desc = gpio_to_desc(gpios[i].gpio); } - ret = gpiod_direction_input(gpios[i].desc); - if (ret) - goto err; - INIT_DELAYED_WORK(&gpios[i].work, gpio_work); gpios[i].jack = jack;