Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1243266imu; Sat, 17 Nov 2018 20:27:13 -0800 (PST) X-Google-Smtp-Source: AJdET5djw5OGLkEAELqJ5/l9M66p6dxW63FnbxlyEuhiqi5RML5tHYXHOQcfkqcuaVnQVKLdDC9L X-Received: by 2002:a63:e950:: with SMTP id q16mr15638573pgj.138.1542515233846; Sat, 17 Nov 2018 20:27:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542515233; cv=none; d=google.com; s=arc-20160816; b=WegsjBRAP17ao7ceZKUcnL1ROr2EZ8e3O6NFrguAdJzNridrA9HPdLiHtZEsfEpNOt UdPUTQSI/e0vyIUx2qUIf9tpG4fOlC6iAtX5nk4gfCp0pxUhnMf4VKCRp2mCGHv/IUEu anXSmPKccq5VkOSPoea63WL43bBNfndVz2vtFAdMIhDUzcQ4Ts+l/5UIRWbdSCHU4YO7 cA5QT79hAw7CcogU7J7q0MLuHJSMZJnEYBrm3liVO+UejJo0LBkIOaW8mUKmZA+AyPLN zfb1RIvzpeBku/cs6dIBsxKjLT4lt/UcLptmzC/z08qkU5zf6BkZTg7oj7TyvVvbEBqe TgKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=AQMJAzyixzk0/1WSmVNMs8fwNy6KbazheSZxWxsLE1Q=; b=BzP4kXvP9vhDKwMXi8Ao4H9hXVzshUjTJd2wM0tAYb5CwmFZBkiVqvK0XCBtyzZVTb Sb3yJEBJaaZFgCCyNNGaOWW8Da6CHtsMK/1/gUudjyrwpelaF3H3MsiMbcZkK1qaILP2 QtnWb1HP9dT6WYTBBj6s34d0aqOKdqN2Jc/kQN/3wBJKM9YDVgHNGev+vL0FPlnb7gjc LwQK+qZU6/9KPuI9PlIEr1887CHUE2WvY/oox8fzGQX9PkneAEDqaPlJo2eEpC0MQ5nD WKnwvliPe471bOf0pDIjFOYvwTH5P/kZVOnIjRI+pCqlluVDZijHsn1FHFiM56dbZeo6 CcPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@usp-br.20150623.gappssmtp.com header.s=20150623 header.b=IglfmGaT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=usp.br Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9-v6si41303073pfe.76.2018.11.17.20.26.59; Sat, 17 Nov 2018 20:27:13 -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=@usp-br.20150623.gappssmtp.com header.s=20150623 header.b=IglfmGaT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=usp.br Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726959AbeKROpV (ORCPT + 99 others); Sun, 18 Nov 2018 09:45:21 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:39662 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbeKROpU (ORCPT ); Sun, 18 Nov 2018 09:45:20 -0500 Received: by mail-qk1-f193.google.com with SMTP id q70so26335164qkh.6 for ; Sat, 17 Nov 2018 20:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp-br.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AQMJAzyixzk0/1WSmVNMs8fwNy6KbazheSZxWxsLE1Q=; b=IglfmGaTcc71ngiuUY41D+tnc+EvGiwidh4C3kcgtK1eS2GyctTL3DU2/+MQkTu5Ua TrOYIgrs+5PVbmDZg5vPGVBCj03LjTvUD8UElhGtfL/t08tboq7e++X8BAF6ab1SKrLn MT6jODnIyXtc4FrJowQX/TBwM0Od/hRTWWB7R0In1/mG+ic64ZFaW1oo/5Ots8Mbky9J 5wv90c2Y273iM7eWICtQUzKmXY13sT88YKY2pTAIRWnPEczx2Uzk9rzvj6jJzkQWeVZU VdKxE5dihCj5DguC8cQHjpzYQTyl+q/0RYhgHM60NQeaYdZIi0VCVBV4NF99YSi98DrZ 1iaQ== 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; bh=AQMJAzyixzk0/1WSmVNMs8fwNy6KbazheSZxWxsLE1Q=; b=q89zOLoHWbOQpflsL7uH00KJhTId2YW0Aas2dA4nq08atNi7GpEzg60NdlP5O0HUpb /JuQ9BWBOuYEpCRdCLbSPEYhqBbjjhe5xN6DAyIOHmPvq0xILR2cN+HZ9ypXkSsEl9wj 0hqf5EHq26oVOpoXp1kZrRn5zgqUzMKf1DKCLGkRMlE9CY+a1k/zNTPosqn6L1eUsFXx BF/c+LY+zpHH+SQtejtfpr732W+NE3fjQE+UwBTJsrHzfV/xpWPtVCbq9GcdHXtwJ4eo h7x++RB6k56WAMk1SXIQJ1XnddffF7X3ZlZnl0Pt2LVvVpsqjzFkSOQKhFebNp2SNDvJ dyhQ== X-Gm-Message-State: AGRZ1gIGtR3FhRXolkdlBcEWkhE1IjlU8kH4KyNyjvBVL56zaic7QpuE ddl752y8edEAUHz5QBq3bNOazA== X-Received: by 2002:ac8:34cb:: with SMTP id x11mr16053740qtb.115.1542515179321; Sat, 17 Nov 2018 20:26:19 -0800 (PST) Received: from mango.spo.virtua.com.br ([2804:14c:81:942d::1]) by smtp.gmail.com with ESMTPSA id b6sm16112350qtq.29.2018.11.17.20.26.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Nov 2018 20:26:18 -0800 (PST) From: Matheus Tavares To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , Rob Herring , Mark Rutland Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandru Ardelean , kernel-usp@googlegroups.com, victorcolombo@gmail.com Subject: [PATCH v2 2/7] staging:iio:ad2s90: Remove spi setup that should be done via dt Date: Sun, 18 Nov 2018 02:25:35 -0200 Message-Id: <20181118042540.12697-3-matheus.bernardino@usp.br> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181118042540.12697-1-matheus.bernardino@usp.br> References: <20181118042540.12697-1-matheus.bernardino@usp.br> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ad2s90 driver currently sets some spi settings (max_speed_hz and mode) at ad2s90_probe. Since the maximum frequency is a required element in DT binding for spi slave devices and because the spi mode for the device can be either (0,0) or (1,1), these settings should be handled via device tree, not in the driver's code. This patch removes them from the probe function. Note: The way in which the mentioned spi settings need to be specified on the ad2s90's node of a device tree will be documented in the future patch "dt-bindings:iio:resolver: Add docs for ad2s90". Signed-off-by: Matheus Tavares --- Changes in v2: - Rewritten patch message to better explain why the code snippet in question should be removed. drivers/staging/iio/resolver/ad2s90.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c index 6ffbac66b837..913d6fad2d4d 100644 --- a/drivers/staging/iio/resolver/ad2s90.c +++ b/drivers/staging/iio/resolver/ad2s90.c @@ -77,7 +77,6 @@ static int ad2s90_probe(struct spi_device *spi) { struct iio_dev *indio_dev; struct ad2s90_state *st; - int ret; indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); if (!indio_dev) @@ -94,16 +93,6 @@ static int ad2s90_probe(struct spi_device *spi) indio_dev->num_channels = 1; indio_dev->name = spi_get_device_id(spi)->name; - /* need 600ns between CS and the first falling edge of SCLK */ - spi->max_speed_hz = 830000; - spi->mode = SPI_MODE_3; - ret = spi_setup(spi); - - if (ret < 0) { - dev_err(&spi->dev, "spi_setup failed!\n"); - return ret; - } - return devm_iio_device_register(indio_dev->dev.parent, indio_dev); } -- 2.18.0