From patchwork Mon Jul 10 15:49:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13308774 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 77DB0EB64DC for ; Tue, 11 Jul 2023 13:55:01 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E4B85E82; Tue, 11 Jul 2023 15:54:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E4B85E82 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1689083699; bh=0v8XTkg22X4+SjZKJZYJseJJcu9T6jyLmPuYe7Mrmmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=V4QudrTxIsEeguwhQmcL6/k6nv/VD7duCeCXNzb7w3+IK1MlGPFRPpGQB9oS1M0qO +gnBzpgdfqM3NJpaDr3vTqY3k3pthWkN7/i6onsOcMpAAvWiN1/cQIFu55aqWHEz+T Gi5r22Qa5FTOvx7cXjodhSpOcocBQuL9O2gaWYLc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 67E6DF805D7; Tue, 11 Jul 2023 15:52:12 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D3CCFF805D7; Tue, 11 Jul 2023 15:52:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CE391F80290; Mon, 10 Jul 2023 17:50:04 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D9068F8027B for ; Mon, 10 Jul 2023 17:49:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D9068F8027B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=EvyITdKo DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689004190; x=1720540190; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0v8XTkg22X4+SjZKJZYJseJJcu9T6jyLmPuYe7Mrmmg=; b=EvyITdKoQJ8DEP0YPHep+1rHQ1WvdGOFL0kHv5mpRQHIZi5cSiAq71ZC tcmtVWwmCWrmopDefn530WPkqPNohHi5tbsnk/5C808tGh4mHFT43NXg4 Vg8wUEOj9oGiDfH6d6NqYPqlWNFQGIyZ5ypIUjgQ2xuwjkR+0qg6kmt0F HbGbXd249SG5+yGSQ7XHe6N/zdQ9K4eEDO2zZBgcyUs44SreLpVxltXZJ af/FJycutu4hRnPJreAmzv8cuEsbCsFeLmZVNJf9aRW0HzioP0cs5+1T0 PRhhd2mei4p80iEHSXQ1qikdvvWQxeia8/tSIQ1dJ3i151w/9vmnmReqN w==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="349185397" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="349185397" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 08:49:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="844921854" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="844921854" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 10 Jul 2023 08:49:33 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6932A5FC; 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_Kleine-K?= =?utf-8?q?=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 05/15] spi: Remove code duplication in spi_add_device_locked() Date: Mon, 10 Jul 2023 18:49:22 +0300 Message-Id: <20230710154932.68377-6-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 X-MailFrom: andriy.shevchenko@linux.intel.com X-Mailman-Rule-Hits: max-recipients X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-size; news-moderation; no-subject; digests; suspicious-header Message-ID-Hash: YP7DVBYZKE4FRGEJK43I4BOM7NZILJFH X-Message-ID-Hash: YP7DVBYZKE4FRGEJK43I4BOM7NZILJFH X-Mailman-Approved-At: Tue, 11 Jul 2023 13:52:06 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Seems by unknown reason, probably some kind of mis-rebase, the commit 0c79378c0199 ("spi: add ancillary device support") adds a dozen of duplicating lines of code. Drop them. Signed-off-by: Andy Shevchenko --- drivers/spi/spi.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index c99ee4164f11..46cbda383228 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -712,17 +712,6 @@ EXPORT_SYMBOL_GPL(spi_add_device); static int spi_add_device_locked(struct spi_device *spi) { struct spi_controller *ctlr = spi->controller; - struct device *dev = ctlr->dev.parent; - - /* Chipselects are numbered 0..max; validate. */ - if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) { - dev_err(dev, "cs%d >= max %d\n", spi_get_chipselect(spi, 0), - ctlr->num_chipselect); - return -EINVAL; - } - - /* Set the bus ID string */ - spi_dev_set_name(spi); WARN_ON(!mutex_is_locked(&ctlr->add_lock)); return __spi_add_device(spi);