@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
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> --- Build tested only. buildbot is happy. Please apply individually. drivers/input/misc/max77693-haptic.c | 6 ++---- drivers/input/misc/max8997_haptic.c | 3 +-- drivers/input/misc/palmas-pwrbutton.c | 6 ++---- drivers/input/misc/regulator-haptic.c | 6 ++---- drivers/input/misc/twl4030-vibra.c | 3 +-- drivers/input/misc/twl6040-vibra.c | 3 +-- 6 files changed, 9 insertions(+), 18 deletions(-)