Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp488355lqd; Wed, 24 Apr 2024 08:15:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKvJsRq3RByDlCzqPWpLpyeJkTeSCTS0M6vnQSEXt1p+DB7YKfrS508PuhvnG0NFyWTKCQXZdat2GcUO9AwgGNElixSkbVOj5yG8PXEQ== X-Google-Smtp-Source: AGHT+IE706/bwgP18g8KPsPwsNh169mRIUtyDwbWK+wW+4FdBpw4Wptc3H6xvCIKxYxGup8RfwvG X-Received: by 2002:a17:90a:bd14:b0:2a7:7a8e:bdc2 with SMTP id y20-20020a17090abd1400b002a77a8ebdc2mr2675933pjr.9.1713971704029; Wed, 24 Apr 2024 08:15:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713971704; cv=pass; d=google.com; s=arc-20160816; b=Epp3dA3TB0Xexks1GiO+0eDHSX8fXmrN6SYfjBBNGa+Jbn+Az8OXYI35Znz42mdl9s le8OuHYhqUAVqOjcCz/OmH4+tsUyw3FS1vBuQ6uz9x70UqEqlaLpFM0qmLPlk9WvQjZS koMavOoowR4nrz1x2pjxCr/t6bctHRL6OfhIWtb349k2zwgvd8PfQeW23eNRcar1PWHm 0MkP15GNA3mLPhhococB3MkK8ZcdZ6Hy7wBAxLCGNeoisDtaruuJMmwxjA7CTRVtLBd/ 9DwOVdUTCYsL6hf1mibqGaci+Xd8FFf8yyP/yd7+lCkZL8BBMACAB2XInJtzYqMCnKJ1 1ifg== 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:cc:to:from:dkim-signature; bh=dckUSl5z4UaY1zLi6ZaUm7FPVPOD+pWKaRJKmeXicSI=; fh=AN2IZn8GmRLo5145V0UqJ1ALAVyD4+Mvl25WDHeonts=; b=q41YYNF2BxVSXEUJLcnDRBStVSOqaLZPV5KquqnLoSYcZyrA7Ll6wk8TwP58kq0T1c ZOxoMnntqdfGPxxQRiYhv82LYftRqKlzKz4EUnZkFjX/BOmKSegcMIYAI3lDZHdUjEF6 DGmxIB3QwtoygShA04Sfc3oqKtaklw9F+D+iglKD8pqx/oYYvJHNnF8XLtW5G59o7VIw c5r2pNzhx3BYnzRkjU71vs3+4B/5EYsUC3lbMvDqu6yg9pwhU8v4f5pzC4KPxhpOCw4z i5YTyEhwODZEruKr/gjYRtBEPG5RpCt4bDCxQwGb5TDfV0+ZNgjouDIjc4QrsAQ9Hl59 4SMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OPspMI3f; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-157162-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157162-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o13-20020a17090a420d00b002a52c195c06si13182277pjg.28.2024.04.24.08.15.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 08:15:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157162-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OPspMI3f; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-157162-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157162-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 14BFD28909F for ; Wed, 24 Apr 2024 15:08:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8EECB161308; Wed, 24 Apr 2024 15:07:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OPspMI3f" Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BA0F15FCE1; Wed, 24 Apr 2024 15:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713971244; cv=none; b=XWyD9FF7vFdommE5SwM69utO2O8MuGhGyFeCcSdPjA3b8j9fORSnYCKH+NsziNCcXIgOsLf1N88PMDaSr198/sqvN3vq+jnpzv/n0rxu5WXrtDhBefyV71KxfcJ7zo6LH16sWe/KC1yR1mDqfPAXpDSH0ck6zAXZejt25hLQK60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713971244; c=relaxed/simple; bh=0PBo9Of6CNy3BPbkd/tZVfSeHDs2kDzIZaMPAx/MRPk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XzTCMdlYMUtKW59VjBdVqMTssxrPfBrtx66DytIVXxyA3FZ2AskzroinFKsjq4YZFjGahgxFfTIakZ26bKJyOyXneooJ24cigxCcv/sDta9oGTKxrQcso66Ys3YIdct9MgQ37i02ZRE4FT57YHRKwq73sJtoEkg1dRIbayjKFZ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OPspMI3f; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2d895e2c6efso104758991fa.0; Wed, 24 Apr 2024 08:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713971241; x=1714576041; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dckUSl5z4UaY1zLi6ZaUm7FPVPOD+pWKaRJKmeXicSI=; b=OPspMI3fI7edIm7uN2XEaEpJd+l6xqf8iloUE3La6xqjJaiZZgXaxi3jNa+bkAJqBd S5yNeKK2KYQCrzWSqGWxlxqTTLkGWQaZJIoZjil4nASfXExYyROAmfXp/wSvWaqjoWiB NGM8FAPvUUWTHdzX8bMr/RGGkgzgXNqiw//1p0Ls2dAH0JVztDblGuZrFMNBC/+K3gI0 Zrm2uCLBJmESXGhZQFu3tWeG3BqqxuuClQI26lg2eQVvUBRuz5gTO+VmJJlABEwkJyNI ihMPN8oYn0yGDA/zl/QJ9U07XQbbisvW80S5mzb5Kin6swSXDkezwEBX0WIOYpatmjnB UEyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713971241; x=1714576041; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dckUSl5z4UaY1zLi6ZaUm7FPVPOD+pWKaRJKmeXicSI=; b=sFyqgd9JmdVfmg4uaSS1ZCcmMakG2W2vcPicRi13ltNC1AsBZH6CX76puE4u9K5yss xlkx4VZw9Wk3HWBBP1QeMGOwy5QUXzZySt0F5xWZ1Ky//iU8wig+Z/yF4D0uMEai1QmZ opodPifb4zZCao4M4D8Y0BbcqkT3v87BTttRy6Ljsn7+O9/2WqL3ln9/hii54p6lCJb9 ZSD0tQ5Ecd10eLDjt5eT9/QGrcuMpWPaoEn5tC07MTFHkktj0UQ7FUh94m3ujcsRASxh zLWKjaD2K7T64LrpBBXwMBG8+ZGPtazz6cdupJ0SG3tP/KyqIGK0CPOIJLGYce8m+UOl Tmxg== X-Forwarded-Encrypted: i=1; AJvYcCVzmdBVEO7Ajp07Nm+wpLtcuTff04Gpr+udQHTfCDk9j4uLIjVWCc3/45MJav+XExDIHjZ4EFHenYP6k+GTTIJQ2lPYy1+QTmM6l4vRY9M416cJWnk9M+9S/uTW+/IWIebfEIMMqH+0 X-Gm-Message-State: AOJu0YynbuSNwCqr52CxnWYa4A7jJbU/r/n2WOfRNkD0MNKjZdEQ76mE he/7goNzLU1G4BNGBgWvqaRUkmJGYXmkzNqbjN+lWHSqCCfFfUK6 X-Received: by 2002:a2e:9855:0:b0:2d8:144e:c464 with SMTP id e21-20020a2e9855000000b002d8144ec464mr1685917ljj.36.1713971241416; Wed, 24 Apr 2024 08:07:21 -0700 (PDT) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id y18-20020a05651c221200b002de02f28ba1sm533935ljq.94.2024.04.24.08.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 08:07:21 -0700 (PDT) From: Serge Semin To: Serge Semin , Mark Brown , Andy Shevchenko Cc: Andy Shevchenko , Andy Shevchenko , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND v4 4/4] spi: dw: Drop default number of CS setting Date: Wed, 24 Apr 2024 18:06:45 +0300 Message-ID: <20240424150657.9678-5-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240424150657.9678-1-fancer.lancer@gmail.com> References: <20240424150657.9678-1-fancer.lancer@gmail.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 DW APB/AHB SSI core now supports the procedure automatically detecting the number of native chip-select lines. Thus there is no longer point in defaulting to four CS if the platform doesn't specify the real number especially seeing the default number didn't correspond to any original DW APB/AHB databook. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko --- Changelog v2: - Drop temporal variable and pass dws_spi::num_cs directly. --- drivers/spi/spi-dw-mmio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index cc74cbe03431..c56de35eca98 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -320,7 +320,6 @@ static int dw_spi_mmio_probe(struct platform_device *pdev) struct resource *mem; struct dw_spi *dws; int ret; - int num_cs; dwsmmio = devm_kzalloc(&pdev->dev, sizeof(struct dw_spi_mmio), GFP_KERNEL); @@ -364,11 +363,8 @@ static int dw_spi_mmio_probe(struct platform_device *pdev) &dws->reg_io_width)) dws->reg_io_width = 4; - num_cs = 4; - - device_property_read_u32(&pdev->dev, "num-cs", &num_cs); - - dws->num_cs = num_cs; + /* Rely on the auto-detection if no property specified */ + device_property_read_u32(&pdev->dev, "num-cs", &dws->num_cs); init_func = device_get_match_data(&pdev->dev); if (init_func) { -- 2.43.0