Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2326100rdb; Fri, 8 Dec 2023 05:12:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFR8lzJ4zj9aV2tF/6UoZZJDmTyrItuBniMZX/6WFvpoVJfCE07BmKwfgez5rHtuxAkRJZ3 X-Received: by 2002:a17:90a:6e41:b0:285:c1c0:ffb4 with SMTP id s1-20020a17090a6e4100b00285c1c0ffb4mr31474pjm.37.1702041120716; Fri, 08 Dec 2023 05:12:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702041120; cv=none; d=google.com; s=arc-20160816; b=hbxOst++Llmoi/L81kRuBia/yzCh6H5ON3xskpQm8WQNTlqP6PdGwCBmhETHzYZAsL hAqoT37SpR67bhWbYlWBRHMRO2tUcLG7eJhsXyChtg3iUt27NNsQ6VgtZuOWoVORHIEf YSE1B7WM2sw77Uyhq24QXYFOJWBDpAqT/HBPkynridu4TKgx8YUNVk8ssRqVpJyh1G5B Ph+OflSdKxMtqDWVjX42pgdBlwEBpz1cdIZsJOnuSeX5l23CMHKaQjTShgyvqFePQI0O FYE8q6i26mE/W4k0MpA3euF3fqH9geGFVqBjH2JF46rbUBA9NLvwbU3K53kHBNnDXRUO iIZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:to:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=QQN7wOqaADX2FECQYklXLB5Tqg9UqwVc4LsoIF89I/E=; fh=j3EBFxq+dSjart8dIetvQxT1wUkh+1crM5Lk0mTdtcU=; b=lmcf7ki0i+yRQ2lI2vki3Ja81Jpf4y+bxlyTfGT+luh9NF9KID8S6AEkQkL+zRZTJN xNA5j8Ab2PMPwE90pgzBfH9TzDJ8aowD5n38om5szpf+eDZY7HY6aIjz82YWKLPCBfQh rddIV7ecPV0+kau1vM5oDyNqEyG46zltbcH23zy0q1ZyrXDeB4DIKbmgqFsh6OUUXoLc cfRRW1HyhHxnzEJ51SfdTvbSOyt75gPOGVvBhl4yeNAduwzjF4/hn8tqZxbR26EHr3rC L4h2sXsQjwuv3/1pDClUuBn489qFZa0pQzq3RAB/WjTi5IuyFkuF47I55RSZeX+Z/xrK RhOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LFWVJKee; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id a9-20020a17090a854900b00286a2b05cb6si2911048pjw.145.2023.12.08.05.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 05:12:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LFWVJKee; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 118C58725CEC; Fri, 8 Dec 2023 05:11:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232504AbjLHNLn (ORCPT + 99 others); Fri, 8 Dec 2023 08:11:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233428AbjLHNLm (ORCPT ); Fri, 8 Dec 2023 08:11:42 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3ACB1989; Fri, 8 Dec 2023 05:11:48 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c9eca5bbaeso24922511fa.3; Fri, 08 Dec 2023 05:11:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702041106; x=1702645906; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QQN7wOqaADX2FECQYklXLB5Tqg9UqwVc4LsoIF89I/E=; b=LFWVJKeevgHEz8Tf37Ouf5M9Qr9yYZvbUycsffJeXyyjCwJ2fN3t1z7BfFbzHauXP2 9o4ITcFndrFWoSMcFkl4cRPjXLQohveOB2gWMMog5tWGZ+7Q0kEHwoNiOybFyAsAq/Ks auv+q2IKP4CsfMT6cegsaZnzlbq9+qJaVBAiMtZwJnyViaHVXHqGq4UYrw96nAn19ww2 le2IJBm8YkjNYGisDNTe7dkSId8/2pimKmCBru8gdZVQYH8aM6Z2PQvouMJyv18O5UH0 UzoW0x7UgeQVC8et6946uVp/qSqKH0ITSf99JZOQUqtxpnXmpGHyH/BNHdrLajGi4yIA J8oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702041106; x=1702645906; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QQN7wOqaADX2FECQYklXLB5Tqg9UqwVc4LsoIF89I/E=; b=VVlX7N9BY/XQKLjMzOJOU/+b5Jyj8I+jlsPv3dUSoCmvoY67dFsyev2gj9yol1akT4 A0XvQxCKZghjJpdEw00iPawuPj/0AgExtv+Lu1E8tI9Fxxp3/IKQm92FKN9bQVQY15yD Cd/TnTlFCKOgnHDSO5U1pZ327WEAB0X2D5wescgjwzSFii1BAZYftjLziT5T3xuSJ1+J R4S9b3ayNNhyYwnqLNc/UlKBMHH/7JsZGzsJCsvNHTQO+Lk+swvv2jI27bFC3slgnvGc drWxwLIPg00jvW9q0Ckok2yG27wVv8+CQ+9rRBSMtKlqUSwShWh19b3Jq02qwio2luJW GFfA== X-Gm-Message-State: AOJu0YyYoTb/FAoftyB0L5m6Mn+OYvsOFtdycpmG8PvzFW0Js+m81Eas cxTdVSTx4p/RsoYMpRVW9SXC02CosvVwHg== X-Received: by 2002:a2e:9887:0:b0:2c9:fa05:6c02 with SMTP id b7-20020a2e9887000000b002c9fa056c02mr1192925ljj.171.1702041106220; Fri, 08 Dec 2023 05:11:46 -0800 (PST) Received: from [192.168.0.28] (cable-178-148-234-71.dynamic.sbb.rs. [178.148.234.71]) by smtp.gmail.com with ESMTPSA id sk13-20020a170906630d00b00a1d232b39b3sm990819ejc.145.2023.12.08.05.11.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Dec 2023 05:11:45 -0800 (PST) Message-ID: Date: Fri, 8 Dec 2023 14:11:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: savicaleksa83@gmail.com, Wilken Gottwalt , Jean Delvare , Guenter Roeck , linux-kernel@vger.kernel.org Subject: Re: [PATCH] hwmon: (corsair-psu) Fix failure to load when built-in to kernel To: linux-hwmon@vger.kernel.org References: <20231208130710.191420-1-savicaleksa83@gmail.com> Content-Language: en-US From: Aleksa Savic In-Reply-To: <20231208130710.191420-1-savicaleksa83@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 08 Dec 2023 05:11:58 -0800 (PST) On 2023-12-08 14:07:10 GMT+01:00, Aleksa Savic wrote: > When built-in to the kernel, the corsair-psu driver fails to register with > the following message: > > "Driver 'corsair-psu' was unable to register with bus_type 'hid' > because the bus was not initialized." > > Fix this by initializing the driver after the HID bus using > late_initcall(), as hwmon is built before HID. > > Fixes: d115b51e0e56 ("hwmon: add Corsair PSU HID controller driver") > Signed-off-by: Aleksa Savic > --- > drivers/hwmon/corsair-psu.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/hwmon/corsair-psu.c b/drivers/hwmon/corsair-psu.c > index 904890598c11..48831a528965 100644 > --- a/drivers/hwmon/corsair-psu.c > +++ b/drivers/hwmon/corsair-psu.c > @@ -899,7 +899,20 @@ static struct hid_driver corsairpsu_driver = { > .reset_resume = corsairpsu_resume, > #endif > }; > -module_hid_driver(corsairpsu_driver); > + > +static int __init corsairpsu_hid_init(void) > +{ > + return hid_register_driver(&corsairpsu_driver); > +} > + > +static void __exit corsairpsu_hid_exit(void) > +{ > + hid_unregister_driver(&corsairpsu_driver); > +} > + > +/* When compiled into the kernel, initialize after the hid bus */ > +late_initcall(corsairpsu_hid_init); > +module_exit(corsairpsu_hid_exit); > > MODULE_LICENSE("GPL"); > MODULE_AUTHOR("Wilken Gottwalt "); Woops! Just saw that the same fix was sent yesterday. Please disregard, sorry! Aleksa