This also exists upstream.
Looks like the modalias that gets generated is: $ cat /lib/modules/`uname -r`/modules.alias | grep ibmpowernv alias platform:opal-sensor ibmpowernv
Where OF creates this for the device: $ cat /sys/devices/platform/opal-sensor/modalias of:NsensorsT<NULL>
If I make the module use the OF string it still doesn't seem to work. Patch below:
diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c index 4255514..c872818 100644 --- a/drivers/hwmon/ibmpowernv.c +++ b/drivers/hwmon/ibmpowernv.c @@ -466,19 +466,17 @@ static int ibmpowernv_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(hwmon_dev); }
-static const struct platform_device_id opal_sensor_driver_ids[] = { - { - .name = "opal-sensor", - }, - { } +static const struct of_device_id opal_sensor_match[] = { + { .compatible = "sensors",}, + {}, }; -MODULE_DEVICE_TABLE(platform, opal_sensor_driver_ids); +MODULE_DEVICE_TABLE(of, opal_sensor_match);
static struct platform_driver ibmpowernv_driver = { .probe = ibmpowernv_probe, - .id_table = opal_sensor_driver_ids, .driver = { .name = DRVNAME, + .of_match_table = opal_sensor_match, }, };
Any suggestions?
This also exists upstream.
Looks like the modalias that gets generated is: opal-sensor ibmpowernv
$ cat /lib/modules/`uname -r`/modules.alias | grep ibmpowernv
alias platform:
Where OF creates this for the device: platform/ opal-sensor/ modalias
$ cat /sys/devices/
of:NsensorsT<NULL>
If I make the module use the OF string it still doesn't seem to work. Patch below:
diff --git a/drivers/ hwmon/ibmpowern v.c b/drivers/ hwmon/ibmpowern v.c hwmon/ibmpowern v.c hwmon/ibmpowern v.c probe(struct platform_device *pdev) OR_ZERO( hwmon_dev) ;
index 4255514..c872818 100644
--- a/drivers/
+++ b/drivers/
@@ -466,19 +466,17 @@ static int ibmpowernv_
return PTR_ERR_
}
-static const struct platform_device_id opal_sensor_ driver_ ids[] = { DEVICE_ TABLE(platform, opal_sensor_ driver_ ids); DEVICE_ TABLE(of, opal_sensor_match);
- {
- .name = "opal-sensor",
- },
- { }
+static const struct of_device_id opal_sensor_match[] = {
+ { .compatible = "sensors",},
+ {},
};
-MODULE_
+MODULE_
static struct platform_driver ibmpowernv_driver = { driver_ ids,
.name = DRVNAME,
.probe = ibmpowernv_probe,
- .id_table = opal_sensor_
.driver = {
+ .of_match_table = opal_sensor_match,
},
};
Any suggestions?