Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35553645rwd; Mon, 10 Jul 2023 09:03:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlGjyGZ71BObl347vXgg5m932NJfw42xxAFt/PdNZHec0gsedho3tPxh7/YxWnEJX1cF1B13 X-Received: by 2002:a05:6a00:1803:b0:67f:d4e2:3dd7 with SMTP id y3-20020a056a00180300b0067fd4e23dd7mr13432736pfa.21.1689004998834; Mon, 10 Jul 2023 09:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689004998; cv=none; d=google.com; s=arc-20160816; b=oV4vyyQuUcqQE2wewVvUsVBDnT6D6ejeQLI47kNW8JUI2YXpIOBmnn6uBL8MhNYugo XfTLA8EMJmVM4l973q+ypQ6kLMhCjeQRr4P53DTqicpJKi/sFH5J+2ZMXb7MBA3q2zeh PMieOxlg5NC0nQ/bEfjms9F1PGO/2Og9/fibRxsY7cobAYMSh3s539U4kYR6Y0j/0JHW pGjoFBtkRoss57f0Hv3MWs4T9WGovj1W+k8MGvDm4KpSCnEETOXftiUcdcwM6ovFpjCY mLWljve/avpyuGxR8odjB5JztkJTLn8DClJmXUPhM/xn/5JjeRMk7QnWrjOT6+/0BX8F yFhw== 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=dnF+LMHcVlGKDCydGVoyV5aZC40d8p/xMENgpGUnHO0=; fh=CWfEt6/vd4IsHMc+T8W3bMkH4b5uOoX72TeJSijIGlU=; b=f+z3WDFbbRsw62SD//sB9m7q9wlNpYKhR6GkSpyI5ra2aC2VX1/47/SjjgcxmIRiOI WKvQ7LXySAfEyvhjye/W/8aiL0DpyGVuDZXWBbejEMCfGf3r+jGLe9NvsCUQyFO8MsOo bVkMeIEYLpapnjw4/JX4ojC1NMSLpfm0ZJGwJU8jZDFVDPOjtX5yXizGlZgU6OM6CNI3 ejOYXUi6ukMyqlvZFeKMm8nOL6iuLJ+Tn1xJrYQax85CLYHPT5LpKZtd96a8JQHWYICQ dnTcx+Gi7Q2eh7egKk+XTOVk6CSCnTq1A08Z3Z7j217evcs3LFcO/t0mDZnYyQRW41qb GB5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QZam7m3P; 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 a24-20020a62e218000000b00682686181c2si8500034pfi.65.2023.07.10.09.03.06; Mon, 10 Jul 2023 09:03:18 -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=QZam7m3P; 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 S233630AbjGJPt5 (ORCPT + 99 others); Mon, 10 Jul 2023 11:49:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233583AbjGJPts (ORCPT ); Mon, 10 Jul 2023 11:49:48 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25A25137; Mon, 10 Jul 2023 08:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689004186; x=1720540186; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0v8XTkg22X4+SjZKJZYJseJJcu9T6jyLmPuYe7Mrmmg=; b=QZam7m3PSZMzi8qOur8uz44+WuSV1Ye2Ok33FuV6B0NUgKABvOXLDSeb deibbcVTr5wVEXsyZD4N4ftH4Ba52nW8f2MQtMlI/TucDm7s7IF9ZMFJm oTb0wS6f4qjjh0g/YE8o9kCQ9vHm7/OXRFsO4i0Ct0lLMAU5v/nahU8FS 2kyk4GqO8J2hMrusFVgTlMS9DIL2LGQnKfUFBzdTJFmaY+0t6rQ+MB93a muUyKeFEXzmavWsSR9xEpzWLXmnuWaOXxbL268sLLmVXwftsnSRsWMVsu FfY/ojY3Otv+covAncddYCHfsYyo0BQNgIJRInzb2YVzxLzlWIJTqGcW4 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10767"; a="349185404" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="349185404" 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=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 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,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 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); -- 2.40.0.1.gaa8946217a0b