From patchwork Mon Jul 25 13:09:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12928046 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DAE82C433EF for ; Mon, 25 Jul 2022 13:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sx1xMDHsnsPsIEwi0RxLZY1wVmbR+DqPEIwRvfl5s3c=; b=tRFN9ehmNCHe5Q t8Kvx4LU8hLZPP5OisblACyOam+RLVWUggh9hA0QeMpJusM7nC8bIa2nJRPsxP3VTGs8emhLwoA0R vKbECxtPEKXmNRL8wcYfzozPXuq/IMElZzKDjShywkNB/EKzwDB8+a4IDvl34eHp2WxcM3Jq3uF70 oN4CEN4w1ALCtOcaQiY8BjhaIU5Qh/821AQV6WX64PsfF8H+xA5gbPUaj7ZQ2q3z+5YqdVjRcf998 F0DwGaWBeMPSNxVM4pN7H2XmFVqUv4BTo2BZCDOfyDqwHf+a6vPVvLLC8xCPHCVHOiZ5BzgCPtlJQ jYbIXr7JCFH3XlJeXH5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFxoU-009sUO-8S; Mon, 25 Jul 2022 13:07:58 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFxnq-009sJO-SX for linux-arm-kernel@lists.infradead.org; Mon, 25 Jul 2022 13:07:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1658754439; x=1690290439; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WwU9nxdctQsI4jH9K6IXqln2aORb9QSIuV6qe2LWzS8=; b=oqpcf5Ly+k8CIug8x9lP7dtAw3DDBMrg9qr1EWWk5kGSoniD5Xl/+W4S FgIAftHQ/sRrxIkkQPa1XVAq+gymKMiiCYrPLvNYbX3qE2PhnE3QOB6lV IaL5kOxia2RVlqxhZQfqC2ceg7sSQ/oh6UeXYskFjaHBDYYb4khkCkemJ It6KVn2o2xOWgZsyHOCcrjh7j2K2bNgloPcAoXOxWZe2qgdx7oH3G78Ni 1UfYoKwxULrocaEf0JdAqnIqb7Ubt2RmAn9Ifg1E6FQkVLVqQqMYYuFoy 6EjZveI2HBs38/+LdoEco4nTkQa7qknkEWc5R1KzJCUZWtTCnNM0OdYsA A==; X-IronPort-AV: E=Sophos;i="5.93,192,1654585200"; d="scan'208";a="166265269" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Jul 2022 06:07:13 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Mon, 25 Jul 2022 06:07:13 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Mon, 25 Jul 2022 06:07:10 -0700 From: Claudiu Beznea To: , , , , , CC: , , , Claudiu Beznea Subject: [PATCH v2 4/5] ASoC: mchp-spdiftx: return directly ret Date: Mon, 25 Jul 2022 16:09:24 +0300 Message-ID: <20220725130925.1781791-5-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220725130925.1781791-1-claudiu.beznea@microchip.com> References: <20220725130925.1781791-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220725_060719_097660_B62C0606 X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Avoid having patterns like: int ret; // ... ret = 0; // ... ret = call_function(); if (ret) return ret; return 0; and return directly ret for all cases. Signed-off-by: Claudiu Beznea --- sound/soc/atmel/mchp-spdiftx.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/atmel/mchp-spdiftx.c b/sound/soc/atmel/mchp-spdiftx.c index 20e77b374f7e..74729ec8423b 100644 --- a/sound/soc/atmel/mchp-spdiftx.c +++ b/sound/soc/atmel/mchp-spdiftx.c @@ -340,12 +340,10 @@ static int mchp_spdiftx_trigger(struct snd_pcm_substream *substream, int cmd, ret = regmap_write(dev->regmap, SPDIFTX_MR, mr); spin_unlock(&ctrl->lock); - if (ret) { + if (ret) dev_err(dev->dev, "unable to disable TX: %d\n", ret); - return ret; - } - return 0; + return ret; } static int mchp_spdiftx_hw_params(struct snd_pcm_substream *substream, @@ -841,12 +839,10 @@ static int mchp_spdiftx_probe(struct platform_device *pdev) err = devm_snd_soc_register_component(&pdev->dev, &mchp_spdiftx_component, &mchp_spdiftx_dai, 1); - if (err) { + if (err) dev_err(&pdev->dev, "failed to register component: %d\n", err); - return err; - } - return 0; + return err; } static struct platform_driver mchp_spdiftx_driver = {