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);