From patchwork Wed Aug 11 11:55:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tang Bin X-Patchwork-Id: 12430979 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33FC1C4338F for ; Wed, 11 Aug 2021 11:59:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 75A9060E93 for ; Wed, 11 Aug 2021 11:59:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 75A9060E93 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: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:In-Reply-To:References: List-Owner; bh=1vFX0R5VIRNNLv2Qbq4e+7UFJ8RUz71htUqGI1muh3U=; b=dN4hvc+RWKptGr 13An0e361UT01BRINnEkqQTtcMkTpQGLWmvLH985PK/7p6aRtnQkbeppZG+VFy16WGJTeIVdUAXON +y6xpgBi7oSfTEg5bViOmWwv/WQ/VM45jEaamMl0GQWPGjeoAPyEv53+8qVHvrBCLSpSzuKdDgNd5 Mth9vtBHAWi8ufluVdihSHIlhu/pg/n0XQxXB3PMqjMXEUN01JkaL17ARKcXar6Q+QgUguttRgjAQ SbWxw6YtvWMT8k3fboZWZ9nAESyg7zQeP3g1lQ2suRPlVNAQrpYEUuSGfp+NWGdvt6coA/iL7Kghe 6iJBgUtwYWmwt2vsv2oQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDmrC-006qfu-J0; Wed, 11 Aug 2021 11:57:15 +0000 Received: from cmccmta3.chinamobile.com ([221.176.66.81]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDmpF-006q2s-54 for linux-arm-kernel@lists.infradead.org; Wed, 11 Aug 2021 11:55:17 +0000 Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app12-12012 (RichMail) with SMTP id 2eec6113ba8573c-64767; Wed, 11 Aug 2021 19:54:47 +0800 (CST) X-RM-TRANSID: 2eec6113ba8573c-64767 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.112.105.130]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee66113ba81a7c-3dfcf; Wed, 11 Aug 2021 19:54:47 +0800 (CST) X-RM-TRANSID: 2ee66113ba81a7c-3dfcf From: Tang Bin To: broonie@kernel.org, olivier.moysan@foss.st.com, arnaud.pouliquen@foss.st.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tang Bin , Zhang Shengju Subject: [PATCH] ASoC: stm32: spdifrx: Delete unnecessary check in the probe function Date: Wed, 11 Aug 2021 19:55:23 +0800 Message-Id: <20210811115523.17232-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210811_045513_851893_1339F720 X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. 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 The function stm32_spdifrx_parse_of() is only called by the function stm32_spdifrx_probe(), and the probe function is only called with an openfirmware platform device. Therefore there is no need to check the device_node in probe function. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin --- sound/soc/stm/stm32_spdifrx.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c index 48145f553..8fe822903 100644 --- a/sound/soc/stm/stm32_spdifrx.c +++ b/sound/soc/stm/stm32_spdifrx.c @@ -908,13 +908,9 @@ static const struct of_device_id stm32_spdifrx_ids[] = { static int stm32_spdifrx_parse_of(struct platform_device *pdev, struct stm32_spdifrx_data *spdifrx) { - struct device_node *np = pdev->dev.of_node; const struct of_device_id *of_id; struct resource *res; - if (!np) - return -ENODEV; - of_id = of_match_device(stm32_spdifrx_ids, &pdev->dev); if (of_id) spdifrx->regmap_conf =