From patchwork Tue Apr 23 07:50:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 10912065 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6CB331575 for ; Tue, 23 Apr 2019 07:41:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B5FE287FB for ; Tue, 23 Apr 2019 07:41:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F0462880C; Tue, 23 Apr 2019 07:41:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33919287FB for ; Tue, 23 Apr 2019 07:41:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726669AbfDWHkW (ORCPT ); Tue, 23 Apr 2019 03:40:22 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7219 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726618AbfDWHkW (ORCPT ); Tue, 23 Apr 2019 03:40:22 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 491264B0F67463D345DA; Tue, 23 Apr 2019 15:40:17 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Apr 2019 15:40:07 +0800 From: Kefeng Wang To: CC: Masahiro Yamada , Kefeng Wang , Dmitry Torokhov , Subject: [PATCH next 09/25] input: keyboard: Use dev_get_drvdata() Date: Tue, 23 Apr 2019 15:50:04 +0800 Message-ID: <20190423075020.173734-10-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190423075020.173734-1-wangkefeng.wang@huawei.com> References: <20190423075020.173734-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_get_drvdata directly. Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Signed-off-by: Kefeng Wang --- drivers/input/keyboard/ep93xx_keypad.c | 10 ++++------ drivers/input/keyboard/gpio_keys.c | 6 ++---- drivers/input/keyboard/imx_keypad.c | 10 ++++------ drivers/input/keyboard/lpc32xx-keys.c | 6 ++---- drivers/input/keyboard/matrix_keypad.c | 10 ++++------ drivers/input/keyboard/omap4-keypad.c | 10 ++++------ drivers/input/keyboard/pmic8xxx-keypad.c | 6 ++---- drivers/input/keyboard/pxa27x_keypad.c | 10 ++++------ drivers/input/keyboard/samsung-keypad.c | 12 ++++-------- drivers/input/keyboard/snvs_pwrkey.c | 10 ++++------ drivers/input/keyboard/spear-keyboard.c | 10 ++++------ drivers/input/keyboard/st-keyscan.c | 6 ++---- drivers/input/keyboard/tegra-kbc.c | 10 ++++------ 13 files changed, 44 insertions(+), 72 deletions(-) diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index f77b295e0123..7584a03db4b3 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -185,8 +185,7 @@ static void ep93xx_keypad_close(struct input_dev *pdev) #ifdef CONFIG_PM_SLEEP static int ep93xx_keypad_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); + struct ep93xx_keypad *keypad = dev_get_drvdata(dev); struct input_dev *input_dev = keypad->input_dev; mutex_lock(&input_dev->mutex); @@ -198,7 +197,7 @@ static int ep93xx_keypad_suspend(struct device *dev) mutex_unlock(&input_dev->mutex); - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(dev)) enable_irq_wake(keypad->irq); return 0; @@ -206,11 +205,10 @@ static int ep93xx_keypad_suspend(struct device *dev) static int ep93xx_keypad_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); + struct ep93xx_keypad *keypad = dev_get_drvdata(dev); struct input_dev *input_dev = keypad->input_dev; - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(dev)) disable_irq_wake(keypad->irq); mutex_lock(&input_dev->mutex); diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 6cd199e8a370..0b4cc4834b2f 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -293,8 +293,7 @@ static ssize_t gpio_keys_show_##name(struct device *dev, \ struct device_attribute *attr, \ char *buf) \ { \ - struct platform_device *pdev = to_platform_device(dev); \ - struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev); \ + struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); \ \ return gpio_keys_attr_show_helper(ddata, buf, \ type, only_disabled); \ @@ -320,8 +319,7 @@ static ssize_t gpio_keys_store_##name(struct device *dev, \ const char *buf, \ size_t count) \ { \ - struct platform_device *pdev = to_platform_device(dev); \ - struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev); \ + struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); \ ssize_t error; \ \ error = gpio_keys_attr_store_helper(ddata, buf, type); \ diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index 539cb670de41..cb6daca57646 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -528,8 +528,7 @@ static int imx_keypad_probe(struct platform_device *pdev) static int __maybe_unused imx_kbd_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct imx_keypad *kbd = platform_get_drvdata(pdev); + struct imx_keypad *kbd = dev_get_drvdata(dev); struct input_dev *input_dev = kbd->input_dev; /* imx kbd can wake up system even clock is disabled */ @@ -540,7 +539,7 @@ static int __maybe_unused imx_kbd_suspend(struct device *dev) mutex_unlock(&input_dev->mutex); - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(dev)) enable_irq_wake(kbd->irq); return 0; @@ -548,12 +547,11 @@ static int __maybe_unused imx_kbd_suspend(struct device *dev) static int __maybe_unused imx_kbd_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct imx_keypad *kbd = platform_get_drvdata(pdev); + struct imx_keypad *kbd = dev_get_drvdata(dev); struct input_dev *input_dev = kbd->input_dev; int ret = 0; - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(dev)) disable_irq_wake(kbd->irq); mutex_lock(&input_dev->mutex); diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c index 1dd57ac0e7a2..0831a6f2a9d4 100644 --- a/drivers/input/keyboard/lpc32xx-keys.c +++ b/drivers/input/keyboard/lpc32xx-keys.c @@ -279,8 +279,7 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int lpc32xx_kscan_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct lpc32xx_kscan_drv *kscandat = platform_get_drvdata(pdev); + struct lpc32xx_kscan_drv *kscandat = dev_get_drvdata(dev); struct input_dev *input = kscandat->input; mutex_lock(&input->mutex); @@ -297,8 +296,7 @@ static int lpc32xx_kscan_suspend(struct device *dev) static int lpc32xx_kscan_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct lpc32xx_kscan_drv *kscandat = platform_get_drvdata(pdev); + struct lpc32xx_kscan_drv *kscandat = dev_get_drvdata(dev); struct input_dev *input = kscandat->input; int retval = 0; diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 3d1cb7bf5e35..a3477328d02b 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -276,12 +276,11 @@ static void matrix_keypad_disable_wakeup(struct matrix_keypad *keypad) static int matrix_keypad_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct matrix_keypad *keypad = platform_get_drvdata(pdev); + struct matrix_keypad *keypad = dev_get_drvdata(dev); matrix_keypad_stop(keypad->input_dev); - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(dev)) matrix_keypad_enable_wakeup(keypad); return 0; @@ -289,10 +288,9 @@ static int matrix_keypad_suspend(struct device *dev) static int matrix_keypad_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct matrix_keypad *keypad = platform_get_drvdata(pdev); + struct matrix_keypad *keypad = dev_get_drvdata(dev); - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(dev)) matrix_keypad_disable_wakeup(keypad); matrix_keypad_start(keypad->input_dev); diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 840e53732753..8c73a18daf8b 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -425,11 +425,10 @@ MODULE_DEVICE_TABLE(of, omap_keypad_dt_match); #ifdef CONFIG_PM_SLEEP static int omap4_keypad_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct omap4_keypad *keypad_data = platform_get_drvdata(pdev); + struct omap4_keypad *keypad_data = dev_get_drvdata(dev); int error; - if (device_may_wakeup(&pdev->dev)) { + if (device_may_wakeup(dev)) { error = enable_irq_wake(keypad_data->irq); if (!error) keypad_data->irq_wake_enabled = true; @@ -440,10 +439,9 @@ static int omap4_keypad_suspend(struct device *dev) static int omap4_keypad_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct omap4_keypad *keypad_data = platform_get_drvdata(pdev); + struct omap4_keypad *keypad_data = dev_get_drvdata(dev); - if (device_may_wakeup(&pdev->dev) && keypad_data->irq_wake_enabled) { + if (device_may_wakeup(dev) && keypad_data->irq_wake_enabled) { disable_irq_wake(keypad_data->irq); keypad_data->irq_wake_enabled = false; } diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c index 98b24ed18752..048a39321298 100644 --- a/drivers/input/keyboard/pmic8xxx-keypad.c +++ b/drivers/input/keyboard/pmic8xxx-keypad.c @@ -636,8 +636,7 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int pmic8xxx_kp_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct pmic8xxx_kp *kp = platform_get_drvdata(pdev); + struct pmic8xxx_kp *kp = dev_get_drvdata(dev); struct input_dev *input_dev = kp->input; if (device_may_wakeup(dev)) { @@ -656,8 +655,7 @@ static int pmic8xxx_kp_suspend(struct device *dev) static int pmic8xxx_kp_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct pmic8xxx_kp *kp = platform_get_drvdata(pdev); + struct pmic8xxx_kp *kp = dev_get_drvdata(dev); struct input_dev *input_dev = kp->input; if (device_may_wakeup(dev)) { diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index d0bdaeadf86d..1f54a3162124 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -666,14 +666,13 @@ static void pxa27x_keypad_close(struct input_dev *dev) #ifdef CONFIG_PM_SLEEP static int pxa27x_keypad_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); + struct pxa27x_keypad *keypad = dev_get_drvdata(dev); /* * If the keypad is used a wake up source, clock can not be disabled. * Or it can not detect the key pressing. */ - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(dev)) enable_irq_wake(keypad->irq); else clk_disable_unprepare(keypad->clk); @@ -683,8 +682,7 @@ static int pxa27x_keypad_suspend(struct device *dev) static int pxa27x_keypad_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); + struct pxa27x_keypad *keypad = dev_get_drvdata(dev); struct input_dev *input_dev = keypad->input_dev; int ret = 0; @@ -692,7 +690,7 @@ static int pxa27x_keypad_resume(struct device *dev) * If the keypad is used as wake up source, the clock is not turned * off. So do not need configure it again. */ - if (device_may_wakeup(&pdev->dev)) { + if (device_may_wakeup(dev)) { disable_irq_wake(keypad->irq); } else { mutex_lock(&input_dev->mutex); diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c index 1fe1aa2adf85..aadca4261b24 100644 --- a/drivers/input/keyboard/samsung-keypad.c +++ b/drivers/input/keyboard/samsung-keypad.c @@ -466,8 +466,7 @@ static int samsung_keypad_remove(struct platform_device *pdev) #ifdef CONFIG_PM static int samsung_keypad_runtime_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct samsung_keypad *keypad = platform_get_drvdata(pdev); + struct samsung_keypad *keypad = dev_get_drvdata(dev); unsigned int val; int error; @@ -490,8 +489,7 @@ static int samsung_keypad_runtime_suspend(struct device *dev) static int samsung_keypad_runtime_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct samsung_keypad *keypad = platform_get_drvdata(pdev); + struct samsung_keypad *keypad = dev_get_drvdata(dev); unsigned int val; if (keypad->stopped) @@ -535,8 +533,7 @@ static void samsung_keypad_toggle_wakeup(struct samsung_keypad *keypad, static int samsung_keypad_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct samsung_keypad *keypad = platform_get_drvdata(pdev); + struct samsung_keypad *keypad = dev_get_drvdata(dev); struct input_dev *input_dev = keypad->input_dev; mutex_lock(&input_dev->mutex); @@ -553,8 +550,7 @@ static int samsung_keypad_suspend(struct device *dev) static int samsung_keypad_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct samsung_keypad *keypad = platform_get_drvdata(pdev); + struct samsung_keypad *keypad = dev_get_drvdata(dev); struct input_dev *input_dev = keypad->input_dev; mutex_lock(&input_dev->mutex); diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c index 4c67cf30a5d9..ba40dc3025ce 100644 --- a/drivers/input/keyboard/snvs_pwrkey.c +++ b/drivers/input/keyboard/snvs_pwrkey.c @@ -173,10 +173,9 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev) static int __maybe_unused imx_snvs_pwrkey_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct pwrkey_drv_data *pdata = platform_get_drvdata(pdev); + struct pwrkey_drv_data *pdata = dev_get_drvdata(dev); - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(dev)) enable_irq_wake(pdata->irq); return 0; @@ -184,10 +183,9 @@ static int __maybe_unused imx_snvs_pwrkey_suspend(struct device *dev) static int __maybe_unused imx_snvs_pwrkey_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct pwrkey_drv_data *pdata = platform_get_drvdata(pdev); + struct pwrkey_drv_data *pdata = dev_get_drvdata(dev); - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(dev)) disable_irq_wake(pdata->irq); return 0; diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index 7d25fa338ab4..a0276a3376d2 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -288,8 +288,7 @@ static int spear_kbd_remove(struct platform_device *pdev) static int __maybe_unused spear_kbd_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct spear_kbd *kbd = platform_get_drvdata(pdev); + struct spear_kbd *kbd = dev_get_drvdata(dev); struct input_dev *input_dev = kbd->input; unsigned int rate = 0, mode_ctl_reg, val; @@ -300,7 +299,7 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev) mode_ctl_reg = readl_relaxed(kbd->io_base + MODE_CTL_REG); - if (device_may_wakeup(&pdev->dev)) { + if (device_may_wakeup(dev)) { if (!enable_irq_wake(kbd->irq)) kbd->irq_wake_enabled = true; @@ -341,13 +340,12 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev) static int __maybe_unused spear_kbd_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct spear_kbd *kbd = platform_get_drvdata(pdev); + struct spear_kbd *kbd = dev_get_drvdata(dev); struct input_dev *input_dev = kbd->input; mutex_lock(&input_dev->mutex); - if (device_may_wakeup(&pdev->dev)) { + if (device_may_wakeup(dev)) { if (kbd->irq_wake_enabled) { kbd->irq_wake_enabled = false; disable_irq_wake(kbd->irq); diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c index 3b85631fde91..454481651ace 100644 --- a/drivers/input/keyboard/st-keyscan.c +++ b/drivers/input/keyboard/st-keyscan.c @@ -218,8 +218,7 @@ static int keyscan_probe(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int keyscan_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct st_keyscan *keypad = platform_get_drvdata(pdev); + struct st_keyscan *keypad = dev_get_drvdata(dev); struct input_dev *input = keypad->input_dev; mutex_lock(&input->mutex); @@ -235,8 +234,7 @@ static int keyscan_suspend(struct device *dev) static int keyscan_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct st_keyscan *keypad = platform_get_drvdata(pdev); + struct st_keyscan *keypad = dev_get_drvdata(dev); struct input_dev *input = keypad->input_dev; int retval = 0; diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 875205f445b5..861bfcbd817d 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -744,11 +744,10 @@ static void tegra_kbc_set_keypress_interrupt(struct tegra_kbc *kbc, bool enable) static int tegra_kbc_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct tegra_kbc *kbc = platform_get_drvdata(pdev); + struct tegra_kbc *kbc = dev_get_drvdata(dev); mutex_lock(&kbc->idev->mutex); - if (device_may_wakeup(&pdev->dev)) { + if (device_may_wakeup(dev)) { disable_irq(kbc->irq); del_timer_sync(&kbc->timer); tegra_kbc_set_fifo_interrupt(kbc, false); @@ -781,12 +780,11 @@ static int tegra_kbc_suspend(struct device *dev) static int tegra_kbc_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct tegra_kbc *kbc = platform_get_drvdata(pdev); + struct tegra_kbc *kbc = dev_get_drvdata(dev); int err = 0; mutex_lock(&kbc->idev->mutex); - if (device_may_wakeup(&pdev->dev)) { + if (device_may_wakeup(dev)) { disable_irq_wake(kbc->irq); tegra_kbc_setup_wakekeys(kbc, false); /* We will use fifo interrupts for key detection. */ From patchwork Tue Apr 23 07:50:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 10912067 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E2471575 for ; Tue, 23 Apr 2019 07:42:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CA6328806 for ; Tue, 23 Apr 2019 07:42:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40D97287FB; Tue, 23 Apr 2019 07:42:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C13728806 for ; Tue, 23 Apr 2019 07:42:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726604AbfDWHlz (ORCPT ); Tue, 23 Apr 2019 03:41:55 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7218 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726622AbfDWHkW (ORCPT ); Tue, 23 Apr 2019 03:40:22 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4347DE551F2CC7D83ACC; Tue, 23 Apr 2019 15:40:17 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Apr 2019 15:40:07 +0800 From: Kefeng Wang To: CC: Masahiro Yamada , Kefeng Wang , Dmitry Torokhov , Subject: [PATCH next 10/25] input: misc: Use dev_get_drvdata() Date: Tue, 23 Apr 2019 15:50:05 +0800 Message-ID: <20190423075020.173734-11-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190423075020.173734-1-wangkefeng.wang@huawei.com> References: <20190423075020.173734-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_get_drvdata directly. Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Signed-off-by: Kefeng Wang --- 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); From patchwork Tue Apr 23 07:50:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 10912069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C4851575 for ; Tue, 23 Apr 2019 07:42:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C747287FB for ; Tue, 23 Apr 2019 07:42:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 210632880C; Tue, 23 Apr 2019 07:42:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B86CE287FB for ; Tue, 23 Apr 2019 07:42:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726416AbfDWHmL (ORCPT ); Tue, 23 Apr 2019 03:42:11 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7216 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726378AbfDWHkV (ORCPT ); Tue, 23 Apr 2019 03:40:21 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 39F63720BF1FCC7CC467; Tue, 23 Apr 2019 15:40:17 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Apr 2019 15:40:08 +0800 From: Kefeng Wang To: CC: Masahiro Yamada , Kefeng Wang , Dmitry Torokhov , Subject: [PATCH next 11/25] input: mouse: Use dev_get_drvdata() Date: Tue, 23 Apr 2019 15:50:06 +0800 Message-ID: <20190423075020.173734-12-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190423075020.173734-1-wangkefeng.wang@huawei.com> References: <20190423075020.173734-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_get_drvdata directly. Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Signed-off-by: Kefeng Wang --- drivers/input/mouse/navpoint.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/mouse/navpoint.c b/drivers/input/mouse/navpoint.c index d6e8f58a1de3..3d83a79e14d9 100644 --- a/drivers/input/mouse/navpoint.c +++ b/drivers/input/mouse/navpoint.c @@ -320,8 +320,7 @@ static int navpoint_remove(struct platform_device *pdev) static int __maybe_unused navpoint_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct navpoint *navpoint = platform_get_drvdata(pdev); + struct navpoint *navpoint = dev_get_drvdata(dev); struct input_dev *input = navpoint->input; mutex_lock(&input->mutex); @@ -334,8 +333,7 @@ static int __maybe_unused navpoint_suspend(struct device *dev) static int __maybe_unused navpoint_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct navpoint *navpoint = platform_get_drvdata(pdev); + struct navpoint *navpoint = dev_get_drvdata(dev); struct input_dev *input = navpoint->input; mutex_lock(&input->mutex); From patchwork Tue Apr 23 07:50:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 10912051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 891DD1575 for ; Tue, 23 Apr 2019 07:41:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77F34287FB for ; Tue, 23 Apr 2019 07:41:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C3952880A; Tue, 23 Apr 2019 07:41:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16516287FB for ; Tue, 23 Apr 2019 07:41:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725946AbfDWHlN (ORCPT ); Tue, 23 Apr 2019 03:41:13 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7223 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726710AbfDWHkZ (ORCPT ); Tue, 23 Apr 2019 03:40:25 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5CAE77D9C69E216994C9; Tue, 23 Apr 2019 15:40:17 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Apr 2019 15:40:09 +0800 From: Kefeng Wang To: CC: Masahiro Yamada , Kefeng Wang , Dmitry Torokhov , Shawn Guo , Sascha Hauer , Subject: [PATCH next 12/25] input: touchscreen: Use dev_get_drvdata() Date: Tue, 23 Apr 2019 15:50:07 +0800 Message-ID: <20190423075020.173734-13-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190423075020.173734-1-wangkefeng.wang@huawei.com> References: <20190423075020.173734-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Using dev_get_drvdata directly. Cc: Dmitry Torokhov Cc: Shawn Guo Cc: Sascha Hauer Cc: linux-input@vger.kernel.org Signed-off-by: Kefeng Wang --- drivers/input/touchscreen/imx6ul_tsc.c | 6 ++---- drivers/input/touchscreen/s3c2410_ts.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c index c10fc594f94d..493322ed0e34 100644 --- a/drivers/input/touchscreen/imx6ul_tsc.c +++ b/drivers/input/touchscreen/imx6ul_tsc.c @@ -511,8 +511,7 @@ static int imx6ul_tsc_probe(struct platform_device *pdev) static int __maybe_unused imx6ul_tsc_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct imx6ul_tsc *tsc = platform_get_drvdata(pdev); + struct imx6ul_tsc *tsc = dev_get_drvdata(dev); struct input_dev *input_dev = tsc->input; mutex_lock(&input_dev->mutex); @@ -531,8 +530,7 @@ static int __maybe_unused imx6ul_tsc_suspend(struct device *dev) static int __maybe_unused imx6ul_tsc_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct imx6ul_tsc *tsc = platform_get_drvdata(pdev); + struct imx6ul_tsc *tsc = dev_get_drvdata(dev); struct input_dev *input_dev = tsc->input; int retval = 0; diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c index 1173890f6719..e5e9f6527ed8 100644 --- a/drivers/input/touchscreen/s3c2410_ts.c +++ b/drivers/input/touchscreen/s3c2410_ts.c @@ -396,8 +396,7 @@ static int s3c2410ts_suspend(struct device *dev) static int s3c2410ts_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct s3c2410_ts_mach_info *info = dev_get_platdata(&pdev->dev); + struct s3c2410_ts_mach_info *info = dev_get_platdata(dev); clk_enable(ts.clock); enable_irq(ts.irq_tc);