From patchwork Mon Jul 25 10:11:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12927943 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 863FDC43334 for ; Mon, 25 Jul 2022 10:12:06 +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=okAn4z2EsF+qs4 0PDRIczgRGdxftRFkEXLm9Ja+CYH81e+nqU9HMZh8JlYB4tkCZ7Spn3KMu5T2rg7Sxa3h4eW4na4g LmKxg186SmUM8gRwjoYIbZDjLIjPz9wJvSxU4d2mojeYaiOnW+otbKJyTNxyEOpXuGeZ755wdozgL dVcxOPJQ2qiFRS6mDnSFwg8faG9UtXsVfm6cIFPIb56v65Uv8gwqP12f88iGXbiI12D9HGbIppWAe Lk7bffTV6nSmrTpo6FVY2YM48uQ8FfvbLmv6AdnQl8uPPNbtBAHvF6x5EQTEZKMvvA0asPRaXZ387 AXDPbiXq9zMubfNvo8FQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFv3F-007zmi-55; Mon, 25 Jul 2022 10:11:02 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFv1a-007yNV-0J for linux-arm-kernel@lists.infradead.org; Mon, 25 Jul 2022 10:09:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1658743757; x=1690279757; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WwU9nxdctQsI4jH9K6IXqln2aORb9QSIuV6qe2LWzS8=; b=S8mPzaKGQnx0Cp/uVH4EbwydGuzZyq2IKM9KatNDY/Qx8b/AkCH56B/F x90PVScal79ikbgplGvEKLAZVVLi8MfOBZZYntV3Q0Y5cH9xcWvlPFFvS /24MTR0HlXsIwJ9ZCDpca5P9uSyCxkSoJ67fEceYFDXSFVZTPg72VlviO 2l2nKzgzBMGPENRl6A8u9p6qK/ti+tJEgyMP7HK6MZTLc5tbbfZn2Fnwr LtN9rnX4IOQPTbKrydNnLL9r4x2ZGuybvuCDuDlJLEEKA8Ky2AGF9FUL1 Y8NCAWhxVbIjXSrLHRb/1AXDA4M9a/hHnWnRLzQAqq5w6SLGHYrsOH7+i w==; X-IronPort-AV: E=Sophos;i="5.93,192,1654585200"; d="scan'208";a="173666606" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Jul 2022 03:09:17 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) 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 03:09:17 -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 03:09:14 -0700 From: Claudiu Beznea To: , , , , , CC: , , , Claudiu Beznea Subject: [PATCH 4/5] ASoC: mchp-spdiftx: return directly ret Date: Mon, 25 Jul 2022 13:11:29 +0300 Message-ID: <20220725101130.1780393-5-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220725101130.1780393-1-claudiu.beznea@microchip.com> References: <20220725101130.1780393-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_030918_086192_732C2423 X-CRM114-Status: GOOD ( 11.23 ) 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 = {