[-mm PATCH] driver model: PM type checking in drivers/video
From: Daniel Drake
Date: Fri Feb 04 2005 - 17:55:15 EST
This fixes PM driver model type checking for drivers/video.
Acked by Pavel Machek.
Signed-off-by: Daniel Drake <dsd@xxxxxxxxxx>
diff -urNpX dontdiff linux-2.6.11-rc2-mm2/drivers/video/aty/radeon_pm.c linux-dsd/drivers/video/aty/radeon_pm.c
--- linux-2.6.11-rc2-mm2/drivers/video/aty/radeon_pm.c 2005-02-02 21:55:28.000000000 +0000
+++ linux-dsd/drivers/video/aty/radeon_pm.c 2005-02-02 21:58:53.000000000 +0000
@@ -2596,7 +2596,7 @@ int radeonfb_pci_resume(struct pci_dev *
struct radeonfb_info *rinfo = info->par;
int rc = 0;
- if (pdev->dev.power.power_state == 0)
+ if (pdev->dev.power.power_state == PMSG_ON)
return 0;
if (rinfo->no_schedule) {
diff -urNpX dontdiff linux-2.6.11-rc2-mm2/drivers/video/backlight/corgi_bl.c linux-dsd/drivers/video/backlight/corgi_bl.c
--- linux-2.6.11-rc2-mm2/drivers/video/backlight/corgi_bl.c 2005-02-02 21:55:28.000000000 +0000
+++ linux-dsd/drivers/video/backlight/corgi_bl.c 2005-02-02 20:08:15.000000000 +0000
@@ -81,7 +81,7 @@ static void corgibl_blank(int blank)
}
#ifdef CONFIG_PM
-static int corgibl_suspend(struct device *dev, u32 state, u32 level)
+static int corgibl_suspend(struct device *dev, pm_message_t state, u32 level)
{
if (level == SUSPEND_POWER_DOWN)
corgibl_blank(FB_BLANK_POWERDOWN);
diff -urNpX dontdiff linux-2.6.11-rc2-mm2/drivers/video/i810/i810_main.c linux-dsd/drivers/video/i810/i810_main.c
--- linux-2.6.11-rc2-mm2/drivers/video/i810/i810_main.c 2005-02-02 21:55:28.000000000 +0000
+++ linux-dsd/drivers/video/i810/i810_main.c 2005-02-02 20:13:21.000000000 +0000
@@ -1492,7 +1492,7 @@ static struct fb_ops i810fb_ops __devini
/***********************************************************************
* Power Management *
***********************************************************************/
-static int i810fb_suspend(struct pci_dev *dev, u32 state)
+static int i810fb_suspend(struct pci_dev *dev, pm_message_t state)
{
struct fb_info *info = pci_get_drvdata(dev);
struct i810fb_par *par = (struct i810fb_par *) info->par;
@@ -1538,7 +1538,7 @@ static int i810fb_resume(struct pci_dev
return 0;
pci_restore_state(dev);
- pci_set_power_state(dev, 0);
+ pci_set_power_state(dev, PCI_D0);
pci_enable_device(dev);
agp_bind_memory(par->i810_gtt.i810_fb_memory,
par->fb.offset);
diff -urNpX dontdiff linux-2.6.11-rc2-mm2/drivers/video/pxafb.c linux-dsd/drivers/video/pxafb.c
--- linux-2.6.11-rc2-mm2/drivers/video/pxafb.c 2005-02-02 21:54:21.000000000 +0000
+++ linux-dsd/drivers/video/pxafb.c 2005-02-02 20:01:56.000000000 +0000
@@ -942,7 +942,7 @@ pxafb_freq_policy(struct notifier_block
* Power management hooks. Note that we won't be called from IRQ context,
* unlike the blank functions above, so we may sleep.
*/
-static int pxafb_suspend(struct device *dev, u32 state, u32 level)
+static int pxafb_suspend(struct device *dev, pm_message_t state, u32 level)
{
struct pxafb_info *fbi = dev_get_drvdata(dev);
diff -urNpX dontdiff linux-2.6.11-rc2-mm2/drivers/video/sa1100fb.c linux-dsd/drivers/video/sa1100fb.c
--- linux-2.6.11-rc2-mm2/drivers/video/sa1100fb.c 2005-02-02 21:54:21.000000000 +0000
+++ linux-dsd/drivers/video/sa1100fb.c 2005-02-02 20:02:48.000000000 +0000
@@ -1307,7 +1307,7 @@ sa1100fb_freq_policy(struct notifier_blo
* Power management hooks. Note that we won't be called from IRQ context,
* unlike the blank functions above, so we may sleep.
*/
-static int sa1100fb_suspend(struct device *dev, u32 state, u32 level)
+static int sa1100fb_suspend(struct device *dev, pm_message_t state, u32 level)
{
struct sa1100fb_info *fbi = dev_get_drvdata(dev);
diff -urNpX dontdiff linux-2.6.11-rc2-mm2/drivers/video/savage/savagefb.c linux-dsd/drivers/video/savage/savagefb.c
--- linux-2.6.11-rc2-mm2/drivers/video/savage/savagefb.c 2004-12-24 21:34:45.000000000 +0000
+++ linux-dsd/drivers/video/savage/savagefb.c 2005-02-02 20:14:38.000000000 +0000
@@ -2100,7 +2100,7 @@ static void __devexit savagefb_remove (s
}
}
-static int savagefb_suspend (struct pci_dev* dev, u32 state)
+static int savagefb_suspend (struct pci_dev* dev, pm_message_t state)
{
struct fb_info *info =
(struct fb_info *)pci_get_drvdata(dev);
@@ -2115,7 +2115,7 @@ static int savagefb_suspend (struct pci_
release_console_sem();
pci_disable_device(dev);
- pci_set_power_state(dev, state);
+ pci_set_power_state(dev, pci_choose_state(dev, state));
return 0;
}
@@ -2128,7 +2128,7 @@ static int savagefb_resume (struct pci_d
DBG("savage_resume");
- pci_set_power_state(dev, 0);
+ pci_set_power_state(dev, PCI_D0);
pci_restore_state(dev);
if(pci_enable_device(dev))
DBG("err");
diff -urNpX dontdiff linux-2.6.11-rc2-mm2/drivers/video/w100fb.c linux-dsd/drivers/video/w100fb.c
--- linux-2.6.11-rc2-mm2/drivers/video/w100fb.c 2005-02-02 21:54:21.000000000 +0000
+++ linux-dsd/drivers/video/w100fb.c 2005-02-02 20:04:16.000000000 +0000
@@ -535,7 +535,7 @@ static void w100fb_clear_buffer(void)
#ifdef CONFIG_PM
-static int w100fb_suspend(struct device *dev, u32 state, u32 level)
+static int w100fb_suspend(struct device *dev, pm_message_t state, u32 level)
{
if (level == SUSPEND_POWER_DOWN) {
struct fb_info *info = dev_get_drvdata(dev);