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 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 3CA7EEB64DC for ; Tue, 11 Jul 2023 08:13:31 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ccL5GPUhuu5hTM8nIIRxUPrLNNhoRDt0T0dadml1G0U=; b=WVyg+RqZGFHSyu nhYo+ob8NC5/e6qpZMl6WHkDQFB59Y3h2vTMLi1nS3gA1FzHX6esQpakpgBbFp540x3z5hs27M37K RuJrAor7YuibSWbI3d1D+tq4Fug+QtcRx5TtddLigcVscFV+rIcCsUdOwYvB989+ZKTpBooxCeroj EHor73k9rVrhsTpBCMtMZosYNVWyNfk0P7OvWn7gaog31v2HrmnL8osG1m4aykXwn0C3AurYD1N4Z tRQHvSls8bi6sYCnyLbwp/Kj62s8b8z62Hn8/70ZtfhD45849I9fGkViFlfszBcIFLF7RIbOOt1oD ZycfR2FRIFLB2Bsu/Yyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJ8Uc-00E4h1-1o; Tue, 11 Jul 2023 08:13:06 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJ8Ua-00E4g8-0o; Tue, 11 Jul 2023 08:13:05 +0000 Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 6971C660700A; Tue, 11 Jul 2023 09:12:58 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689063180; bh=2+yn6FDwMd8voKMx1WPt05JiOyMTQxbLsZaEtvbtNN4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Fx8WIExUEuJPaY5MFu8knfLP/k0C26AMfNb/AvH/Fmm0WSmwyzjbdouviC0vRIt5c MKvJLE8w0cLrlZEwxmbFWfOjjLGUQZgFi0o1pLWqgdMYxBGlFBGIjiNaupLZ6FnB33 j1HPiXlommzYaYv6ce4cvKcTdjN1ewdnVTlkRjRRehst4X7XEwQxnR9ySh21JtPk6b 7KLhT/OtiV9F5v6WVi5j7pxhtZflk0tkK/vKZu9Q314nRK+CtbZPcevQ7M0A64UCcq 2GUJjcluoW7Hk+VgSk0dx0uk8kgwhRiKCYyXOMoe3dlhEE5DcTiXTswvygvLYV31mr rt/T478FT4VDw== Message-ID: Date: Tue, 11 Jul 2023 10:12:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 01/15] spi: Remove unneeded OF node NULL checks Content-Language: en-US To: Andy Shevchenko , Mark Brown , Cristian Ciocaltea , Yang Yingliang , Amit Kumar Mahapatra via Alsa-devel , Neil Armstrong , Tharun Kumar P , Vijaya Krishna Nivarthi , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-trace-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: Sanjay R Mehta , Radu Pirea , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Tudor Ambarus , Serge Semin , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Matthias Brugger , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heiko Stuebner , Palmer Dabbelt , Paul Walmsley , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Max Filippov , Steven Rostedt , Masami Hiramatsu , Richard Cochran References: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> <20230710154932.68377-2-andriy.shevchenko@linux.intel.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230710154932.68377-2-andriy.shevchenko@linux.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230711_011304_424574_2B9C68D4 X-CRM114-Status: GOOD ( 17.39 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Il 10/07/23 17:49, Andy Shevchenko ha scritto: > In the couple of places the NULL check of OF node is implied by the call > that takes it as a parameter. Drop the respective duplicate checks. > > Signed-off-by: Andy Shevchenko Validated against spi-mt65xx, spi-mt7621, spi-mtk-nor, spi-mtk-snfi; Reviewed-by: AngeloGioacchino Del Regno # MediaTek > --- > drivers/spi/spi.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c > index 9291b2a0e887..8f3282a71c63 100644 > --- a/drivers/spi/spi.c > +++ b/drivers/spi/spi.c > @@ -2399,9 +2399,6 @@ static void of_register_spi_devices(struct spi_controller *ctlr) > struct spi_device *spi; > struct device_node *nc; > > - if (!ctlr->dev.of_node) > - return; > - > for_each_available_child_of_node(ctlr->dev.of_node, nc) { > if (of_node_test_and_set_flag(nc, OF_POPULATED)) > continue; > @@ -3134,7 +3131,7 @@ int spi_register_controller(struct spi_controller *ctlr) > if (WARN(id < 0, "couldn't get idr")) > return id == -ENOSPC ? -EBUSY : id; > ctlr->bus_num = id; > - } else if (ctlr->dev.of_node) { > + } else { > /* Allocate dynamic bus number using Linux idr */ > id = of_alias_get_id(ctlr->dev.of_node, "spi"); > if (id >= 0) { _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic