Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35539685rwd; Mon, 10 Jul 2023 08:51:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlGPQf4+Y9Ld3HZOrJAWuJDfIp17bo3xSyZBH7sMDle7qst4dv73YXbF6ejamu9wRlL0MRAt X-Received: by 2002:a17:90a:4414:b0:262:f8eb:ea5 with SMTP id s20-20020a17090a441400b00262f8eb0ea5mr9422587pjg.22.1689004315497; Mon, 10 Jul 2023 08:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689004315; cv=none; d=google.com; s=arc-20160816; b=B8D3Ekud8bCX+QQCZPLxQuDyaJWTqYqW8+tP5TlnrFgmiKfSOq/gDaImRLWtgwLqee Cx7ILQ98kXV2nbpzssFsP/Rryo6XmbKyvaPtl4ql0eS4jLH7/+cVwtAkyFxwKEUlhcBR MsN8KyBrRkaepwyaxcX+k5E1aqXaT4bTIx9n8NmuKSUDyvX5s9CkKB5GciN7sQAzoLZM f/4lJNRHpXWFX+TbRSglijyxXx8GKQnPrTRTAW14vrKgX7pugtRIhhwEKH0XmT3fHQda gPk5GECkWU0ZTUf3EszvRHCufExvwEugEHjQ49Fg4ZwuqziMmkDVg+GMnrUzP02wOLyL RDVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yonqcIdYIcSOrkp8Q9O3wO9J4Xret+9m7bgDiaovK/8=; fh=CWfEt6/vd4IsHMc+T8W3bMkH4b5uOoX72TeJSijIGlU=; b=vVaKVlu4osqWTF2cObc78aezptj6Y6lTArxHNFtp5HEESgnKzbgKxHLgVOVklWgMdg PSW3edDZY/14m26F0ZWrse9Yz1FDjNbZl46EVtuJO6u0U+eAZI6igwsQKkBSKydjhG7h W0KZSKNnNQr5I55+HHqSfweoruyLy/iA3xVWJaDCvyjpD8SsvxK39e+EAh4+pbJcGaC2 SUTp9UC42lPOKp6D4tEmlWIqUNgr6XWxYvpVKtu8HKFQOUx+Wx3eWOkDoSUPvRdhCB6u +jzZVAyD3doV/9gA5VapXkBKWDC8LqWqohlBhFjvBU8wthVLd2dQh8y1Tvz0bWkU9UUz Wh4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xt8gkiHk; 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rj3-20020a17090b3e8300b00262ee7c6cafsi97091pjb.87.2023.07.10.08.51.43; Mon, 10 Jul 2023 08:51:55 -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=@intel.com header.s=Intel header.b=Xt8gkiHk; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233575AbjGJPty (ORCPT + 99 others); Mon, 10 Jul 2023 11:49:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233576AbjGJPtq (ORCPT ); Mon, 10 Jul 2023 11:49:46 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25DCA129; Mon, 10 Jul 2023 08:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689004184; x=1720540184; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1YMEKoH26Jvs8dKIC6vdH9uSV/g2LDeyMP+ZqFMU56I=; b=Xt8gkiHk3aA3k/dAILBIpXCqRSLwugB3LtWxm1P44OCowTvz0NXjF5Cz 2Q0FS9CtqcK6S2JYYbSRmaiAqef9yD8/KmJOhROBmLl0yVpBBz3OU/hJi LYcDxvnDW1j60h1scix0HsPUDQaVFHv63482VlY6yE2PYX+s10QReEJQ7 bCJoXt21uVkOI+wG+0Krcol47keqjZXapZWQCIKLCn473PQ8ePNZ8x6cu PhbpsnhAHIPXtkqKfXy92wIRXngOsWSRpnfmbg3kpwkwkAF/iRJQWOke4 2D/60B12ZbI4CTQ9b0jW8ERenTVVLsrzZXkXqsjKXSb/hMOvKxGquJ51a w==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="366955259" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="366955259" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 08:49:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="671015611" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="671015611" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 10 Jul 2023 08:49:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1E05F1D9; Mon, 10 Jul 2023 18:49:34 +0300 (EEST) From: Andy Shevchenko To: Mark Brown , Cristian Ciocaltea , Yang Yingliang , Andy Shevchenko , Amit Kumar Mahapatra via Alsa-devel , Neil Armstrong , Tharun Kumar P , Vijaya Krishna Nivarthi , =?UTF-8?q?Uwe=20Kleine-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 , AngeloGioacchino Del Regno , 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 Subject: [PATCH v2 01/15] spi: Remove unneeded OF node NULL checks Date: Mon, 10 Jul 2023 18:49:18 +0300 Message-Id: <20230710154932.68377-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> References: <20230710154932.68377-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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 --- 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) { -- 2.40.0.1.gaa8946217a0b