Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36512769rwd; Tue, 11 Jul 2023 01:52:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlFqDxgoOJ1GIbZtd9vt7QdTCkY2xgMfUXi7Zxf0iVSiV3V/mC+lzNfZzTFE5HWw7ySLO66l X-Received: by 2002:a17:906:51c9:b0:993:d901:9b46 with SMTP id v9-20020a17090651c900b00993d9019b46mr10117517ejk.3.1689065577069; Tue, 11 Jul 2023 01:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689065577; cv=none; d=google.com; s=arc-20160816; b=ThYFqOSV3bgplXCDdJfvx92r9U99gQ4ZE1acCbkMwzIslFKTDLMR7e+3COP0RqOaNx OtnffkQG9spYy4dYbEICEMyLNKJN9pg2Gv9XP3FevumtHwVn6yE3/1CypadITj9S7v+y SKLjHU3+/ZwNAgZi2r3nJKZENtKYJzu2RM0/amGCLSTE7Si2hYcxFhWHfyS7cuGIF/6n 9xDrpSwYL1UJOdT92g0p/R9kCz6OHCaR20X8GCRE4J9k6/8+5hvKMnTkVne1GLSfInOe aXPpDiJl2HUIFy1cPqNJ6Lx1YMZUTv+R+zLVF5hqdNlP5eJZhTEoZfmIiPwSZFf9/sOi 2v6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=nFmwfxhgbitFCQIxZCIwLXxsI27stDUfANTr/r9Pc6Q=; fh=k2xC0hVIVVmpseit9+5Q+yo+YyBs94PaxxbVkxO8w6w=; b=Od505C3KEQEVxgWbTn9ZP1PCLw2i2EWL90oyNt1aesHFxBhysMDiMb5wCWQB52s/RN MzdOY77TelqHaQIBL85lpIH8yNu5uS2aIoPVs1s4WqAD4pclWsW4YOsFiqw7qihpdqo0 8cf7xV+Iy4JKR11rJoMabL9Ji174Fuo+IFZiQafO4cKBveRx9PCsqCYoxvwwDDA6m2BP LvI9nWpUeGJhfYQ4WkICVBq9lQI9wwu9cqgMuHFuCup8bqyo08UlAoQ1/fc+3mrjmiXd wvr8GcocmObH88JtWezMWv0PbB0QyhPIpz7qt1kttQ3EGpbVc2PVyM2jHsOzsg3R/Gns cT8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Fx8WIExU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw10-20020a170906fcaa00b00992bdcb72desi1671230ejb.191.2023.07.11.01.52.33; Tue, 11 Jul 2023 01:52:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Fx8WIExU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230252AbjGKING (ORCPT + 99 others); Tue, 11 Jul 2023 04:13:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbjGKINE (ORCPT ); Tue, 11 Jul 2023 04:13:04 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F378FE3; Tue, 11 Jul 2023 01:13:02 -0700 (PDT) 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> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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) {