Received: by 10.192.165.148 with SMTP id m20csp464683imm; Fri, 27 Apr 2018 01:58:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpW1dXQnu8dj2u38ncXOZ2GKdesT//1r+ceIz2IefWCctk3Ut7eezvKrtkSbFDRlOiOwNjP X-Received: by 2002:a17:902:b942:: with SMTP id h2-v6mr1555264pls.312.1524819483170; Fri, 27 Apr 2018 01:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524819483; cv=none; d=google.com; s=arc-20160816; b=fRs+vOtMLmWO0rv0U2GGqjk46yUIwUxUP4lwJE8VFkqTR3Evr+bGDp6tUKaUmPpg2M RZcA8txOkEsqzv5dHoaj5TQJz9eScqWYfdVIC2ZkM+L0h1V8+0YD+1av+h8aokST1i89 b6VXttMyZ38K2uTWZzszOy/OBO7G5BvbBOr1m+LLH2QtsOa70ma/rbIe4lfA8vls4woN qF7qKhd5SSNuioZcMWou9I29sFRBfqCzrxToc7ycEj7NzTt8vlYHQL9UU973NDBF2fpn kD6jL8ro+2sL3CexH56x10cKWzXEItawU7gq0+M9zUpcsRy7luRs4imnXYJRbxG/ZN8a VZag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ojsepjaiINVW1DwmrAqtv/lgEGBmgbaB0xde5oe+vAo=; b=K92qQeAnwHfkiAj3BwevAumdClcvrrSl2vo/3p5Fq3Ntd6ZRoZE75e+C9XYEeYJAtd +wnulZMHDhgaVhRGpSuHotM7UqB2XK7MdDy+InqBnUF9kEEwZibqhPzhWlQC/JHDM6uq vJENyw6n7BJqERc8Hfh1wj/Hv5NtDr5+upClYkzDN+wNc+ecaWM1QWIjw+BmbaruVBeN HWzEi6Y++FjGjlj2rO0GusGoozSFeKJhiyVfh7IKJqTISDMeKubhj7kP6wMB152tyda+ g7GSnVFC0prLcXDg9qa9j4W8xjVTN7btlF4JRp5YA9K0ssEtg/I48xt6WgYSmCMMHhyL h+AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PL8ihsbg; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p6si860779pfk.357.2018.04.27.01.57.49; Fri, 27 Apr 2018 01:58:03 -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=@gmail.com header.s=20161025 header.b=PL8ihsbg; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932464AbeD0I4i (ORCPT + 99 others); Fri, 27 Apr 2018 04:56:38 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:45578 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932282AbeD0I4g (ORCPT ); Fri, 27 Apr 2018 04:56:36 -0400 Received: by mail-pg0-f66.google.com with SMTP id i29-v6so1055414pgn.12; Fri, 27 Apr 2018 01:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=ojsepjaiINVW1DwmrAqtv/lgEGBmgbaB0xde5oe+vAo=; b=PL8ihsbgKzl7XsLJ56UShBPVoNa9phfqA8u8kkw7LzUUUOW0OWXxuelnGQDvuVa+X+ 98DOvb/lZykCusk4q8jT1ccpwPE7FZzKD1gHWNxrg0PbbdJLU3w9WZNcNPWJsyG0tgAJ ak9cOi/Eqqjs5Zd+Z8HLjbBvjPoNapszyb9X9fPFNJimskWKIhOhQ2FECY/d/EnMJInA 5HW7PLEqt+1lvGXoqum1O0AxaQuqI+3iPe3ZXeNNFjHm4G2oiJHT+dpQaptJ6mdpXcip k26eg+UkYAg8/vf5TTrzp7lA++iPNbwtsS9rW4600MtBsW4WE7B0Y3UxxDTjmUrfegP8 hUBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ojsepjaiINVW1DwmrAqtv/lgEGBmgbaB0xde5oe+vAo=; b=uCtgxFqjr7pJ06At4jOLs8mf7MPpcHmSt7sQDX6sMsHZj9FPCTG2ZxDyuE3Ol4mycE bRBIlxzL+5ApsY0hYjGIQ9VRI1LiKa/aEIUppYDjTrIBl7AqEuyFh8KAB0DmBwLfQUCv OZ+K5QLjQ+evSve8d8JoE2vhowDqjtVhaW5vdVcSK/N3IfNEj1VNWFNrRIZ5/SyNzDR/ yReeWvaOTgpCkWhSfVQ4od/mAPyaWs92om6aYwVZascnzU5jf52XvF7tAAq3QmWzRnSW qNzYV9gQ8NBWzuybqiXWKwKFpCOIH0paM48z1b0UDWvc81aphAIrVOKGVwWItX7YjvIs VLGw== X-Gm-Message-State: ALQs6tDOqlJpcpZbWhw863R+Gf47Q3vOhw2hfIUz3ggIy68nC72aXShf FYZrzQu1ssylTss222wwx+s= X-Received: by 10.98.178.208 with SMTP id z77mr1447457pfl.122.1524819395770; Fri, 27 Apr 2018 01:56:35 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([149.23.17.254]) by smtp.googlemail.com with ESMTPSA id q76sm2310583pfi.139.2018.04.27.01.56.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Apr 2018 01:56:35 -0700 (PDT) From: Arvind Yadav To: jikos@kernel.org, benjamin.tissoires@redhat.com, jkosina@suse.cz Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 3/3] ASoC: samsung: Use gpio_is_valid() Date: Fri, 27 Apr 2018 14:26:11 +0530 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the manual validity checks for the GPIO with the gpio_is_valid(). Signed-off-by: Arvind Yadav --- sound/soc/samsung/s3c24xx_simtec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/samsung/s3c24xx_simtec.c b/sound/soc/samsung/s3c24xx_simtec.c index 6de63f3..23e8ef9d 100644 --- a/sound/soc/samsung/s3c24xx_simtec.c +++ b/sound/soc/samsung/s3c24xx_simtec.c @@ -229,7 +229,7 @@ static int attach_gpio_amp(struct device *dev, int ret; /* attach gpio amp gain (if any) */ - if (pdata->amp_gain[0] > 0) { + if (gpio_is_valid(pdata->amp_gain[0])) { ret = gpio_request(pd->amp_gain[0], "gpio-amp-gain0"); if (ret) { dev_err(dev, "cannot get amp gpio gain0\n"); @@ -248,7 +248,7 @@ static int attach_gpio_amp(struct device *dev, } /* note, currently we assume GPA0 isn't valid amp */ - if (pdata->amp_gpio > 0) { + if (gpio_is_valid(pdata->amp_gpio)) { ret = gpio_request(pd->amp_gpio, "gpio-amp"); if (ret) { dev_err(dev, "cannot get amp gpio %d (%d)\n", @@ -263,7 +263,7 @@ static int attach_gpio_amp(struct device *dev, return 0; err_amp: - if (pd->amp_gain[0] > 0) { + if (gpio_is_valid(pd->amp_gain[0])) { gpio_free(pd->amp_gain[0]); gpio_free(pd->amp_gain[1]); } @@ -273,12 +273,12 @@ static int attach_gpio_amp(struct device *dev, static void detach_gpio_amp(struct s3c24xx_audio_simtec_pdata *pd) { - if (pd->amp_gain[0] > 0) { + if (gpio_is_valid(pd->amp_gain[0])) { gpio_free(pd->amp_gain[0]); gpio_free(pd->amp_gain[1]); } - if (pd->amp_gpio > 0) + if (gpio_is_valid(pd->amp_gpio)) gpio_free(pd->amp_gpio); } -- 1.9.1