Comment 1 for bug 1452473

Revision history for this message
Chris J Arges (arges) wrote :

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?