Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5022024imu; Sat, 1 Dec 2018 07:37:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/VDDbF9JeLZN5Rjx+ZhNITxOhAoOXSDZpMEHYvkyljhlN7xCONbihLQl+xX92smb0qI0Sdn X-Received: by 2002:a62:3241:: with SMTP id y62mr9634227pfy.178.1543678641324; Sat, 01 Dec 2018 07:37:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543678641; cv=none; d=google.com; s=arc-20160816; b=Le7fuqnBtXCn26A3IhCm9T0n5TNfTULL6oSnAuCnrD5TxDOfdmMNw1pbAvqY4+jTc1 On9qC7iCrJKhzEPOqz/IOn+a6FTHzRNm3XmQDCEQnTLcUGrEti4VreCT2DR0iphyYKEL LUWl5vH0DUkwN3JXfyKtTIk7QjPrkIpANUyref/Qa+TUlo5cm8L7AO/rByQ4IDtdZNix AfpmVbPk2OKv8IQgP7WSRt32iR+zuFtAgR345eBtYWTbGwnctSTgI8NilwX0Hz366eX5 PFD93ltMUGBJVQ4mufvpC/hiilfuN3CMOVmaCPv4GjhK4PcQeEtE5r1ricgPZBucL9Rk 1gZg== 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:subject:cc:to:from:date :dkim-signature; bh=Sx5FVyYE9lPfOpAQJAPWTQmRSBUGi1WO426nmXRBeRU=; b=rqo3dL4rwXZrId0aV5j/9OuCQvcC052PoTBtSAtzA4ZKK2rQJqpWX7Sx/MCO3HDxby +0AjfjftMrz4KpHCJbDiRC0j2t3tFO7B84nhVIRT7mDqXMo6xfK4xP7JeLeD4RsrZsfa Q4ajOS39XGTjM0156oXGCrFRUPj6ivLcqFfat0s21uDA/kjQ8MLIuv8xgHtVoeDQBhg0 e9DBtZ/De1TfcpctscQfOLU8Qkh4fXOh0oGZ2iCQi7HPLOdmIiIya/s3mZ6+1h7lmzNR vwyjVFTX91Mc6YbIrtBzB1PkBIas3yVrQabWi378C9AjDxGV7LsPSrZLhhDuqteT1tAG I7MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2n2yxxLe; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si8753219pfc.98.2018.12.01.07.37.07; Sat, 01 Dec 2018 07:37:21 -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=@kernel.org header.s=default header.b=2n2yxxLe; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727015AbeLBCrU (ORCPT + 99 others); Sat, 1 Dec 2018 21:47:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:50656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726717AbeLBCrU (ORCPT ); Sat, 1 Dec 2018 21:47:20 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 256572146F; Sat, 1 Dec 2018 15:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543678473; bh=FWwqSZtV1l22J/ZQH1mUnWy7mrNSce8vOw744zGvqEw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=2n2yxxLem4vTeEZXZ9W8DvZG0Yek6757kTekjkWhwDSzEHMWMEFNcl/r+nFh2gVHK MgW5CLM2uc51OFlD7OKIoQAMg49aGbfgRVXVtSWa/am2HSxF/HhOvtwDYJ7EeDHg8+ oraeZJa3O1Kwc7UfOuktysTf5aPhy0A7XMsbxVog= Date: Sat, 1 Dec 2018 15:34:28 +0000 From: Jonathan Cameron To: Matheus Tavares Cc: Lars-Peter Clausen , Michael Hennerich , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , Rob Herring , Mark Rutland , 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: Re: [PATCH v3 2/7] staging:iio:ad2s90: Remove spi setup that should be done via dt Message-ID: <20181201153428.399caf50@archlinux> In-Reply-To: <20181124002312.6923-3-matheus.bernardino@usp.br> References: <20181124002312.6923-1-matheus.bernardino@usp.br> <20181124002312.6923-3-matheus.bernardino@usp.br> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 23 Nov 2018 22:23:07 -0200 Matheus Tavares wrote: > 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 Applied, Thanks, Jonathan > --- > Changes in v3: > - none > > 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 fdae067ed866..abb9b9147ee6 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); > } >