Received: by 10.192.165.156 with SMTP id m28csp775725imm; Thu, 19 Apr 2018 07:23:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+UQjrxJ1UKrdRSjVbdr05y/UGOcjufPsRRPMzordTJvA+XvGDd+TMZV3tODOBbdV09RFqe X-Received: by 10.101.88.68 with SMTP id s4mr5406788pgr.232.1524147809731; Thu, 19 Apr 2018 07:23:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147809; cv=none; d=google.com; s=arc-20160816; b=CAoFaNDBNAtvBmS+RlvUiaMj+cAhM0Lxm2dLsy5ttgrrUf9Pw+F1eEDwXP1C7fGyLS skFybaBUi0kgfCSJiaERD3P3tWb4QUy/iof59Go+PpnUrtqydmNdn++n/kXXcivR8EDe t0JKSgkwK6JvEM5o1D+Rit+oHTMLZ6dMjmzRAgSly8XBKvOplXz2ZXY3NQuKpSY8fkEu YA2J7Kniu1wDB63iLmmgxqHtV5cB23xZQWg0cs8iwH36JhRM7tPCYZr4BUZFsQVTi0xX IkPazptgM+4LOzi9otSqOqP+11FJr7Wi6yWw5NZZBb6LwE6MwvgJCWRWW6CyCl12bfa3 nuJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=uiOlh0tEbUxJUloUfIIwJGuLYzbRiR07mK/I8NBc0BA=; b=uctthUBBr8P4r3+8Arh2Trh7tk1Jekb6Nicq/SZMOjPobSBpMLrOXP9AVGIEEloJQU YDdpoqRpmUT1vrN07Fkv4Ov95YBJCsyK4plM5iShf9Yu9aINJxttMNqYNPjzhH2uiJxD S5osbxsGDboQgR5pHotsPrIH2SbNZFmI3bl3vrNE4g+idNt2Jn7QYI9ItgVFTxk+XbFQ 5kRyoqgqq4WnyLSjsE3Bn2s6qVWPKREFlLPI3ZiBiHg8zsbtdS0q9Q1+UB/W3s/Y7yPs MBYkIDsQ3ssD+1e4kdkeaJOATEEgv18v3c9UecFJRHYFk1TyLDJSEeSp7NLivCdkIGPt BY9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s21si3389487pfi.87.2018.04.19.07.23.15; Thu, 19 Apr 2018 07:23:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753715AbeDSOWB (ORCPT + 99 others); Thu, 19 Apr 2018 10:22:01 -0400 Received: from sauhun.de ([88.99.104.3]:45416 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752116AbeDSOG7 (ORCPT ); Thu, 19 Apr 2018 10:06:59 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 68A8C3139C0; Thu, 19 Apr 2018 16:06:57 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wolfram Sang , Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH 21/61] input: misc: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:05:51 +0200 Message-Id: <20180419140641.27926-22-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- 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(-) 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/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/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/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.11.0