Skip to contentSkip to conversation

drm/nouveau/pm: fix oops on get/set_perflvl

PATCH In review Marcin Slusarz 2 participants 2 messages May 27, 2012 – May 29, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau/pm: fix oops on get/set_perflvl

Regression from "drm/nouveau: very scary looking cleanup commit"

---
 drivers/gpu/drm/nouveau/nouveau_pm.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_pm.c +4 -2
index 9dd34fe..5539482 100644
@@ -306,7 +306,8 @@ nouveau_pm_get_perflvl_info(struct device *d,
 static ssize_t
 nouveau_pm_get_perflvl(struct device *d, struct device_attribute *a, char *buf)
 {
-	struct nouveau_device *ndev = pci_get_drvdata(to_pci_dev(d));
+	struct drm_device *dev = pci_get_drvdata(to_pci_dev(d));
+	struct nouveau_device *ndev = nouveau_device(dev);
 	struct nouveau_pm_engine *pm = &ndev->subsys.pm;
 	struct nouveau_pm_level cur;
 	int len = PAGE_SIZE, ret;
@@ -327,7 +328,8 @@ static ssize_t
 nouveau_pm_set_perflvl(struct device *d, struct device_attribute *a,
 		       const char *buf, size_t count)
 {
-	struct nouveau_device *ndev = pci_get_drvdata(to_pci_dev(d));
+	struct drm_device *dev = pci_get_drvdata(to_pci_dev(d));
+	struct nouveau_device *ndev = nouveau_device(dev);
 	int ret;
 
 	ret = nouveau_pm_profile_set(ndev, buf);
Signature · 1 line
1.7.8.6

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 1 line · Marcin Slusarz

Regression from "drm/nouveau: very scary looking cleanup commit"

Thanks, pushed.

Quoted 33 lines
---
 drivers/gpu/drm/nouveau/nouveau_pm.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_pm.c +4 -2
index 9dd34fe..5539482 100644
@@ -306,7 +306,8 @@ nouveau_pm_get_perflvl_info(struct device *d,
 static ssize_t
 nouveau_pm_get_perflvl(struct device *d, struct device_attribute *a, char *buf)
 {
-	struct nouveau_device *ndev = pci_get_drvdata(to_pci_dev(d));
+	struct drm_device *dev = pci_get_drvdata(to_pci_dev(d));
+	struct nouveau_device *ndev = nouveau_device(dev);
 	struct nouveau_pm_engine *pm = &ndev->subsys.pm;
 	struct nouveau_pm_level cur;
 	int len = PAGE_SIZE, ret;
@@ -327,7 +328,8 @@ static ssize_t
 nouveau_pm_set_perflvl(struct device *d, struct device_attribute *a,
 		       const char *buf, size_t count)
 {
-	struct nouveau_device *ndev = pci_get_drvdata(to_pci_dev(d));
+	struct drm_device *dev = pci_get_drvdata(to_pci_dev(d));
+	struct nouveau_device *ndev = nouveau_device(dev);
 	int ret;
 
 	ret = nouveau_pm_profile_set(ndev, buf);
Signature · 1 line
1.7.8.6