From patchwork Wed Nov 16 13:08:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 9432193 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D230160476 for ; Wed, 16 Nov 2016 16:52:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3A2F271BC for ; Wed, 16 Nov 2016 16:52:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B895128FB3; Wed, 16 Nov 2016 16:52:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36927271BC for ; Wed, 16 Nov 2016 16:52:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D5B8E26739D; Wed, 16 Nov 2016 17:52:07 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4525526735D; Wed, 16 Nov 2016 17:49:49 +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 48FBA26689C; Wed, 16 Nov 2016 14:10:32 +0100 (CET) Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by alsa0.perex.cz (Postfix) with ESMTP id 085602606F8 for ; Wed, 16 Nov 2016 14:10:26 +0100 (CET) Received: by mail-pg0-f68.google.com with SMTP id e9so14355509pgc.1 for ; Wed, 16 Nov 2016 05:10:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0ooV1iggR/yun9uTXoDEjkxtVyNlHoQZ3IxC0tSqonQ=; b=rzw16EN0zf2SkIYUHPCkHiyQs4AkKjVzDP2N08u2OCzsSZRGg10sDbCfzUA4STJf4x 9+NdOoO4J2osFG3Wva8unf8Hqh1HXI16td2i+ycUk/CG8QlfYQuxPZ26TH60wVtW0csP oPdcu4XAxqdLcegXEigQMCiyVQ2jCpPovopFaz39DEmDbHJSceIJWc7JcJZKai84VVdB xcrCNvqf+2MpyoclFnpMwh/NPOSXADCxxJRZSf0OXMPfoV5uugCMiQmndkohTYmgQ5aD MFhdRIrrW4frUp315D+zJVNKJZquVZulhXYA5S+MR9nMrce9jqACKNQXyq4aadfDXyDW kRdQ== 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:in-reply-to :references; bh=0ooV1iggR/yun9uTXoDEjkxtVyNlHoQZ3IxC0tSqonQ=; b=HtDbv2jc4KPgX+frsZ8jrivqav30fP0JJi6mdQAuT8D8GHKpfpYDT3wthSV33hMaC6 OkBBSXiY9O+lqmnv2fO6cf0vJc4R6yXpxFfqbP8j64F0TDSJObDmmiHG8UgRiuXO6N2G FP32wODUmruI6FQUpKM+v0JXgc7hVx3Z1hKsiAS4D7rOfcewcYGHixUvqYIFXOoADnVL mqMo8NzOCeWukhPt7/20KRFGqLJ8E7+qylC3Bc25gQg6COFydXtaC1lLQFjIGfCGXh0i +0K3w4pj+efrdTJlAl4+fPH1TdE9ONEAKSn0/b70jam5dzeV/cDDaalOo2E2u+5BpMNF qE3w== X-Gm-Message-State: ABUngvfwiACpDh/t6LrBQuYmyh2hUxfIvbbM5EZwqP84n3sVKE7W7iLjkJVnRfDIo0bKvg== X-Received: by 10.99.143.90 with SMTP id r26mr8085639pgn.164.1479301825747; Wed, 16 Nov 2016 05:10:25 -0800 (PST) Received: from localhost.localdomain (218-164-96-111.dynamic.hinet.net. [218.164.96.111]) by smtp.gmail.com with ESMTPSA id y29sm53829494pfd.63.2016.11.16.05.10.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Nov 2016 05:10:25 -0800 (PST) From: Axel Lin To: Mark Brown Date: Wed, 16 Nov 2016 21:08:42 +0800 Message-Id: <20161116130842.28182-2-axel.lin@ingics.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161116130842.28182-1-axel.lin@ingics.com> References: <20161116130842.28182-1-axel.lin@ingics.com> Cc: Oder Chiou , alsa-devel@alsa-project.org, Axel Lin , Liam Girdwood , Julia Lawall , Bard Liao Subject: [alsa-devel] [PATCH 2/2] ASoC: rt5665: Use devm_gpio_request_one() 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 Simplify the code a bit. Signed-off-by: Axel Lin --- sound/soc/codecs/rt5665.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c index 7dfaaf1..324461e 100644 --- a/sound/soc/codecs/rt5665.c +++ b/sound/soc/codecs/rt5665.c @@ -4677,11 +4677,9 @@ static int rt5665_i2c_probe(struct i2c_client *i2c, } if (gpio_is_valid(rt5665->pdata.ldo1_en)) { - if (devm_gpio_request(&i2c->dev, rt5665->pdata.ldo1_en, - "rt5665")) + if (devm_gpio_request_one(&i2c->dev, rt5665->pdata.ldo1_en, + GPIOF_OUT_INIT_HIGH, "rt5665")) dev_err(&i2c->dev, "Fail gpio_request gpio_ldo\n"); - else if (gpio_direction_output(rt5665->pdata.ldo1_en, 1)) - dev_err(&i2c->dev, "Fail gpio_direction gpio_ldo\n"); } /* Sleep for 300 ms miniumum */