Alexandre Courbot
2016-Mar-02 10:13 UTC
[Nouveau] [PATCH] hwmon: fix crash on non-PCI platforms
Registration of the hwmon device will fail on non-PCI systems since
dev->pdev is NULL in that case. Use the more generic drm_device::dev
member that points to the same and is always set no matter the platform.
Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
---
drm/nouveau/nouveau_hwmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drm/nouveau/nouveau_hwmon.c b/drm/nouveau/nouveau_hwmon.c
index 3fa1e78e4ece..67edd2f5b71a 100644
--- a/drm/nouveau/nouveau_hwmon.c
+++ b/drm/nouveau/nouveau_hwmon.c
@@ -640,7 +640,7 @@ nouveau_hwmon_init(struct drm_device *dev)
return -ENOMEM;
hwmon->dev = dev;
- hwmon_dev = hwmon_device_register(&dev->pdev->dev);
+ hwmon_dev = hwmon_device_register(dev->dev);
if (IS_ERR(hwmon_dev)) {
ret = PTR_ERR(hwmon_dev);
NV_ERROR(drm, "Unable to register hwmon device: %d\n", ret);
--
2.7.2
Reasonably Related Threads
- [PATCH v4 5/6] hwmon: don't require therm to be valid to get any data
- [PATCH v4 4/6] hwmon: add power consumption
- [PATCH v5 3/5] nouveau_hwmon: Remove old code, add .write/.read operations
- [PATCH 2/4] nouveau_hwmon: migrate to hwmon_device_register_with_info
- [PATCH v2 4/5] nouveau_hwmon: Add support for auto_point attributes
