From patchwork Tue Feb 7 13:19:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 9560053 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 E8A5E602B1 for ; Tue, 7 Feb 2017 13:20:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB313204C2 for ; Tue, 7 Feb 2017 13:20:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D050728306; Tue, 7 Feb 2017 13:20:29 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham 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 2835F204C2 for ; Tue, 7 Feb 2017 13:20:29 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D400C266FFF; Tue, 7 Feb 2017 14:20:13 +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 168BC266FD4; Tue, 7 Feb 2017 14:20:12 +0100 (CET) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by alsa0.perex.cz (Postfix) with ESMTP id 0776F266FD0 for ; Tue, 7 Feb 2017 14:20:09 +0100 (CET) Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v17DK5fs021666 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Feb 2017 13:20:05 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v17DK4rb007633 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Feb 2017 13:20:04 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v17DJxv9009354; Tue, 7 Feb 2017 13:19:59 GMT Received: from mwanda (/154.0.138.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 07 Feb 2017 05:19:58 -0800 Date: Tue, 7 Feb 2017 16:19:34 +0300 From: Dan Carpenter To: Liam Girdwood , =?iso-8859-1?Q?Myl=E8ne?= Josserand Message-ID: <20170207131934.GD28207@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Cc: alsa-devel@alsa-project.org, Wei Yongjun , kernel-janitors@vger.kernel.org, Takashi Iwai , Chen-Yu Tsai , Mark Brown , Maxime Ripard Subject: [alsa-devel] [patch] ASoC: sun4i-i2s: remove some dead code 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 "i2s->rst" is either NULL or a valid pointer. We won't probe successfully if it's an error pointer. That means these checks can be removed. Signed-off-by: Dan Carpenter diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 3635bbc72cbc..d79be3e4361b 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -723,13 +723,11 @@ static int sun4i_i2s_probe(struct platform_device *pdev) } } - if (!IS_ERR(i2s->rst)) { - ret = reset_control_deassert(i2s->rst); - if (ret) { - dev_err(&pdev->dev, - "Failed to deassert the reset control\n"); - return -EINVAL; - } + ret = reset_control_deassert(i2s->rst); + if (ret) { + dev_err(&pdev->dev, + "Failed to deassert the reset control\n"); + return -EINVAL; } i2s->playback_dma_data.addr = res->start + SUN4I_I2S_FIFO_TX_REG; @@ -766,8 +764,7 @@ static int sun4i_i2s_probe(struct platform_device *pdev) sun4i_i2s_runtime_suspend(&pdev->dev); err_pm_disable: pm_runtime_disable(&pdev->dev); - if (!IS_ERR(i2s->rst)) - reset_control_assert(i2s->rst); + reset_control_assert(i2s->rst); return ret; } @@ -782,8 +779,7 @@ static int sun4i_i2s_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(&pdev->dev)) sun4i_i2s_runtime_suspend(&pdev->dev); - if (!IS_ERR(i2s->rst)) - reset_control_assert(i2s->rst); + reset_control_assert(i2s->rst); return 0; }