public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-iio@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Subject: Re: [PATCH v3 1/2] iio: adc: ti-ads1025: Get rid of legacy platform data
Date: Sat, 7 Dec 2019 11:09:03 +0000	[thread overview]
Message-ID: <20191207110903.5a37f59c@archlinux> (raw)
In-Reply-To: <20191205174637.47610-1-andriy.shevchenko@linux.intel.com>

On Thu,  5 Dec 2019 19:46:36 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Platform data is a legacy interface to supply device properties
> to the driver. In this case we even don't have in-kernel users
> for it. Just remove it for good.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reverted previous version.  Please do reply to your own thread when
you do this as sometimes I forget to check if there is a newer version.

Also, whilst reverting I noticed the part number is wrong in the patch
description so fixed that up whilst applying this.

Applied.

J
> ---
> v2: no changes
>  drivers/iio/adc/ti-ads1015.c          | 18 ++++++++----------
>  include/Kbuild                        |  1 -
>  include/linux/platform_data/ads1015.h | 23 -----------------------
>  3 files changed, 8 insertions(+), 34 deletions(-)
>  delete mode 100644 include/linux/platform_data/ads1015.h
> 
> diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
> index a550b132cfb7..3b123b4f0b99 100644
> --- a/drivers/iio/adc/ti-ads1015.c
> +++ b/drivers/iio/adc/ti-ads1015.c
> @@ -21,8 +21,6 @@
>  #include <linux/mutex.h>
>  #include <linux/delay.h>
>  
> -#include <linux/platform_data/ads1015.h>
> -
>  #include <linux/iio/iio.h>
>  #include <linux/iio/types.h>
>  #include <linux/iio/sysfs.h>
> @@ -33,6 +31,8 @@
>  
>  #define ADS1015_DRV_NAME "ads1015"
>  
> +#define ADS1015_CHANNELS 8
> +
>  #define ADS1015_CONV_REG	0x00
>  #define ADS1015_CFG_REG		0x01
>  #define ADS1015_LO_THRESH_REG	0x02
> @@ -219,6 +219,12 @@ static const struct iio_event_spec ads1015_events[] = {
>  	.datasheet_name = "AIN"#_chan"-AIN"#_chan2,		\
>  }
>  
> +struct ads1015_channel_data {
> +	bool enabled;
> +	unsigned int pga;
> +	unsigned int data_rate;
> +};
> +
>  struct ads1015_thresh_data {
>  	unsigned int comp_queue;
>  	int high_thresh;
> @@ -903,14 +909,6 @@ static void ads1015_get_channels_config(struct i2c_client *client)
>  
>  	struct iio_dev *indio_dev = i2c_get_clientdata(client);
>  	struct ads1015_data *data = iio_priv(indio_dev);
> -	struct ads1015_platform_data *pdata = dev_get_platdata(&client->dev);
> -
> -	/* prefer platform data */
> -	if (pdata) {
> -		memcpy(data->channel_data, pdata->channel_data,
> -		       sizeof(data->channel_data));
> -		return;
> -	}
>  
>  #ifdef CONFIG_OF
>  	if (!ads1015_get_channels_config_of(client))
> diff --git a/include/Kbuild b/include/Kbuild
> index ffba79483cc5..498821e5d9ed 100644
> --- a/include/Kbuild
> +++ b/include/Kbuild
> @@ -443,7 +443,6 @@ header-test-			+= linux/platform_data/ad7793.h
>  header-test-			+= linux/platform_data/ad7887.h
>  header-test-			+= linux/platform_data/adau17x1.h
>  header-test-			+= linux/platform_data/adp8870.h
> -header-test-			+= linux/platform_data/ads1015.h
>  header-test-			+= linux/platform_data/ads7828.h
>  header-test-			+= linux/platform_data/apds990x.h
>  header-test-			+= linux/platform_data/arm-ux500-pm.h
> diff --git a/include/linux/platform_data/ads1015.h b/include/linux/platform_data/ads1015.h
> deleted file mode 100644
> index 4cc9ffcafcbf..000000000000
> --- a/include/linux/platform_data/ads1015.h
> +++ /dev/null
> @@ -1,23 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-or-later */
> -/*
> - * Platform Data for ADS1015 12-bit 4-input ADC
> - * (C) Copyright 2010
> - * Dirk Eibach, Guntermann & Drunck GmbH <eibach@gdsys.de>
> - */
> -
> -#ifndef LINUX_ADS1015_H
> -#define LINUX_ADS1015_H
> -
> -#define ADS1015_CHANNELS 8
> -
> -struct ads1015_channel_data {
> -	bool enabled;
> -	unsigned int pga;
> -	unsigned int data_rate;
> -};
> -
> -struct ads1015_platform_data {
> -	struct ads1015_channel_data channel_data[ADS1015_CHANNELS];
> -};
> -
> -#endif /* LINUX_ADS1015_H */


      parent reply	other threads:[~2019-12-07 11:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 17:46 [PATCH v3 1/2] iio: adc: ti-ads1025: Get rid of legacy platform data Andy Shevchenko
2019-12-05 17:46 ` [PATCH v3 2/2] iio: adc: ti-ads1015: Make use of device property API Andy Shevchenko
2019-12-07 11:09   ` Jonathan Cameron
2019-12-09 14:39     ` Andy Shevchenko
2019-12-07 11:09 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191207110903.5a37f59c@archlinux \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox