From ac751efa6a0d70f2c9daef5c7e3a92270f5c2dff Mon Sep 17 00:00:00 2001 From: Torben Hohn Date: Tue, 25 Jan 2011 15:07:35 -0800 Subject: console: rename acquire/release_console_sem() to console_lock/unlock() The -rt patches change the console_semaphore to console_mutex. As a result, a quite large chunk of the patches changes all acquire/release_console_sem() to acquire/release_console_mutex() This commit makes things use more neutral function names which dont make implications about the underlying lock. The only real change is the return value of console_trylock which is inverted from try_acquire_console_sem() This patch also paves the way to switching console_sem from a semaphore to a mutex. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: make console_trylock return 1 on success, per Geert] Signed-off-by: Torben Hohn Cc: Thomas Gleixner Cc: Greg KH Cc: Ingo Molnar Cc: Geert Uytterhoeven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/aty/aty128fb.c | 12 ++++++------ drivers/video/aty/atyfb_base.c | 10 +++++----- drivers/video/aty/radeon_pm.c | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'drivers/video/aty') diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index dd9de2e80580..4cb6a576c567 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -1860,11 +1860,11 @@ static void aty128_early_resume(void *data) { struct aty128fb_par *par = data; - if (try_acquire_console_sem()) + if (!console_trylock()) return; pci_restore_state(par->pdev); aty128_do_resume(par->pdev); - release_console_sem(); + console_unlock(); } #endif /* CONFIG_PPC_PMAC */ @@ -2438,7 +2438,7 @@ static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state) printk(KERN_DEBUG "aty128fb: suspending...\n"); - acquire_console_sem(); + console_lock(); fb_set_suspend(info, 1); @@ -2470,7 +2470,7 @@ static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state) if (state.event != PM_EVENT_ON) aty128_set_suspend(par, 1); - release_console_sem(); + console_unlock(); pdev->dev.power.power_state = state; @@ -2527,9 +2527,9 @@ static int aty128_pci_resume(struct pci_dev *pdev) { int rc; - acquire_console_sem(); + console_lock(); rc = aty128_do_resume(pdev); - release_console_sem(); + console_unlock(); return rc; } diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 767ab4fb1a05..94e293fce1d2 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -2069,7 +2069,7 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) if (state.event == pdev->dev.power.power_state.event) return 0; - acquire_console_sem(); + console_lock(); fb_set_suspend(info, 1); @@ -2097,14 +2097,14 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) par->lock_blank = 0; atyfb_blank(FB_BLANK_UNBLANK, info); fb_set_suspend(info, 0); - release_console_sem(); + console_unlock(); return -EIO; } #else pci_set_power_state(pdev, pci_choose_state(pdev, state)); #endif - release_console_sem(); + console_unlock(); pdev->dev.power.power_state = state; @@ -2133,7 +2133,7 @@ static int atyfb_pci_resume(struct pci_dev *pdev) if (pdev->dev.power.power_state.event == PM_EVENT_ON) return 0; - acquire_console_sem(); + console_lock(); /* * PCI state will have been restored by the core, so @@ -2161,7 +2161,7 @@ static int atyfb_pci_resume(struct pci_dev *pdev) par->lock_blank = 0; atyfb_blank(FB_BLANK_UNBLANK, info); - release_console_sem(); + console_unlock(); pdev->dev.power.power_state = PMSG_ON; diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index c4e17642d9c5..92bda5848516 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c @@ -2626,7 +2626,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) goto done; } - acquire_console_sem(); + console_lock(); fb_set_suspend(info, 1); @@ -2690,7 +2690,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) if (rinfo->pm_mode & radeon_pm_d2) radeon_set_suspend(rinfo, 1); - release_console_sem(); + console_unlock(); done: pdev->dev.power.power_state = mesg; @@ -2715,10 +2715,10 @@ int radeonfb_pci_resume(struct pci_dev *pdev) return 0; if (rinfo->no_schedule) { - if (try_acquire_console_sem()) + if (!console_trylock()) return 0; } else - acquire_console_sem(); + console_lock(); printk(KERN_DEBUG "radeonfb (%s): resuming from state: %d...\n", pci_name(pdev), pdev->dev.power.power_state.event); @@ -2783,7 +2783,7 @@ int radeonfb_pci_resume(struct pci_dev *pdev) pdev->dev.power.power_state = PMSG_ON; bail: - release_console_sem(); + console_unlock(); return rc; } -- cgit v1.2.3