From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: <linux-kernel@vger.kernel.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
Kefeng Wang <wangkefeng.wang@huawei.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
<linux-input@vger.kernel.org>
Subject: [PATCH next 10/25] input: misc: Use dev_get_drvdata()
Date: Tue, 23 Apr 2019 15:50:05 +0800 [thread overview]
Message-ID: <20190423075020.173734-11-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <20190423075020.173734-1-wangkefeng.wang@huawei.com>
Using dev_get_drvdata directly.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/input/misc/max77693-haptic.c | 6 ++----
drivers/input/misc/max8925_onkey.c | 10 ++++------
drivers/input/misc/max8997_haptic.c | 3 +--
drivers/input/misc/msm-vibrator.c | 6 ++----
drivers/input/misc/palmas-pwrbutton.c | 6 ++----
drivers/input/misc/regulator-haptic.c | 6 ++----
drivers/input/misc/stpmic1_onkey.c | 6 ++----
drivers/input/misc/twl4030-vibra.c | 3 +--
drivers/input/misc/twl6040-vibra.c | 3 +--
9 files changed, 17 insertions(+), 32 deletions(-)
diff --git a/drivers/input/misc/max77693-haptic.c b/drivers/input/misc/max77693-haptic.c
index 46b0f48fbf49..8968fd48e95c 100644
--- a/drivers/input/misc/max77693-haptic.c
+++ b/drivers/input/misc/max77693-haptic.c
@@ -381,8 +381,7 @@ static int max77693_haptic_probe(struct platform_device *pdev)
static int __maybe_unused max77693_haptic_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct max77693_haptic *haptic = platform_get_drvdata(pdev);
+ struct max77693_haptic *haptic = dev_get_drvdata(dev);
if (haptic->enabled) {
max77693_haptic_disable(haptic);
@@ -394,8 +393,7 @@ static int __maybe_unused max77693_haptic_suspend(struct device *dev)
static int __maybe_unused max77693_haptic_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct max77693_haptic *haptic = platform_get_drvdata(pdev);
+ struct max77693_haptic *haptic = dev_get_drvdata(dev);
if (haptic->suspend_state) {
max77693_haptic_enable(haptic);
diff --git a/drivers/input/misc/max8925_onkey.c b/drivers/input/misc/max8925_onkey.c
index 7c49b8d23894..af0ba592a0b3 100644
--- a/drivers/input/misc/max8925_onkey.c
+++ b/drivers/input/misc/max8925_onkey.c
@@ -135,9 +135,8 @@ static int max8925_onkey_probe(struct platform_device *pdev)
static int __maybe_unused max8925_onkey_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct max8925_onkey_info *info = platform_get_drvdata(pdev);
- struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
+ struct max8925_onkey_info *info = dev_get_drvdata(dev);
+ struct max8925_chip *chip = dev_get_drvdata(dev->parent);
if (device_may_wakeup(dev)) {
chip->wakeup_flag |= 1 << info->irq[0];
@@ -149,9 +148,8 @@ static int __maybe_unused max8925_onkey_suspend(struct device *dev)
static int __maybe_unused max8925_onkey_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct max8925_onkey_info *info = platform_get_drvdata(pdev);
- struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
+ struct max8925_onkey_info *info = dev_get_drvdata(dev);
+ struct max8925_chip *chip = dev_get_drvdata(dev->parent);
if (device_may_wakeup(dev)) {
chip->wakeup_flag &= ~(1 << info->irq[0]);
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
index 99bc762881d5..5ffb0ac68d50 100644
--- a/drivers/input/misc/max8997_haptic.c
+++ b/drivers/input/misc/max8997_haptic.c
@@ -388,8 +388,7 @@ static int max8997_haptic_remove(struct platform_device *pdev)
static int __maybe_unused max8997_haptic_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct max8997_haptic *chip = platform_get_drvdata(pdev);
+ struct max8997_haptic *chip = dev_get_drvdata(dev);
max8997_haptic_disable(chip);
diff --git a/drivers/input/misc/msm-vibrator.c b/drivers/input/misc/msm-vibrator.c
index b60f1aaee705..a28974bfb64e 100644
--- a/drivers/input/misc/msm-vibrator.c
+++ b/drivers/input/misc/msm-vibrator.c
@@ -234,8 +234,7 @@ static int msm_vibrator_probe(struct platform_device *pdev)
static int __maybe_unused msm_vibrator_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct msm_vibrator *vibrator = platform_get_drvdata(pdev);
+ struct msm_vibrator *vibrator = dev_get_drvdata(dev);
cancel_work_sync(&vibrator->worker);
@@ -247,8 +246,7 @@ static int __maybe_unused msm_vibrator_suspend(struct device *dev)
static int __maybe_unused msm_vibrator_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct msm_vibrator *vibrator = platform_get_drvdata(pdev);
+ struct msm_vibrator *vibrator = dev_get_drvdata(dev);
if (vibrator->enabled)
msm_vibrator_start(vibrator);
diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c
index 1e1baed63929..27617868b292 100644
--- a/drivers/input/misc/palmas-pwrbutton.c
+++ b/drivers/input/misc/palmas-pwrbutton.c
@@ -270,8 +270,7 @@ static int palmas_pwron_remove(struct platform_device *pdev)
*/
static int __maybe_unused palmas_pwron_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct palmas_pwron *pwron = platform_get_drvdata(pdev);
+ struct palmas_pwron *pwron = dev_get_drvdata(dev);
cancel_delayed_work_sync(&pwron->input_work);
@@ -291,8 +290,7 @@ static int __maybe_unused palmas_pwron_suspend(struct device *dev)
*/
static int __maybe_unused palmas_pwron_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct palmas_pwron *pwron = platform_get_drvdata(pdev);
+ struct palmas_pwron *pwron = dev_get_drvdata(dev);
if (device_may_wakeup(dev))
disable_irq_wake(pwron->irq);
diff --git a/drivers/input/misc/regulator-haptic.c b/drivers/input/misc/regulator-haptic.c
index a1db1e5040dc..0b78a87f3192 100644
--- a/drivers/input/misc/regulator-haptic.c
+++ b/drivers/input/misc/regulator-haptic.c
@@ -206,8 +206,7 @@ static int regulator_haptic_probe(struct platform_device *pdev)
static int __maybe_unused regulator_haptic_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct regulator_haptic *haptic = platform_get_drvdata(pdev);
+ struct regulator_haptic *haptic = dev_get_drvdata(dev);
int error;
error = mutex_lock_interruptible(&haptic->mutex);
@@ -225,8 +224,7 @@ static int __maybe_unused regulator_haptic_suspend(struct device *dev)
static int __maybe_unused regulator_haptic_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct regulator_haptic *haptic = platform_get_drvdata(pdev);
+ struct regulator_haptic *haptic = dev_get_drvdata(dev);
unsigned int magnitude;
mutex_lock(&haptic->mutex);
diff --git a/drivers/input/misc/stpmic1_onkey.c b/drivers/input/misc/stpmic1_onkey.c
index 7b49c9997df7..ff4761540539 100644
--- a/drivers/input/misc/stpmic1_onkey.c
+++ b/drivers/input/misc/stpmic1_onkey.c
@@ -150,8 +150,7 @@ static int stpmic1_onkey_probe(struct platform_device *pdev)
static int __maybe_unused stpmic1_onkey_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct stpmic1_onkey *onkey = platform_get_drvdata(pdev);
+ struct stpmic1_onkey *onkey = dev_get_drvdata(dev);
if (device_may_wakeup(dev)) {
enable_irq_wake(onkey->irq_falling);
@@ -162,8 +161,7 @@ static int __maybe_unused stpmic1_onkey_suspend(struct device *dev)
static int __maybe_unused stpmic1_onkey_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct stpmic1_onkey *onkey = platform_get_drvdata(pdev);
+ struct stpmic1_onkey *onkey = dev_get_drvdata(dev);
if (device_may_wakeup(dev)) {
disable_irq_wake(onkey->irq_falling);
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
index c37aea9ac272..7b9104c058ca 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -159,8 +159,7 @@ static void twl4030_vibra_close(struct input_dev *input)
/*** Module ***/
static int __maybe_unused twl4030_vibra_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct vibra_info *info = platform_get_drvdata(pdev);
+ struct vibra_info *info = dev_get_drvdata(dev);
if (info->enabled)
vibra_disable(info);
diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c
index 15e0d352c4cc..c8539a4a98c6 100644
--- a/drivers/input/misc/twl6040-vibra.c
+++ b/drivers/input/misc/twl6040-vibra.c
@@ -226,8 +226,7 @@ static void twl6040_vibra_close(struct input_dev *input)
static int __maybe_unused twl6040_vibra_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct vibra_info *info = platform_get_drvdata(pdev);
+ struct vibra_info *info = dev_get_drvdata(dev);
cancel_work_sync(&info->play_work);
--
2.20.1
next prev parent reply other threads:[~2019-04-23 7:41 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-23 7:49 [PATCH next 00/25] cleanup: use dev_get_drvdata() directly Kefeng Wang
2019-04-23 7:49 ` [PATCH next 01/25] ACPI / DPTF: Use dev_get_drvdata() Kefeng Wang
2019-05-01 10:13 ` Rafael J. Wysocki
2019-04-23 7:49 ` [PATCH next 02/25] crypto: picoxcell: " Kefeng Wang
2019-05-03 6:09 ` Herbert Xu
2019-04-23 7:49 ` [PATCH next 03/25] dmaengine: " Kefeng Wang
2019-04-26 11:52 ` Vinod Koul
2019-04-28 4:00 ` [PATCH next v2 1/2] dmaengine: bcm-sba-raid: " Kefeng Wang
2019-04-28 4:00 ` [PATCH next v2 2/2] dmaengine: nbpfaxi: " Kefeng Wang
2019-04-29 5:17 ` [PATCH next v2 1/2] dmaengine: bcm-sba-raid: " Vinod Koul
2019-04-23 7:49 ` [PATCH next 04/25] drm/exynos: " Kefeng Wang
2019-04-23 7:50 ` [PATCH next 05/25] drm/msm: " Kefeng Wang
2019-04-23 7:50 ` [PATCH next 06/25] drm/omap: " Kefeng Wang
2019-05-28 10:57 ` Tomi Valkeinen
2019-04-23 7:50 ` [PATCH next 07/25] hwmon: s3c: " Kefeng Wang
2019-04-23 13:43 ` Guenter Roeck
2019-04-23 7:50 ` [PATCH next 08/25] iio: adc: at91: " Kefeng Wang
2019-04-27 12:07 ` Jonathan Cameron
2019-04-23 7:50 ` [PATCH next 09/25] input: keyboard: " Kefeng Wang
2019-04-23 8:44 ` Dmitry Torokhov
2019-04-23 7:50 ` Kefeng Wang [this message]
2019-04-23 7:50 ` [PATCH next 11/25] input: mouse: " Kefeng Wang
2019-04-23 7:50 ` [PATCH next 12/25] input: touchscreen: " Kefeng Wang
2019-04-23 7:50 ` [PATCH next 13/25] iommu/omap: " Kefeng Wang
2019-04-26 14:49 ` Joerg Roedel
2019-04-23 7:50 ` [PATCH next 14/25] mailbox: bcm-flexrm-mailbox: " Kefeng Wang
2019-04-23 7:50 ` [PATCH next 15/25] media: platform: " Kefeng Wang
2019-05-24 12:58 ` Mauro Carvalho Chehab
2019-04-23 7:50 ` [PATCH next 16/25] mfd: " Kefeng Wang
2019-05-08 10:32 ` Lee Jones
2019-05-08 13:52 ` [PATCH next v2] " Kefeng Wang
2019-05-09 6:14 ` Lee Jones
2019-05-09 14:23 ` [PATCH next v3] " Kefeng Wang
2019-05-10 7:02 ` Lee Jones
2019-04-23 7:50 ` [PATCH next 17/25] mmc: omap_hsmmc: " Kefeng Wang
2019-04-29 10:45 ` Ulf Hansson
2019-04-23 7:50 ` [PATCH next 18/25] net: can: " Kefeng Wang
2019-04-23 7:50 ` [PATCH next 19/25] net: calxedaxgmac: " Kefeng Wang
2019-04-23 7:50 ` [PATCH next 20/25] platform/x86: asus-wmi: " Kefeng Wang
2019-05-06 9:01 ` Andy Shevchenko
2019-04-23 7:50 ` [PATCH next 21/25] rtc: " Kefeng Wang
2019-04-26 18:52 ` Alexandre Belloni
2019-04-23 7:50 ` [PATCH next 22/25] media: staging/imx7: " Kefeng Wang
2019-04-23 8:34 ` Rui Miguel Silva
2019-04-23 7:50 ` [PATCH next 23/25] thermal: " Kefeng Wang
2019-04-29 3:47 ` Zhang Rui
2019-04-29 6:55 ` Kefeng Wang
2019-04-23 7:50 ` [PATCH next 24/25] usb: musb: dsps: " Kefeng Wang
2019-04-23 7:50 ` [PATCH next 25/25] video: fbdev: " Kefeng Wang
2019-05-06 13:48 ` Bartlomiej Zolnierkiewicz
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=20190423075020.173734-11-wangkefeng.wang@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yamada.masahiro@socionext.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).