Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp259674ybf; Thu, 27 Feb 2020 20:39:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzl6n6K754RVIDZAmkKi4JpNg70p4C7yfm3OaEjlrr2Mxb/trsWEYMZN/Kl4edu+FGSl80g X-Received: by 2002:aca:5403:: with SMTP id i3mr1859173oib.107.1582864763844; Thu, 27 Feb 2020 20:39:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582864763; cv=none; d=google.com; s=arc-20160816; b=TYJMqmpDqFps/6gG4qFa0yol8uUr2qVgoyRDFLlm0ARZfrsNz1Mb4aVy0QkvO0/2QV cK/rmIluysY+9IpDOG7QhMfTKcCoWbrVRkjnKah6h/gfeXzslraamJzFTOvNDM25ZxaS fZGACG3aWP1ocKvqUPaU0HkVtx+KkwC6CdExitP2wLzOMQ/hBihusY5dM0XHvCmMaq/4 BMLmr4FclmkcCcKjD6OEAE0AeSwApcHxT+SVdDoGJsJMJpSfMmZKY/GFyAx5BXnJTeYh JP0PkXH+wEf6UOlBzoSI0L582z+nv38J6CPjj9HuSQ2mRdJdsE+EnkwuDA7t0WMneR0C mtnQ== 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=QCI1h6XDepXvM9SY2yPFBOaTm7J4GLR1VLmmf1BO1BQ=; b=gIb3N1WBw9pb0X2EPB7aMoJJok8bO8ldNWREqSe5bxeZALHiIVBwZwPa9FMa1mXMVS q5bhIdHoXEW/Vx6GrdDdIp/JPcJGxV14lab8rRQqgGG9rUVMAn78IxcEBrlSiSzbW1bW PHnwEOUc2OmmlCLuKJnbPXyqdioY59RmpHy2RLdlCVXjkCdCW3+njn7adgy/f2TN4szQ NsVCcvyp1ZYolYZMnHXQZh3LHqybBGfDF0UPpdUTn71oJrfubr5dINcwVc1EffJ1mLPq wqpyob4fT7NwNgFEfdVKmRVqFabE7hEUMiVk3Qt4+5qvcq8rD8FErW3wyaIqknrEvXwl 0KHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hgFIB8G5; 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 t1si1204166oic.140.2020.02.27.20.39.12; Thu, 27 Feb 2020 20:39:23 -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=hgFIB8G5; 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 S1730906AbgB1Eii (ORCPT + 99 others); Thu, 27 Feb 2020 23:38:38 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34199 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730802AbgB1Eii (ORCPT ); Thu, 27 Feb 2020 23:38:38 -0500 Received: by mail-pf1-f193.google.com with SMTP id i6so1058970pfc.1; Thu, 27 Feb 2020 20:38:36 -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=QCI1h6XDepXvM9SY2yPFBOaTm7J4GLR1VLmmf1BO1BQ=; b=hgFIB8G5XahI8txUYsDG5MShh+0AatjMli8EcASbn9w8027Uc/WNZUIeppsDE5nxwu 8k1V9RFPmVegaSjuOx5NqPNXyhYFevqXge3mJywpLSUkweXuhEEPympdpxPUfv4+hb7M yVr3nweqvyatKHlLAGD5cGjE6180bkWLkRKuZ8d+BlAN7LXt6IsJ7ZOMRZy65LpEx7Ui S718KkrhH+sJwpIEeL74ndAs5kA5oN9ZUNx2dNeEdTEWXtc6ryrHznrwd0AtPIkTM4Sl YduGSO7MjAqAtPPPGBwrs4jG57l+x4oS+9uKRGtDuTu/gKF8UiMV8AVR31WyIdX3Axb3 SM8A== 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=QCI1h6XDepXvM9SY2yPFBOaTm7J4GLR1VLmmf1BO1BQ=; b=t6kDudtEznsH/lHYdAMKvyMVbufceRCvjSuUc30uZYiNotNyNS8TCOZJCDrFMMEsoQ y5UVIFZDgxY6nRgJhf1xSc4/SkgmBI9zBSfQuBcGDTPACdy0uqJz7Jt/cPkGgcTurabx XN9ILPJzAOUzF+2rpRdAhbL5XAMxzLzrFHtqXwD3qo/KjT77LMXKjLyeaoNks5gDFDgT 3+zawyxJNgHGUiG5CrimXglAFiMVaCenDf3YOmCoynWWHjJsLJ++ECZzPhDpESXG6Bdp dctgeTpBYRCX92OHu9lMWNKaBN74R1/d1XUXNNOX2nJ9JYpGjBMKcuB0IjCrk/mPGQMI mCbg== X-Gm-Message-State: APjAAAXm04d+VJL8D8HArsagtNs68N3OGHnmvzmUi1AUymljJLyrA4Yk mraEaxlYpqesh+M2C8CD4oY= X-Received: by 2002:a62:7681:: with SMTP id r123mr2516296pfc.169.1582864715674; Thu, 27 Feb 2020 20:38:35 -0800 (PST) Received: from localhost.localdomain ([240e:379:962:6595:7b84:9990:1a82:371c]) by smtp.gmail.com with ESMTPSA id 196sm9069047pfy.86.2020.02.27.20.38.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 20:38:35 -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 v2 1/4] spi: make spi-max-frequency optional Date: Fri, 28 Feb 2020 12:36:33 +0800 Message-Id: <20200228043636.559915-2-gch981213@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200228043636.559915-1-gch981213@gmail.com> References: <20200228043636.559915-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 v1: new commit 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 38b4c78df506..c0c55dc79972 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1955,13 +1955,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