From patchwork Tue Nov 25 19:29:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 5382401 Return-Path: X-Original-To: patchwork-alsa-devel@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 69B3FC11AC for ; Tue, 25 Nov 2014 19:29:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0B3620121 for ; Tue, 25 Nov 2014 19:29:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1787120108 for ; Tue, 25 Nov 2014 19:29:16 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D88C3260603; Tue, 25 Nov 2014 20:29:13 +0100 (CET) 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,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 49A52260603; Tue, 25 Nov 2014 20:29:03 +0100 (CET) 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 E7828260608; Tue, 25 Nov 2014 20:29:00 +0100 (CET) Received: from smtp-out-208.synserver.de (smtp-out-210.synserver.de [212.40.185.210]) by alsa0.perex.cz (Postfix) with ESMTP id C94B5260600 for ; Tue, 25 Nov 2014 20:28:52 +0100 (CET) Received: (qmail 7299 invoked by uid 0); 25 Nov 2014 19:28:52 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@laprican.de X-SynServer-PPID: 6980 Received: from ppp-82-135-76-235.dynamic.mnet-online.de (HELO lars-laptop.fritz.box) [82.135.76.235] by 217.119.54.96 with SMTP; 25 Nov 2014 19:28:51 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Tue, 25 Nov 2014 20:29:40 +0100 Message-Id: <1416943780-1016-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.7.10.4 Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen Subject: [alsa-devel] [PATCH] ASoC: qi_lb60: Pass flags 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Pass flags to gpiod_get() to automatically configure the GPIOs. This is shorter and not passing any flags to gpiod_get() will eventually no longer be supported. Signed-off-by: Lars-Peter Clausen --- sound/soc/jz4740/qi_lb60.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/soc/jz4740/qi_lb60.c b/sound/soc/jz4740/qi_lb60.c index 5cb91f9..0fb7d2a 100644 --- a/sound/soc/jz4740/qi_lb60.c +++ b/sound/soc/jz4740/qi_lb60.c @@ -77,25 +77,18 @@ static int qi_lb60_probe(struct platform_device *pdev) { struct qi_lb60 *qi_lb60; struct snd_soc_card *card = &qi_lb60_card; - int ret; qi_lb60 = devm_kzalloc(&pdev->dev, sizeof(*qi_lb60), GFP_KERNEL); if (!qi_lb60) return -ENOMEM; - qi_lb60->snd_gpio = devm_gpiod_get(&pdev->dev, "snd"); + qi_lb60->snd_gpio = devm_gpiod_get(&pdev->dev, "snd", GPIOD_OUT_LOW); if (IS_ERR(qi_lb60->snd_gpio)) return PTR_ERR(qi_lb60->snd_gpio); - ret = gpiod_direction_output(qi_lb60->snd_gpio, 0); - if (ret) - return ret; - qi_lb60->amp_gpio = devm_gpiod_get(&pdev->dev, "amp"); + qi_lb60->amp_gpio = devm_gpiod_get(&pdev->dev, "amp", GPIOD_OUT_LOW); if (IS_ERR(qi_lb60->amp_gpio)) return PTR_ERR(qi_lb60->amp_gpio); - ret = gpiod_direction_output(qi_lb60->amp_gpio, 0); - if (ret) - return ret; card->dev = &pdev->dev;