From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 253C0C432BE for ; Wed, 11 Aug 2021 12:29:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0879060FC3 for ; Wed, 11 Aug 2021 12:29:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231578AbhHKM3m (ORCPT ); Wed, 11 Aug 2021 08:29:42 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:7983 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbhHKM3B (ORCPT ); Wed, 11 Aug 2021 08:29:01 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.7]) by rmmx-syy-dmz-app05-12005 (RichMail) with SMTP id 2ee56113c264abc-64bcd; Wed, 11 Aug 2021 20:28:22 +0800 (CST) X-RM-TRANSID: 2ee56113c264abc-64bcd X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from [192.168.26.114] (unknown[10.42.68.12]) by rmsmtp-syy-appsvr04-12004 (RichMail) with SMTP id 2ee46113c265114-3fc53; Wed, 11 Aug 2021 20:28:22 +0800 (CST) X-RM-TRANSID: 2ee46113c265114-3fc53 Subject: Re: [PATCH] ASoC: stm32: spdifrx: Delete unnecessary check in the probe function To: Mark Brown Cc: olivier.moysan@foss.st.com, arnaud.pouliquen@foss.st.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20210811115523.17232-1-tangbin@cmss.chinamobile.com> <20210811115846.GC4167@sirena.org.uk> <7ddb13ee-2ca6-bf8d-2a83-9896d29176c5@cmss.chinamobile.com> <20210811121955.GD4167@sirena.org.uk> From: tangbin Message-ID: Date: Wed, 11 Aug 2021 20:28:23 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20210811121955.GD4167@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark: On 2021/8/11 20:19, Mark Brown wrote: > On Wed, Aug 11, 2021 at 08:09:00PM +0800, tangbin wrote: >> On 2021/8/11 19:58, Mark Brown wrote: >>> On Wed, Aug 11, 2021 at 07:55:23PM +0800, Tang Bin wrote: >>>> 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. >>> What is the benefit of not doing the check? It seems like reasonable >>> defensive programming. >> I think it's unnecessary, because we all know than the probe function is >> only trigger if >> the device and the driver matches, and the trigger mode is just Device Tree. >> So the device_node >> must be exist in the probe function if it works. That's the reason why I >> think it's redundant. > I see why it is redundant, I don't see what problem this redudnancy > causes. Maybe not, just be redundant. If you think that's ok, just drop this patch. I'm sorry to trouble you. Thanks Tang Bin