mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
hwmon: (emc1403) Convert to use OF bindings
Add OF match compatible table to be able to use this driver with Device Trees. Signed-off-by: Jonas Schwöbel <jonasschwoebel@yahoo.de> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Link: https://lore.kernel.org/r/20260731113007.145322-3-clamor95@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
788c49cb94
commit
799bea4b95
|
|
@ -659,14 +659,14 @@ static int emc1403_probe(struct i2c_client *client)
|
|||
{
|
||||
struct thermal_data *data;
|
||||
struct device *hwmon_dev;
|
||||
const struct i2c_device_id *id = i2c_match_id(emc1403_idtable, client);
|
||||
|
||||
data = devm_kzalloc(&client->dev, sizeof(struct thermal_data),
|
||||
GFP_KERNEL);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
data->chip = id->driver_data;
|
||||
data->chip = (uintptr_t)i2c_get_match_data(client);
|
||||
|
||||
data->regmap = devm_regmap_init_i2c(client, &emc1403_regmap_config);
|
||||
if (IS_ERR(data->regmap))
|
||||
return PTR_ERR(data->regmap);
|
||||
|
|
@ -682,10 +682,20 @@ static const unsigned short emc1403_address_list[] = {
|
|||
0x18, 0x1c, 0x29, 0x3c, 0x4c, 0x4d, 0x5c, I2C_CLIENT_END
|
||||
};
|
||||
|
||||
static const struct of_device_id emc1403_of_match[] = {
|
||||
{ .compatible = "smsc,emc1402", .data = (void *)emc1402 },
|
||||
{ .compatible = "smsc,emc1403", .data = (void *)emc1403 },
|
||||
{ .compatible = "smsc,emc1404", .data = (void *)emc1404 },
|
||||
{ .compatible = "smsc,emc1428", .data = (void *)emc1428 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, emc1403_of_match);
|
||||
|
||||
static struct i2c_driver sensor_emc1403 = {
|
||||
.class = I2C_CLASS_HWMON,
|
||||
.driver = {
|
||||
.name = "emc1403",
|
||||
.of_match_table = emc1403_of_match,
|
||||
},
|
||||
.detect = emc1403_detect,
|
||||
.probe = emc1403_probe,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user