[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180421170754.4f3ab554@archlinux>
Date: Sat, 21 Apr 2018 17:07:54 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>
Cc: linux-kernel@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
kernel-janitors@...r.kernel.org, Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald-Stadler <pmeerw@...erw.net>,
linux-iio@...r.kernel.org
Subject: Re: [PATCH 18/61] iio: common: cros_ec_sensors: simplify getting
.drvdata
On Thu, 19 Apr 2018 16:05:48 +0200
Wolfram Sang <wsa+renesas@...g-engineering.com> wrote:
> We should get drvdata from struct device directly. Going via
> platform_device is an unneeded step back and forth.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
Applied, thanks.
Jonathan
> ---
>
> Build tested only. buildbot is happy. Please apply individually.
>
> drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> index a620eb5ce202..3df6c0e09832 100644
> --- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> @@ -448,8 +448,7 @@ EXPORT_SYMBOL_GPL(cros_ec_sensors_core_write);
>
> static int __maybe_unused cros_ec_sensors_prepare(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> + struct iio_dev *indio_dev = dev_get_drvdata(dev);
> struct cros_ec_sensors_core_state *st = iio_priv(indio_dev);
>
> if (st->curr_sampl_freq == 0)
> @@ -471,8 +470,7 @@ static int __maybe_unused cros_ec_sensors_prepare(struct device *dev)
>
> static void __maybe_unused cros_ec_sensors_complete(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> + struct iio_dev *indio_dev = dev_get_drvdata(dev);
> struct cros_ec_sensors_core_state *st = iio_priv(indio_dev);
>
> if (st->curr_sampl_freq == 0)
Powered by blists - more mailing lists