diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2016-03-02 19:13:42 +0900 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-03-11 12:59:59 +1000 |
commit | 676a9bde8bd4de5b7b135500e43b5cdb5b9ea230 (patch) | |
tree | 445ab41b294fdc23d3d3c7d65acf4618fdd4cd1d | |
parent | 70fe2748ef32de7857ddc5ecbc60351e683d70e4 (diff) | |
download | nouveau-676a9bde8bd4de5b7b135500e43b5cdb5b9ea230.tar.gz |
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@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drm/nouveau/nouveau_hwmon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drm/nouveau/nouveau_hwmon.c b/drm/nouveau/nouveau_hwmon.c index 3fa1e78e4..67edd2f5b 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); |