Received: by 10.192.165.148 with SMTP id m20csp495511imm; Fri, 27 Apr 2018 02:36:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoux+udCKsz/ofUhMp6Oc9XWvRqa07o8GGWTSL9F7Kmz7HddEhhikpwBB5AoaRz0hW7K7vY X-Received: by 2002:a65:5cc6:: with SMTP id b6-v6mr1485028pgt.84.1524821761072; Fri, 27 Apr 2018 02:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524821761; cv=none; d=google.com; s=arc-20160816; b=khwKQiGXFQmd4jEg34yigmFv1wCUh9IEgnEbL3m4mhfNzI0RBmgvHDrP3MoOsbqkMN vbmdM5LBO8ZGzSS3tfTYKVjkh8rhFiwZ5o4XuZcHmMSVVzkY1kQWC6gTPjgIhvrBgB2L K7WXOdguKaDEl4o9vQxZLof9zkHPBfVLahHmI5z+qjRe6k+4gWuKjr2xHRFtuMg2DvH4 Z7o54tA6UlvOVFrGNO+FWNfL2q0Y2gdMgPxH0XhDBUMT4gk0zOQ/rosXWpcfTsbgQdxO DHZMTP9Faw8JVuRd2E0bcm1dqu1ioqUC7rbqE0QQfIg7OncrJ9rfp81ibYRdcsKr/woI pWCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=QQvRWnyS7VBr4TLVmB+lwFvwwBnEJFghWMaZtEc1KB4=; b=qSeZhcwytB9Ri4tTJnJpmW8ofUK8jjkgUC2d0aP7Gn2Ik3ZY2C/8jEjqlSjrYwjSYy eVaFFTS82vyW0iaex3J/fWo3OQXlY/GTt+P70ZtpuhuUFtk88MxzU8MrLWHtu5eedObq DTIM1OzHyHSmTO8GNkdTjM6HiXsgaStyowFH0lkwohqoaMXaUzvBjgrGt8tABBQ3it9S w2NoGelH8LHraKt7LIhpBrfs/yb+pvlpsGkHkTDwP9B0sORYUJjPf4nY1chLG4HCUVE3 Ysu993QxLLxpHIJYziykY4/JQuipiYx3zxXoUxiIhtEqJLHDXYD8Ft1UxzNJCQERCpTz hgeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pC3IAi4U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k16-v6si1003721pli.171.2018.04.27.02.35.47; Fri, 27 Apr 2018 02:36:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=pC3IAi4U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757832AbeD0JdR (ORCPT + 99 others); Fri, 27 Apr 2018 05:33:17 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:42559 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751557AbeD0JdP (ORCPT ); Fri, 27 Apr 2018 05:33:15 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3R9WxJf021331; Fri, 27 Apr 2018 04:32:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524821579; bh=DtC7yVbj9Z2RqzQAV9qo6AmixwjplX9PCxmA5pkAlr8=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=pC3IAi4U7507164jQBPoqrVphvnwymisNGSjFgczXzCkHKFzzBdwmrotQ/30xRZoy D/ylAJr7vAkyGvJ2XacMZ5zFfLuRRXEVxgRJnZih4R718xwv+qAclZFLUudl1WIuop WNnHmQkENYebudywQPOZW/w+OMTANw7cBFOOuQqc= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3R9WxwI021429; Fri, 27 Apr 2018 04:32:59 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 27 Apr 2018 04:32:59 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 27 Apr 2018 04:32:59 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3R9WvjT022268; Fri, 27 Apr 2018 04:32:57 -0500 Subject: Re: [alsa-devel] [PATCH 1/3] ASoC: tlv320dac33: Use gpio_is_valid() To: Arvind Yadav , , , CC: , , References: From: Peter Ujfalusi Message-ID: Date: Fri, 27 Apr 2018 12:33:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-04-27 11:56, Arvind Yadav wrote: > Replace the manual validity checks for the GPIO with the > gpio_is_valid(). Acked-by: Peter Ujfalusi > Signed-off-by: Arvind Yadav > --- > sound/soc/codecs/tlv320dac33.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c > index a957eae..c23b9db 100644 > --- a/sound/soc/codecs/tlv320dac33.c > +++ b/sound/soc/codecs/tlv320dac33.c > @@ -397,13 +397,13 @@ static int dac33_hard_power(struct snd_soc_component *component, int power) > goto exit; > } > > - if (dac33->power_gpio >= 0) > + if (gpio_is_valid(dac33->power_gpio)) > gpio_set_value(dac33->power_gpio, 1); > > dac33->chip_power = 1; > } else { > dac33_soft_power(component, 0); > - if (dac33->power_gpio >= 0) > + if (gpio_is_valid(dac33->power_gpio)) > gpio_set_value(dac33->power_gpio, 0); > > ret = regulator_bulk_disable(ARRAY_SIZE(dac33->supplies), > @@ -1519,7 +1519,7 @@ static int dac33_i2c_probe(struct i2c_client *client, > dac33->fifo_mode = DAC33_FIFO_BYPASS; > > /* Check if the reset GPIO number is valid and request it */ > - if (dac33->power_gpio >= 0) { > + if (gpio_is_valid(dac33->power_gpio)) { > ret = gpio_request(dac33->power_gpio, "tlv320dac33 reset"); > if (ret < 0) { > dev_err(&client->dev, > @@ -1548,7 +1548,7 @@ static int dac33_i2c_probe(struct i2c_client *client, > > return ret; > err_get: > - if (dac33->power_gpio >= 0) > + if (gpio_is_valid(dac33->power_gpio)) > gpio_free(dac33->power_gpio); > err_gpio: > return ret; > @@ -1561,7 +1561,7 @@ static int dac33_i2c_remove(struct i2c_client *client) > if (unlikely(dac33->chip_power)) > dac33_hard_power(dac33->component, 0); > > - if (dac33->power_gpio >= 0) > + if (gpio_is_valid(dac33->power_gpio)) > gpio_free(dac33->power_gpio); > > return 0; > - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki