Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6606551ybf; Fri, 6 Mar 2020 00:52:32 -0800 (PST) X-Google-Smtp-Source: ADFU+vsTZmxgcRYZw37iWMEvT1VBjraLb9Z3HZ1fOmTv+F6xUBvqQlOtcVl6I3mv2hJSVTW1R3qf X-Received: by 2002:aca:4e58:: with SMTP id c85mr1875008oib.115.1583484752862; Fri, 06 Mar 2020 00:52:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583484752; cv=none; d=google.com; s=arc-20160816; b=VM65Nx1bj5OZJHeKz5Q88g4pwOXhfZjNkbspEngcc9tSmEDT9TtctkblWRpZ40K18B 14lF/pFAaG2S9+hsEdQCtcV6yale4KGE+zHQqowWjpPAEt6cUPAOJbozVRBHzZlA+dpV M7DztuoUim255NP6DtW6ERZ4PkT/0BHxIbhChQVde035KgDpmbHv4+7EnuWQQRkk3bw5 OoyBzZDuSM8Xtfc5I0qXAO0zKXFeIziU22/RaUPd+Z6qJr7vsEXA9VLzrkugbckVCDxi nLjTLqa0zJz5frkRDdbzozYyitXFaN2mq8XWumagR79qOWlA28MNshejyZMCwsMG8KsC 9+oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1MJfeELIuC6LsKgfyfQqa0z3Waht5G7PSNrYy3Wi+08=; b=XlYeC/YPsWVgJZiJDgS0nCf9dzTwufkcpaUs+e8kNMg8I1tTI1u4402U0wYVi+kwla qaU+KDQ8T2wCWNeNqTehcNOSO9ZLsvMJynNJ36NmY/mLDyadnum/8SLK3hhwMtMfLdcD eIRF7zpEoMiNumS97kbRdqAj/3TrhQSWyUQ/Row0xLOa/Q7l+0dIbb/EtOzhYo8MqwHj +1QNTI4Ak3j++ctECrlRrhxbrouycBC8q066DDoLWTMpUFqXT0tT/vaC9VVjmtSAdzfJ Wmo2tDi5qddESUn7K8jqw4CyrMr6+SS70ISCOpVwYZ2Y1qYq9UNyHQGDmAym/D1kzc2C CJDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="msCi53q/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10si1035057otr.143.2020.03.06.00.52.20; Fri, 06 Mar 2020 00:52:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="msCi53q/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726646AbgCFIvu (ORCPT + 99 others); Fri, 6 Mar 2020 03:51:50 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46603 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbgCFIvu (ORCPT ); Fri, 6 Mar 2020 03:51:50 -0500 Received: by mail-pf1-f194.google.com with SMTP id o24so773178pfp.13; Fri, 06 Mar 2020 00:51:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1MJfeELIuC6LsKgfyfQqa0z3Waht5G7PSNrYy3Wi+08=; b=msCi53q/ygvF5LxsC0mewd4cbGjJiaaBtvneNNCWDGd/w0WAoNfXuxHc6Lk5GHdaFS a1Ns/9mJlE5THiwNGi2R39qyvu2zYxQM7zinWhETTsZT+/7NceUy7RmhQ21ViWyf0yzu Y94sPYIzEdkQxDie5d9dBtaRnQHxmU2QoZmxBfht/O+w1Q0v2Xqneeb768RMigZvKnrG CcBWckHero/W8loNJJDYI/sf1SpsjucE2WeHJiNartnlcrUuoQZ0LPU8Cp1FY73JvXsL xBKGh3fHhtsRchNreq5rPydEcRRojCIuoEkgATinxKkygPaIokRVHb/p99SWM0dTVeux F9DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1MJfeELIuC6LsKgfyfQqa0z3Waht5G7PSNrYy3Wi+08=; b=onILw0FQMkgPlYaDIfQrEwr40Lt5mH1W2k/YQU+LltKQCuAGlii2K29m1K2GQRMZkA CMrIJl76U8DfZRIT25w8fjXQWlo1IrgOCQJhlEu6CuhTJ7soK+iTL9Yui66qu2MJ14/R msS8H+bVvekqJm+opFxvsTnUKPFyIT8wnH5R33VQRjuxzXWESdmT+bUtILdCQ0rZiws8 viFzPS+pkS2dTsW/LAAPO0YDT4WySBE67lEbfCvz0vzs+zMuowJtLuk9tRl6JVyj7iB7 MWPvE3J9WWNPeboyw9LqEBwtGJKkmcTP/OdUBqUE4qcZeYmJsLTJE3Kclk9ay5Qq7Zuq jHoQ== X-Gm-Message-State: ANhLgQ29aumnMcQZ3nPG8zVzrAg8J/ntfsopkakkUwcrGgfEbNF2eSJF KaWzt3F2ihXrkkB0uj/T4qk= X-Received: by 2002:a63:1245:: with SMTP id 5mr2267008pgs.55.1583484709301; Fri, 06 Mar 2020 00:51:49 -0800 (PST) Received: from guoguo-omen.lan ([240e:379:94a:b53:8200:7767:6b7e:4da3]) by smtp.gmail.com with ESMTPSA id s23sm8527334pjp.28.2020.03.06.00.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2020 00:51:48 -0800 (PST) From: Chuanhong Guo To: linux-mediatek@lists.infradead.org, linux-spi@vger.kernel.org, linux-mtd@lists.infradead.org, devicetree@vger.kernel.org Cc: Chuanhong Guo , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Matthias Brugger , Mark Brown , Tudor Ambarus , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3 1/4] spi: make spi-max-frequency optional Date: Fri, 6 Mar 2020 16:50:49 +0800 Message-Id: <20200306085052.28258-2-gch981213@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200306085052.28258-1-gch981213@gmail.com> References: <20200306085052.28258-1-gch981213@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We only need a spi-max-frequency when we specifically request a spi frequency lower than the max speed of spi host. This property is already documented as optional property and current host drivers are implemented to operate at highest speed possible when spi->max_speed_hz is 0. This patch makes spi-max-frequency an optional property so that we could just omit it to use max controller speed. Signed-off-by: Chuanhong Guo --- Change since v2: none Change since v1: new patch drivers/spi/spi.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 22baf204a09d..e317fb30329f 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1951,13 +1951,8 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi, spi->mode |= SPI_CS_HIGH; /* Device speed */ - rc = of_property_read_u32(nc, "spi-max-frequency", &value); - if (rc) { - dev_err(&ctlr->dev, - "%pOF has no valid 'spi-max-frequency' property (%d)\n", nc, rc); - return rc; - } - spi->max_speed_hz = value; + if (!of_property_read_u32(nc, "spi-max-frequency", &value)) + spi->max_speed_hz = value; return 0; } -- 2.24.1