mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
drm/nouveau/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>
This commit is contained in:
parent
f2a0adadeb
commit
f2014cd02c
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue