Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1273924lqo; Fri, 17 May 2024 17:47:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGtsx2/ANEtKP4bcGtlkxSgfplUMK59etcR4T7TyKu6hYBodGxUJr+x59Im5WVEnX7Gm1yezE7YQUErekgcJ4ZZ3Go6sJq8m2ew3QOFw== X-Google-Smtp-Source: AGHT+IGf8pExVXAixZ1+Y87iinswBV+oY2+4Z2frqDM0vvzeOgqfDlM1p3GTdr6bDBCSnhptq2yV X-Received: by 2002:a17:90a:9281:b0:2ab:87c3:d12c with SMTP id 98e67ed59e1d1-2b6cc342bb9mr19905360a91.2.1715993256971; Fri, 17 May 2024 17:47:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715993256; cv=pass; d=google.com; s=arc-20160816; b=hDI0VCyZS8mA7zhqY/Nl8XZ12/z10pR8q+ayhl2AT9L4ekPpXT5GuoAfCT13okV3h/ go/BTP0Z7kJ+wKu/XWMnOgUUs8kM7SGcvyAqGJhvUCuyr82plFAz+SAjosZ3lUSYtAU/ fnxZg3cATIlb2cx2thx8380OYFLTigiHMmw5Y5NB81VohI4nP/70uaUyYQXF1OPpRUHd mXTXihy71nzz7r/JdbV8SXANGjMCkw5bRwpav8jJR3EkOZ9TS8/KIUOmOyK5/WE9ZbJg 3wF8NC0mfER5G7rzuDQ2lL88WHpUsuYGo5JTrAm1qzxbtLNIVS+suIDNxSTBagyBlUok bd0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=b1i0lLGbCTcuU77wMwiX8Aa0GU+ObaLOXKj4rS3BMG8=; fh=Y0nnyUF3S0DZEUvtq0Po1YmdUBLJZKfXU4gyGw8sw3I=; b=jkLbS88XdHkZlbyGEtFeb+fzKDAJa0u5cOooSWEzOswwCKAp6R862LlzH7ePsQzTHN /2SuJvkAuoORMkWy9sQdrWdbS8pFJdZx7TP4krRKzN6rpv3GwaEG9t3rWnICpU7XecRy qZes7OSr7IhtgGCWHMN6/uuiu+QGwE7YvhKdVLXHXVkRvqVdM2+OqvT/5yNGhfCr86A3 Rd2rotikbC7Tth6BlDfrQFNg9unLLY94p37DTN7AjSkci1Y2UivNxUiZgIvvcGnHHmCB Xb39tJPAogZlSbzeTklQoSg99fWNWGBQkjHeIuzxtJWMsXu135o6FL/f3WnNbsv9+QTI Dblg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LMpZE6WD; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-182572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628a6a3b8si20704668a91.82.2024.05.17.17.47.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 17:47:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LMpZE6WD; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-182572-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 63229B2128B for ; Fri, 17 May 2024 19:41:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02095140389; Fri, 17 May 2024 19:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LMpZE6WD" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEA5F13DDB0; Fri, 17 May 2024 19:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715974872; cv=none; b=TYwSbBCFh51gNPmttJLoNqt8tDR7VafSTxIDrj0wbnPCBks91edzcANtpfMLLOLeAKdM6r5Nc/MXlIDRJmXDTpwUU2HXM+TBh18gssxPwYStCiiQqGh+q2loq0aVUCBe4BapKlt6erGSM1lKXsFJezye+/CAV8YYxJusgvlypB4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715974872; c=relaxed/simple; bh=fu2ycGfiDHO09k7hG2n7b4YA7Q5TXBs64qVIrhAtvt8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k9FC4hm04k8Od1chJV5bt6Azfou3pFid1Hlp5w+O6AlCPFO1bUeKhVRTrCIGrtH9RK/dua+9Iiyna4Gu4xQIQT/AVsAvdwKQ5J3aNHiIuXEbkF4qRTy7gvX+amDzw2U0DY5WUEp7qviucTEKBcXi3HAweTq4M4TuE8NR91AJ7Ps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=LMpZE6WD; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715974871; x=1747510871; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=fu2ycGfiDHO09k7hG2n7b4YA7Q5TXBs64qVIrhAtvt8=; b=LMpZE6WDh17BtvSi6CxAplGrwmLEJReQpFB0/HxagJ+TQukehS4K0KGg wfb3sq1hWtsj1sRNTQm1ud0ZwCao41idYiMXnrDNq6TrEKryj4SCE50/F btGllPiDTNf+ZTyEINSkIIqb0CvX15FaOOCbxUtAiRcgw24qsQ0VD1iQ/ k7QARoSoXIe7aboPV106UbJdIgGFFwqTts7fjB0G9XEBe6ChVuAwXjfVV W9QlRpBxIeRgjaG/iS4EEd3iccWf2sUROzGGTo++uRpVvK/y52xxHcQuk UuZ5eVmjzyRoFPUnkIrPwUmDdY/9CqTstajHsIt+eYBZuDH9IJg1xuoLR g==; X-CSE-ConnectionGUID: dvHHu8OTRHaWx6W2axOMEg== X-CSE-MsgGUID: QwwQ7ivkSTuWU42INeryag== X-IronPort-AV: E=McAfee;i="6600,9927,11075"; a="22783100" X-IronPort-AV: E=Sophos;i="6.08,168,1712646000"; d="scan'208";a="22783100" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2024 12:41:09 -0700 X-CSE-ConnectionGUID: x6nY/ggpQq6CNBcAPSPyVA== X-CSE-MsgGUID: sEUCPdqXSoysdRNhWW/50Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,168,1712646000"; d="scan'208";a="32503703" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 17 May 2024 12:41:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6F74B44E; Fri, 17 May 2024 22:41:07 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 3/3] spi: bitbang: Replace hard coded number of SPI modes Date: Fri, 17 May 2024 22:40:22 +0300 Message-ID: <20240517194104.747328-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240517194104.747328-1-andriy.shevchenko@linux.intel.com> References: <20240517194104.747328-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Instead of using hard coded number of modes, replace it with SPI_MODE_X_MASK + 1 to show relation to the SPI modes. Signed-off-by: Andy Shevchenko --- include/linux/spi/spi_bitbang.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index 7ca08b430ed5..d4cb83195f7a 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h @@ -30,7 +30,7 @@ struct spi_bitbang { int (*txrx_bufs)(struct spi_device *spi, struct spi_transfer *t); /* txrx_word[SPI_MODE_*]() just looks like a shift register */ - spi_bb_txrx_word_fn txrx_word[4]; + spi_bb_txrx_word_fn txrx_word[SPI_MODE_X_MASK + 1]; int (*set_line_direction)(struct spi_device *spi, bool output); }; -- 2.43.0.rc1.1336.g36b5255a03ac