From patchwork Sun Dec 27 09:25:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7923061 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ED920BEEE5 for ; Sun, 27 Dec 2015 09:26:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F336320253 for ; Sun, 27 Dec 2015 09:26:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFAA32024D for ; Sun, 27 Dec 2015 09:26:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751413AbbL0J0n (ORCPT ); Sun, 27 Dec 2015 04:26:43 -0500 Received: from m50-132.163.com ([123.125.50.132]:41969 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750843AbbL0J0j (ORCPT ); Sun, 27 Dec 2015 04:26:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=GuhVqbjkwxzAYXOvAD sskAlb39gdqzg4JfULLxu3qJw=; b=RjgTFdanxTUCdiMWl9rwgL0+xI1YsVuYcF /2NuaSoEDVbtMpey/HuAvJYSBJvQ2XA60ud837pet5Hz7grYcTUePWZ3fHnHOJhk vdMFgdpfr1r49bonLKOgCTp97ctQkDtn0fsOooWH1H5tJZzR6I2gXUoUeqT6r7aZ dU+2eifpw= Received: from localhost (unknown [116.77.145.148]) by smtp2 (Coremail) with SMTP id DNGowECJOkiHrn9W_a8LAA--.4082S3; Sun, 27 Dec 2015 17:25:28 +0800 (CST) From: Geliang Tang To: Jiri Kosina , Benjamin Tissoires Cc: Geliang Tang , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] HID: move to_hid_device() to hid.h Date: Sun, 27 Dec 2015 17:25:20 +0800 Message-Id: <3490fef13d9af010ff2da07012eed189c46ee3fa.1451206516.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 X-CM-TRANSID: DNGowECJOkiHrn9W_a8LAA--.4082S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7ZF17tFyUCr1rCry3Xr1xAFb_yoW8Ww4kpF 4DGa92krWUGr47Gw1DGw1rCa43J3WkCa4I9ry2k34ruFyayF90qrnxta4qyrnYqFWktrW3 GFsxJr4UGa409w7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UonQUUUUUU= X-Originating-IP: [116.77.145.148] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiMAndmVWBTXxRBAAAsN Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP to_hid_device() macro is defined in both hid-lg4ff.c and hid-logitech-hidpp.c. So I move it to include/linux/hid.h. Signed-off-by: Geliang Tang --- drivers/hid/hid-lg4ff.c | 2 -- drivers/hid/hid-logitech-hidpp.c | 2 -- include/linux/hid.h | 3 +++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index fbddcb3..3e160ff 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c @@ -33,8 +33,6 @@ #include "hid-lg4ff.h" #include "hid-ids.h" -#define to_hid_device(pdev) container_of(pdev, struct hid_device, dev) - #define LG4FF_MMODE_IS_MULTIMODE 0 #define LG4FF_MMODE_SWITCHED 1 #define LG4FF_MMODE_NOT_MULTIMODE 2 diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index f2a4811..bd2ab476 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -1310,8 +1310,6 @@ struct g920_private_data { u16 range; }; -#define to_hid_device(pdev) container_of(pdev, struct hid_device, dev) - static ssize_t g920_range_show(struct device *dev, struct device_attribute *attr, char *buf) { diff --git a/include/linux/hid.h b/include/linux/hid.h index a6d7a3f..1472026 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -565,6 +565,9 @@ struct hid_device { /* device report descriptor */ wait_queue_head_t debug_wait; }; +#define to_hid_device(pdev) \ + container_of(pdev, struct hid_device, dev) + static inline void *hid_get_drvdata(struct hid_device *hdev) { return dev_get_drvdata(&hdev->dev);