Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp678198ybh; Wed, 15 Jul 2020 12:14:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+LEsJ2WmlNGUcLWFRl7APR05vg7Kv6fJ7hhRW91tX2r+72NFx41ggWbTfnbkZ06uQ4OLM X-Received: by 2002:aa7:da58:: with SMTP id w24mr1075484eds.385.1594840460108; Wed, 15 Jul 2020 12:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594840460; cv=none; d=google.com; s=arc-20160816; b=kMyBmm7pQgJxPgnKv6y+RL0AMAHvqiSnlFmQqeBcT1n0V/4CHe5GUSzj1TZhFHkgKD srOZjFU40IMqeaGhXa4iqkPB6L/J67Kis+qwhmfA0fj0lMW10sTasZ129p5JTzOES6Qi aWz1xcSSxl7onxks8DX4zr5yeOEeGmpWQ8sIlzcWimEfZw7ePQaYK/3XzLwbHqfHoubV scb/qu/LxmWIOOzLGFGv5qTC/lE1XjchiwUlLOrRRR/QRuHIsKGxMKwS2qHMM6hmapGK 6yGVuoPGFp3GoL7J/SdncPxMlNFGNF4f8cPMBkab0lLd7zEJ9Y2g65zrhZXiRwP6qLvx AJTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=PaxwIMqYv9u4hvMLy3xXelbM1pxwRR3PAXvG2moSk0c=; b=e3eDyYK2ruKh5+SE+wqy2Lb+h/WR+XY9utDzueGOi7YxXKvO1LZg3P8JE5ROw34dWL 2XoKT641cPHvhm8rblAo6GPoWLZDfmeXRQNJlQTazVwD/yRSrvZODEyumZqsl75tP40a XyftoVMk0R9HTa4lCZeY0BYBl6YPRhEhoKWxkkLdaHTy64iDs1C5WqyvMovuP33dNvpc fmOA7GlYzQaD7hkTUIff7mk3W1uqAqmOhDd3hfSmHniiAmALHsomJVXf5A7GdNRsy/9v oaRmKo1spTw2l9dta6QXm6ZdMRPQIANFN7MsM85MfdntGGSTxsVqN6a3SVubWz85syMx SRig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id op5si1734140ejb.617.2020.07.15.12.13.56; Wed, 15 Jul 2020 12:14:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726398AbgGOTNq (ORCPT + 99 others); Wed, 15 Jul 2020 15:13:46 -0400 Received: from ms-10.1blu.de ([178.254.4.101]:44324 "EHLO ms-10.1blu.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbgGOTNM (ORCPT ); Wed, 15 Jul 2020 15:13:12 -0400 Received: from [78.43.71.214] (helo=marius.localnet) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvmps-0005GQ-BN; Wed, 15 Jul 2020 21:12:56 +0200 From: Marius Zachmann To: Guenter Roeck Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] hwmon: corsair-cpro: Change to HID driver Date: Wed, 15 Jul 2020 21:12:55 +0200 Message-ID: <51449356.7lugSRDzgr@marius> In-Reply-To: References: <20200715151419.43134-1-mail@mariuszachmann.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Con-Id: 241080 X-Con-U: 0-mail X-Originating-IP: 78.43.71.214 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15.07.20 at 17:35:08 CEST, Guenter Roeck wrote > On 7/15/20 8:14 AM, Marius Zachmann wrote: > > This changes corsair-cpro to a hid driver using hid reports. > > > > Signed-off-by: Marius Zachmann > > > > --- > ... > > -module_usb_driver(ccp_driver); > > +static int __init ccp_init(void) > > +{ > > + return hid_register_driver(&ccp_driver); > > +} > > + > > +static void __exit ccp_exit(void) > > +{ > > + hid_unregister_driver(&ccp_driver); > > +} > > + > > +/* make sure it is loaded after hid */ > > +late_initcall(ccp_init); > > +module_exit(ccp_exit); > > Sorry for not noticing before, but can you use module_hid_driver() ? > That seems to work for other hid drivers. > > Thanks, > Guenter > When using module_hid_driver() and compiling the driver as built-in the driver init function will get called before hid and fail registering the driver. late_initcall forces it to be loaded after hid. Greetings, Marius