From: Jonathan Cameron <jic23@kernel.org>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
kernel-janitors@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH 19/61] iio: common: hid-sensors: simplify getting .drvdata
Date: Sat, 21 Apr 2018 17:09:16 +0100 [thread overview]
Message-ID: <20180421170916.6af36c05@archlinux> (raw)
In-Reply-To: <20180419140641.27926-20-wsa+renesas@sang-engineering.com>
On Thu, 19 Apr 2018 16:05:49 +0200
Wolfram Sang <wsa+renesas@sang-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@sang-engineering.com>
Applied, thanks,
Jonathan
> ---
>
> Build tested only. buildbot is happy. Please apply individually.
>
> drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> index cfb6588565ba..2ce0efd98cc0 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> @@ -304,8 +304,7 @@ EXPORT_SYMBOL(hid_sensor_setup_trigger);
>
> static int __maybe_unused hid_sensor_suspend(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 hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
>
> return _hid_sensor_power_state(attrb, false);
> @@ -313,8 +312,7 @@ static int __maybe_unused hid_sensor_suspend(struct device *dev)
>
> static int __maybe_unused hid_sensor_resume(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 hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
> schedule_work(&attrb->work);
> return 0;
> @@ -322,8 +320,7 @@ static int __maybe_unused hid_sensor_resume(struct device *dev)
>
> static int __maybe_unused hid_sensor_runtime_resume(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 hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
> return _hid_sensor_power_state(attrb, true);
> }
next prev parent reply other threads:[~2018-04-21 16:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-19 14:05 [PATCH 00/61] tree-wide: simplify getting .drvdata Wolfram Sang
2018-04-19 14:05 ` [PATCH 17/61] hid: " Wolfram Sang
2018-04-19 14:05 ` [PATCH 18/61] iio: common: cros_ec_sensors: " Wolfram Sang
2018-04-21 16:07 ` Jonathan Cameron
2018-04-19 14:05 ` [PATCH 19/61] iio: common: hid-sensors: " Wolfram Sang
2018-04-21 16:09 ` Jonathan Cameron [this message]
2018-04-19 14:06 ` [PATCH 48/61] staging: iio: adc: " Wolfram Sang
2018-04-21 16:10 ` Jonathan Cameron
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=20180421170916.6af36c05@archlinux \
--to=jic23@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=wsa+renesas@sang-engineering.com \
/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;
as well as URLs for NNTP newsgroup(s).