From patchwork Fri Aug 23 03:06:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2848528 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 849BEBF546 for ; Fri, 23 Aug 2013 03:06:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8063720189 for ; Fri, 23 Aug 2013 03:06:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60DB8200D7 for ; Fri, 23 Aug 2013 03:06:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752964Ab3HWDGU (ORCPT ); Thu, 22 Aug 2013 23:06:20 -0400 Received: from mail-bk0-f43.google.com ([209.85.214.43]:47807 "EHLO mail-bk0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752312Ab3HWDGU (ORCPT ); Thu, 22 Aug 2013 23:06:20 -0400 Received: by mail-bk0-f43.google.com with SMTP id mz13so33707bkb.16 for ; Thu, 22 Aug 2013 20:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=V39xlT7v0ld2fY08Zd3QA6WiqJTPnnS5M/I6d0OSKHo=; b=NEFxu70WjY5ZitLeY/mPxqstKQ18rdNEiHt26d8PGoM0vJckMr7BfOdfWiP5dsal1k eHjeKsRXOIxQ1NaKriCSnlTd/1oMEDTHp2tLV990gdyZQ2qc6sjVygr7UBMzV8V91OVu dVuX1YHvbHwAjH0jQANWyYueiNDWDTy6QZgWyxzCE5xGCqcN0txdur5772sLwwlVpO8q bAA2LSWcRuS4XfvLhb5JPtGL1P7JNv0FntEr3yGHDx4qQEzY5jt5lJmMfUDWhUprqW6J 2Xbl3zCnwwAkBMBWvF0puAKkLYjn/7AJiT0lFZ/ftLytfzrIJA/SQUUNSkHmCxK9aAUe 6SJg== MIME-Version: 1.0 X-Received: by 10.204.225.12 with SMTP id iq12mr12938271bkb.4.1377227179165; Thu, 22 Aug 2013 20:06:19 -0700 (PDT) Received: by 10.205.13.74 with HTTP; Thu, 22 Aug 2013 20:06:19 -0700 (PDT) Date: Fri, 23 Aug 2013 11:06:19 +0800 Message-ID: Subject: [PATCH -next] HID: use module_hid_driver() to simplify the code From: Wei Yongjun To: jkosina@suse.cz Cc: yongjun_wei@trendmicro.com.cn, linux-input@vger.kernel.org Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, 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 From: Wei Yongjun module_hid_driver() makes the code simpler by eliminating boilerplate code. Signed-off-by: Wei Yongjun --- drivers/hid/hid-xinmo.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/hid/hid-xinmo.c b/drivers/hid/hid-xinmo.c index 6153e50..7df5227 100644 --- a/drivers/hid/hid-xinmo.c +++ b/drivers/hid/hid-xinmo.c @@ -57,16 +57,5 @@ static struct hid_driver xinmo_driver = { .event = xinmo_event }; -static int __init xinmo_init(void) -{ - return hid_register_driver(&xinmo_driver); -} - -static void __exit xinmo_exit(void) -{ - hid_unregister_driver(&xinmo_driver); -} - -module_init(xinmo_init); -module_exit(xinmo_exit); +module_hid_driver(xinmo_driver); MODULE_LICENSE("GPL");