Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1892540ybv; Fri, 14 Feb 2020 07:49:12 -0800 (PST) X-Google-Smtp-Source: APXvYqyvuy0R2tyOAoyTJcvPf6TEBvSfSSIwUvVhybXElOB6tuLA6lo0JEc6GNJuZmJ+ouwDhEzi X-Received: by 2002:a9d:7984:: with SMTP id h4mr2835561otm.297.1581695351687; Fri, 14 Feb 2020 07:49:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581695351; cv=none; d=google.com; s=arc-20160816; b=FQLR7TMhlE+S2LC0DU0WLecuK+975cPR0tvaWsbQLB0xFAL06XyWKvW0wNRxopN2Sa t0oabnDEYcdOnnpb3fHqTZwZIf91rZMcMEWL/ZjxeXbWmDRUJ+bPC0Cj8XJ/JUVM9u5k Eh/nY0HnRe8WIwThTdjTOtGQJoiKVFLpBa224hnGpytfWEVcRqMSz88Pg4VWnJeV5Svj Midbc/YJuKOK74CIt9ZciZ/xvkZJeDqnQPXtFaD5Se68f37lFO2D+5mVqRA0PLae9WJi kuZ5JYEg2/6nUJpbKe577++eAa8dgEQIcpyAvT6B+5hnO1tVK8TxS0rnnAQbnmSlni0J q5Bg== 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=af+RMMUSD/+/9+1udtd8wu3+I3I8Hjpi+hsWz1uINBc=; b=ncGHssJtlyIZj95M8dYLDum83whwuEzfHaFG1XzltMLCoAp4Wi2qpYNnJYIO51/yrw 5Vw0hT0nAJDWrjROo9y7zyi1ed3cX9Kck1NrJtasGPuB2tkLqloMNgxrLK1wAhkwu1g4 Vqj79MLTIES/ZATqBG3s/SLHSKCIw6kRsKCwDybIxwA/qvZx//T40xVJ5aahzqgnOQKN r3252tRzsS8O87svF5dUeCJatgNs3l8kqlMZ5A7D1v042TXKsLKNsxW39xu2pMLYDTqR /oAnvfazLRe0ESiZf5QhDkFqezassByTK4vCJ72claTVvH/wRXZdD7rUEuFQ750jmz2R umSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jonSeFxL; 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 w26si3117812otl.213.2020.02.14.07.49.00; Fri, 14 Feb 2020 07:49:11 -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=jonSeFxL; 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 S1729472AbgBNPsw (ORCPT + 99 others); Fri, 14 Feb 2020 10:48:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:51106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728859AbgBNPsv (ORCPT ); Fri, 14 Feb 2020 10:48:51 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (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 B8B592086A; Fri, 14 Feb 2020 15:48:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581695331; bh=uGCGLRGoU3g45VCxwnCAPerREcE8t/lFXtzjEKoahHE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jonSeFxLGd0GwMK9iCwlLlOh1yN0kH4R4m90Co623DJqk3q0eFf/6WppwgzJ+fUyc +yrgcrwF7dABE8ZQ+qdH4LndsJySmLCHQ4zOttAzWo6zwh5MqpTyXxZgi2OekSEpDG hxwbtErh+Zky5v1/qa4IBY7ctbZYS3mrJATDgLQs= Date: Fri, 14 Feb 2020 15:48:46 +0000 From: Jonathan Cameron To: Alexandru Tachici Cc: , Subject: Re: [PATCH 3/5] staging: iio: adc: ad7192: removed spi_device_id Message-ID: <20200214154846.7daf946c@archlinux> In-Reply-To: <20200212161721.16200-4-alexandru.tachici@analog.com> References: <20200212161721.16200-1-alexandru.tachici@analog.com> <20200212161721.16200-4-alexandru.tachici@analog.com> X-Mailer: Claws Mail 3.17.4 (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 Wed, 12 Feb 2020 18:17:19 +0200 Alexandru Tachici wrote: > This patch removes spi_device_id table and moves the > init data (id of the chip) in the .data field > of of_device_id table. > > Signed-off-by: Alexandru Tachici Applied Thanks, Jonathan > --- > drivers/staging/iio/adc/ad7192.c | 33 +++++++++++--------------------- > 1 file changed, 11 insertions(+), 22 deletions(-) > > diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c > index 8fca8915543d..8ec28aa8fa8a 100644 > --- a/drivers/staging/iio/adc/ad7192.c > +++ b/drivers/staging/iio/adc/ad7192.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -876,6 +877,15 @@ static int ad7192_channels_config(struct iio_dev *indio_dev) > return 0; > } > > +static const struct of_device_id ad7192_of_match[] = { > + { .compatible = "adi,ad7190", .data = (void *)ID_AD7190 }, > + { .compatible = "adi,ad7192", .data = (void *)ID_AD7192 }, > + { .compatible = "adi,ad7193", .data = (void *)ID_AD7193 }, > + { .compatible = "adi,ad7195", .data = (void *)ID_AD7195 }, > + {} > +}; > +MODULE_DEVICE_TABLE(of, ad7192_of_match); > + > static int ad7192_probe(struct spi_device *spi) > { > struct ad7192_state *st; > @@ -928,7 +938,7 @@ static int ad7192_probe(struct spi_device *spi) > } > > spi_set_drvdata(spi, indio_dev); > - st->devid = spi_get_device_id(spi)->driver_data; > + st->devid = (unsigned long)of_device_get_match_data(&spi->dev); > indio_dev->dev.parent = &spi->dev; > indio_dev->name = spi_get_device_id(spi)->name; > indio_dev->modes = INDIO_DIRECT_MODE; > @@ -1009,26 +1019,6 @@ static int ad7192_remove(struct spi_device *spi) > return 0; > } > > -static const struct spi_device_id ad7192_id[] = { > - {"ad7190", ID_AD7190}, > - {"ad7192", ID_AD7192}, > - {"ad7193", ID_AD7193}, > - {"ad7195", ID_AD7195}, > - {} > -}; > - > -MODULE_DEVICE_TABLE(spi, ad7192_id); > - > -static const struct of_device_id ad7192_of_match[] = { > - { .compatible = "adi,ad7190" }, > - { .compatible = "adi,ad7192" }, > - { .compatible = "adi,ad7193" }, > - { .compatible = "adi,ad7195" }, > - {} > -}; > - > -MODULE_DEVICE_TABLE(of, ad7192_of_match); > - > static struct spi_driver ad7192_driver = { > .driver = { > .name = "ad7192", > @@ -1036,7 +1026,6 @@ static struct spi_driver ad7192_driver = { > }, > .probe = ad7192_probe, > .remove = ad7192_remove, > - .id_table = ad7192_id, > }; > module_spi_driver(ad7192_driver); >