Patch "hwmon: (tmp401) Add OF device ID table" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    hwmon: (tmp401) Add OF device ID table

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hwmon-tmp401-add-of-device-id-table.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b99a5937dc17f1e0580c82bba1db83caca9ef325
Author: Camel Guo <camel.guo@xxxxxxxx>
Date:   Tue May 3 13:43:33 2022 +0200

    hwmon: (tmp401) Add OF device ID table
    
    [ Upstream commit 3481551f035725fdc46885425eac3ef9b58ae7b7 ]
    
    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 <hdegoede@xxxxxxxxxx>
    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 registered via OF")
    Signed-off-by: Camel Guo <camel.guo@xxxxxxxx>
    Link: https://lore.kernel.org/r/20220503114333.456476-1-camel.guo@xxxxxxxx
    Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index 1f2d13dc9439..99b0d7e0a27a 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -756,10 +756,21 @@ static int tmp401_probe(struct i2c_client *client,
 	return 0;
 }
 
+static const struct of_device_id __maybe_unused tmp4xx_of_match[] = {
+	{ .compatible = "ti,tmp401", },
+	{ .compatible = "ti,tmp411", },
+	{ .compatible = "ti,tmp431", },
+	{ .compatible = "ti,tmp432", },
+	{ .compatible = "ti,tmp435", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, tmp4xx_of_match);
+
 static struct i2c_driver tmp401_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "tmp401",
+		.of_match_table = of_match_ptr(tmp4xx_of_match),
 	},
 	.probe		= tmp401_probe,
 	.id_table	= tmp401_id,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux