From patchwork Sun Jun 18 10:14:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9794773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2599D600C5 for ; Sun, 18 Jun 2017 10:14:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E67528453 for ; Sun, 18 Jun 2017 10:14:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 021B42848F; Sun, 18 Jun 2017 10:14:55 +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=-6.9 required=2.0 tests=BAYES_00,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 A950C28453 for ; Sun, 18 Jun 2017 10:14:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751059AbdFRKOy (ORCPT ); Sun, 18 Jun 2017 06:14:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42854 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751009AbdFRKOy (ORCPT ); Sun, 18 Jun 2017 06:14:54 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD52C61D05; Sun, 18 Jun 2017 10:14:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AD52C61D05 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=hdegoede@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AD52C61D05 Received: from shalem.localdomain.com (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9145880682; Sun, 18 Jun 2017 10:14:52 +0000 (UTC) From: Hans de Goede To: Jiri Kosina , Benjamin Tissoires Cc: Hans de Goede , Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH 1/2] HID: i2c-hid: Expand module_i2c_driver macro Date: Sun, 18 Jun 2017 12:14:47 +0200 Message-Id: <20170618101448.17734-2-hdegoede@redhat.com> In-Reply-To: <20170618101448.17734-1-hdegoede@redhat.com> References: <20170618101448.17734-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 18 Jun 2017 10:14:53 +0000 (UTC) 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 This is a preparation patch for not registering the driver on some machines where just trying to probe a non HID compliant device causes issues. Signed-off-by: Hans de Goede --- drivers/hid/i2c-hid/i2c-hid.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index fb55fb4c39fc..54b53d8f96ce 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -1276,7 +1276,17 @@ static struct i2c_driver i2c_hid_driver = { .id_table = i2c_hid_id_table, }; -module_i2c_driver(i2c_hid_driver); +static int __init i2c_hid_init(void) +{ + return i2c_add_driver(&i2c_hid_driver); +} +module_init(i2c_hid_init); + +static void __exit i2c_hid_exit(void) +{ + i2c_del_driver(&i2c_hid_driver); +} +module_exit(i2c_hid_exit); MODULE_DESCRIPTION("HID over I2C core driver"); MODULE_AUTHOR("Benjamin Tissoires ");