From nobody Sun May 10 13:29:46 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33348C433EF for ; Tue, 3 May 2022 11:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234835AbiECLr3 (ORCPT ); Tue, 3 May 2022 07:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234783AbiECLr0 (ORCPT ); Tue, 3 May 2022 07:47:26 -0400 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88CBF19028; Tue, 3 May 2022 04:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1651578235; x=1683114235; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ZyYaMPT3VVclWV5fER8SKt1HJ8hGTo2ZrDH3585JNPo=; b=ktxJYlONQ9OiREDch5V/1HXx++AgEunWcbUuoGt6q+6CkepOSFJNtARO u7r3d2/7roNlTDEvbE+YzNW/zcNDzQc4pL70iYQ7fkyi8jrJosFioAacV jIKQ2FV2qaHpZ2/7AcX1gMgkCg8J82XswiZ9xwjMVuBWkALruFeIuM8dc yjN9OlnH9D7lo7IlzSGuw/bVpeyzoiBgolZfzQHHOp4lG/Q3WEKdI7y2l DIwZ/v/ZEeQXkBORNqQ0YQICRa0bgFiRN0GHhf0eaz+UEPB0dZbvMJxG/ jsfgpU/7EU6ipLC2Ljn0Ni/pfeSxMDv3ilrkhkoYDtuGTfJrqpyxZ/M0q w==; From: Camel Guo To: Guenter Roeck , Jean Delvare CC: Camel Guo , Wolfram Sang , Javier Martinez Canillas , , , Subject: [PATCH v4] hwmon: (tmp401) Add OF device ID table Date: Tue, 3 May 2022 13:43:33 +0200 Message-ID: <20220503114333.456476-1-camel.guo@axis.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This driver doesn't have of_match_table. This makes the kernel module tmp401.ko lack alias patterns (e.g: of:N*T*Cti,tmp411) to match DT node of the supported devices hence this kernel module will not be automatically loaded. After adding of_match_table to this driver, the folllowing alias will be added into tmp401.ko. $ modinfo drivers/hwmon/tmp401.ko filename: drivers/hwmon/tmp401.ko ...... author: Hans de Goede alias: of:N*T*Cti,tmp435C* alias: of:N*T*Cti,tmp435 alias: of:N*T*Cti,tmp432C* alias: of:N*T*Cti,tmp432 alias: of:N*T*Cti,tmp431C* alias: of:N*T*Cti,tmp431 alias: of:N*T*Cti,tmp411C* alias: of:N*T*Cti,tmp411 alias: of:N*T*Cti,tmp401C* alias: of:N*T*Cti,tmp401 ...... Fixes: af503716ac14 ("i2c: core: report OF style module alias for devices r= egistered via OF") Signed-off-by: Camel Guo --- Notes: v4: - Rewrite commit message due to improper description in old one v3: - Copy commit message from commit 72fc64c68decf119466 ("hwmon: (tmp103) Add OF device ID table") - Add Fixes tag v2: - Put evidence and circumstances in commit message drivers/hwmon/tmp401.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c index b86d9df7105d..52c9e7d3f2ae 100644 --- a/drivers/hwmon/tmp401.c +++ b/drivers/hwmon/tmp401.c @@ -708,10 +708,21 @@ static int tmp401_probe(struct i2c_client *client) return 0; } =20 +static const struct of_device_id __maybe_unused tmp4xx_of_match[] =3D { + { .compatible =3D "ti,tmp401", }, + { .compatible =3D "ti,tmp411", }, + { .compatible =3D "ti,tmp431", }, + { .compatible =3D "ti,tmp432", }, + { .compatible =3D "ti,tmp435", }, + { }, +}; +MODULE_DEVICE_TABLE(of, tmp4xx_of_match); + static struct i2c_driver tmp401_driver =3D { .class =3D I2C_CLASS_HWMON, .driver =3D { .name =3D "tmp401", + .of_match_table =3D of_match_ptr(tmp4xx_of_match), }, .probe_new =3D tmp401_probe, .id_table =3D tmp401_id, base-commit: 38d741cb70b30741c0e802cbed7bd9cf4fd15fa4 --=20 2.30.2