diff options
author | Torben Hohn | 2011-01-25 15:07:35 -0800 |
---|---|---|
committer | Linus Torvalds | 2011-01-26 10:50:06 +1000 |
commit | ac751efa6a0d70f2c9daef5c7e3a92270f5c2dff (patch) | |
tree | e2d3f799e20e2cbca80891ea17af7484f21d628f /drivers/video | |
parent | 3689456b4bd36027022b3215eb2acba51cd0e6b5 (diff) |
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 <torbenh@gmx.de>
Cc: Thomas Gleixner <tglx@tglx.de>
Cc: Greg KH <gregkh@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/arkfb.c | 12 | ||||
-rw-r--r-- | drivers/video/aty/aty128fb.c | 12 | ||||
-rw-r--r-- | drivers/video/aty/atyfb_base.c | 10 | ||||
-rw-r--r-- | drivers/video/aty/radeon_pm.c | 10 | ||||
-rw-r--r-- | drivers/video/chipsfb.c | 8 | ||||
-rw-r--r-- | drivers/video/console/fbcon.c | 42 | ||||
-rw-r--r-- | drivers/video/da8xx-fb.c | 8 | ||||
-rw-r--r-- | drivers/video/fbmem.c | 12 | ||||
-rw-r--r-- | drivers/video/fbsysfs.c | 20 | ||||
-rw-r--r-- | drivers/video/geode/gxfb_core.c | 8 | ||||
-rw-r--r-- | drivers/video/geode/lxfb_core.c | 8 | ||||
-rw-r--r-- | drivers/video/i810/i810_main.c | 8 | ||||
-rw-r--r-- | drivers/video/jz4740_fb.c | 8 | ||||
-rw-r--r-- | drivers/video/mx3fb.c | 8 | ||||
-rw-r--r-- | drivers/video/nvidia/nvidia.c | 8 | ||||
-rw-r--r-- | drivers/video/ps3fb.c | 16 | ||||
-rw-r--r-- | drivers/video/s3fb.c | 16 | ||||
-rw-r--r-- | drivers/video/savage/savagefb_driver.c | 8 | ||||
-rw-r--r-- | drivers/video/sh_mobile_hdmi.c | 8 | ||||
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 4 | ||||
-rw-r--r-- | drivers/video/sm501fb.c | 8 | ||||
-rw-r--r-- | drivers/video/tmiofb.c | 10 | ||||
-rw-r--r-- | drivers/video/via/viafbdev.c | 8 | ||||
-rw-r--r-- | drivers/video/vt8623fb.c | 12 | ||||
-rw-r--r-- | drivers/video/xen-fbfront.c | 4 |
25 files changed, 138 insertions, 138 deletions
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c index d583bea608fd..391ac939f011 100644 --- a/drivers/video/arkfb.c +++ b/drivers/video/arkfb.c @@ -23,7 +23,7 @@ #include <linux/svga.h> #include <linux/init.h> #include <linux/pci.h> -#include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_sem() */ +#include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */ #include <video/vga.h> #ifdef CONFIG_MTRR @@ -1091,12 +1091,12 @@ static int ark_pci_suspend (struct pci_dev* dev, pm_message_t state) dev_info(info->device, "suspend\n"); - acquire_console_sem(); + console_lock(); mutex_lock(&(par->open_lock)); if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) { mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); return 0; } @@ -1107,7 +1107,7 @@ static int ark_pci_suspend (struct pci_dev* dev, pm_message_t state) pci_set_power_state(dev, pci_choose_state(dev, state)); mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); return 0; } @@ -1122,7 +1122,7 @@ static int ark_pci_resume (struct pci_dev* dev) dev_info(info->device, "resume\n"); - acquire_console_sem(); + console_lock(); mutex_lock(&(par->open_lock)); if (par->ref_count == 0) @@ -1141,7 +1141,7 @@ static int ark_pci_resume (struct pci_dev* dev) fail: mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); return 0; } #else 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; } diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c index d637e1f53172..cff742abdc5d 100644 --- a/drivers/video/chipsfb.c +++ b/drivers/video/chipsfb.c @@ -460,10 +460,10 @@ static int chipsfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) if (!(state.event & PM_EVENT_SLEEP)) goto done; - acquire_console_sem(); + console_lock(); chipsfb_blank(1, p); fb_set_suspend(p, 1); - release_console_sem(); + console_unlock(); done: pdev->dev.power.power_state = state; return 0; @@ -473,10 +473,10 @@ static int chipsfb_pci_resume(struct pci_dev *pdev) { struct fb_info *p = pci_get_drvdata(pdev); - acquire_console_sem(); + console_lock(); fb_set_suspend(p, 0); chipsfb_blank(0, p); - release_console_sem(); + console_unlock(); pdev->dev.power.power_state = PMSG_ON; return 0; diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 7ccc967831f0..9c092b8d64e6 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -375,14 +375,14 @@ static void fb_flashcursor(struct work_struct *work) int c; int mode; - acquire_console_sem(); + console_lock(); if (ops && ops->currcon != -1) vc = vc_cons[ops->currcon].d; if (!vc || !CON_IS_VISIBLE(vc) || registered_fb[con2fb_map[vc->vc_num]] != info || vc->vc_deccm != 1) { - release_console_sem(); + console_unlock(); return; } @@ -392,7 +392,7 @@ static void fb_flashcursor(struct work_struct *work) CM_ERASE : CM_DRAW; ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1), get_color(vc, info, c, 0)); - release_console_sem(); + console_unlock(); } static void cursor_timer_handler(unsigned long dev_addr) @@ -836,7 +836,7 @@ static int set_con2fb_map(int unit, int newidx, int user) found = search_fb_in_map(newidx); - acquire_console_sem(); + console_lock(); con2fb_map[unit] = newidx; if (!err && !found) err = con2fb_acquire_newinfo(vc, info, unit, oldidx); @@ -863,7 +863,7 @@ static int set_con2fb_map(int unit, int newidx, int user) if (!search_fb_in_map(info_idx)) info_idx = newidx; - release_console_sem(); + console_unlock(); return err; } @@ -3321,7 +3321,7 @@ static ssize_t store_rotate(struct device *device, if (fbcon_has_exited) return count; - acquire_console_sem(); + console_lock(); idx = con2fb_map[fg_console]; if (idx == -1 || registered_fb[idx] == NULL) @@ -3331,7 +3331,7 @@ static ssize_t store_rotate(struct device *device, rotate = simple_strtoul(buf, last, 0); fbcon_rotate(info, rotate); err: - release_console_sem(); + console_unlock(); return count; } @@ -3346,7 +3346,7 @@ static ssize_t store_rotate_all(struct device *device, if (fbcon_has_exited) return count; - acquire_console_sem(); + console_lock(); idx = con2fb_map[fg_console]; if (idx == -1 || registered_fb[idx] == NULL) @@ -3356,7 +3356,7 @@ static ssize_t store_rotate_all(struct device *device, rotate = simple_strtoul(buf, last, 0); fbcon_rotate_all(info, rotate); err: - release_console_sem(); + console_unlock(); return count; } @@ -3369,7 +3369,7 @@ static ssize_t show_rotate(struct device *device, if (fbcon_has_exited) return 0; - acquire_console_sem(); + console_lock(); idx = con2fb_map[fg_console]; if (idx == -1 || registered_fb[idx] == NULL) @@ -3378,7 +3378,7 @@ static ssize_t show_rotate(struct device *device, info = registered_fb[idx]; rotate = fbcon_get_rotate(info); err: - release_console_sem(); + console_unlock(); return snprintf(buf, PAGE_SIZE, "%d\n", rotate); } @@ -3392,7 +3392,7 @@ static ssize_t show_cursor_blink(struct device *device, if (fbcon_has_exited) return 0; - acquire_console_sem(); + console_lock(); idx = con2fb_map[fg_console]; if (idx == -1 || registered_fb[idx] == NULL) @@ -3406,7 +3406,7 @@ static ssize_t show_cursor_blink(struct device *device, blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0; err: - release_console_sem(); + console_unlock(); return snprintf(buf, PAGE_SIZE, "%d\n", blink); } @@ -3421,7 +3421,7 @@ static ssize_t store_cursor_blink(struct device *device, if (fbcon_has_exited) return count; - acquire_console_sem(); + console_lock(); idx = con2fb_map[fg_console]; if (idx == -1 || registered_fb[idx] == NULL) @@ -3443,7 +3443,7 @@ static ssize_t store_cursor_blink(struct device *device, } err: - release_console_sem(); + console_unlock(); return count; } @@ -3482,7 +3482,7 @@ static void fbcon_start(void) if (num_registered_fb) { int i; - acquire_console_sem(); + console_lock(); for (i = 0; i < FB_MAX; i++) { if (registered_fb[i] != NULL) { @@ -3491,7 +3491,7 @@ static void fbcon_start(void) } } - release_console_sem(); + console_unlock(); fbcon_takeover(0); } } @@ -3552,7 +3552,7 @@ static int __init fb_console_init(void) { int i; - acquire_console_sem(); + console_lock(); fb_register_client(&fbcon_event_notifier); fbcon_device = device_create(fb_class, NULL, MKDEV(0, 0), NULL, "fbcon"); @@ -3568,7 +3568,7 @@ static int __init fb_console_init(void) for (i = 0; i < MAX_NR_CONSOLES; i++) con2fb_map[i] = -1; - release_console_sem(); + console_unlock(); fbcon_start(); return 0; } @@ -3591,12 +3591,12 @@ static void __exit fbcon_deinit_device(void) static void __exit fb_console_exit(void) { - acquire_console_sem(); + console_lock(); fb_unregister_client(&fbcon_event_notifier); fbcon_deinit_device(); device_destroy(fb_class, MKDEV(0, 0)); fbcon_exit(); - release_console_sem(); + console_unlock(); unregister_con_driver(&fb_con); } diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 520047ac6e3e..8d61ef96eedd 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -1131,14 +1131,14 @@ static int fb_suspend(struct platform_device *dev, pm_message_t state) struct fb_info *info = platform_get_drvdata(dev); struct da8xx_fb_par *par = info->par; - acquire_console_sem(); + console_lock(); if (par->panel_power_ctrl) par->panel_power_ctrl(0); fb_set_suspend(info, 1); lcd_disable_raster(); clk_disable(par->lcdc_clk); - release_console_sem(); + console_unlock(); return 0; } @@ -1147,14 +1147,14 @@ static int fb_resume(struct platform_device *dev) struct fb_info *info = platform_get_drvdata(dev); struct da8xx_fb_par *par = info->par; - acquire_console_sem(); + console_lock(); if (par->panel_power_ctrl) par->panel_power_ctrl(1); clk_enable(par->lcdc_clk); lcd_enable_raster(); fb_set_suspend(info, 0); - release_console_sem(); + console_unlock(); return 0; } diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 4ac1201ad6c2..e2bf95370e40 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -1036,11 +1036,11 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, return -EFAULT; if (!lock_fb_info(info)) return -ENODEV; - acquire_console_sem(); + console_lock(); info->flags |= FBINFO_MISC_USEREVENT; ret = fb_set_var(info, &var); info->flags &= ~FBINFO_MISC_USEREVENT; - release_console_sem(); + console_unlock(); unlock_fb_info(info); if (!ret && copy_to_user(argp, &var, sizeof(var))) ret = -EFAULT; @@ -1072,9 +1072,9 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, return -EFAULT; if (!lock_fb_info(info)) return -ENODEV; - acquire_console_sem(); + console_lock(); ret = fb_pan_display(info, &var); - release_console_sem(); + console_unlock(); unlock_fb_info(info); if (ret == 0 && copy_to_user(argp, &var, sizeof(var))) return -EFAULT; @@ -1119,11 +1119,11 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, case FBIOBLANK: if (!lock_fb_info(info)) return -ENODEV; - acquire_console_sem(); + console_lock(); info->flags |= FBINFO_MISC_USEREVENT; ret = fb_blank(info, arg); info->flags &= ~FBINFO_MISC_USEREVENT; - release_console_sem(); + console_unlock(); unlock_fb_info(info); break; default: diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c index 0a08f1341227..f4a32779168b 100644 --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c @@ -90,11 +90,11 @@ static int activate(struct fb_info *fb_info, struct fb_var_screeninfo *var) int err; var->activate |= FB_ACTIVATE_FORCE; - acquire_console_sem(); + console_lock(); fb_info->flags |= FBINFO_MISC_USEREVENT; err = fb_set_var(fb_info, var); fb_info->flags &= ~FBINFO_MISC_USEREVENT; - release_console_sem(); + console_unlock(); if (err) return err; return 0; @@ -175,7 +175,7 @@ static ssize_t store_modes(struct device *device, if (i * sizeof(struct fb_videomode) != count) return -EINVAL; - acquire_console_sem(); + console_lock(); list_splice(&fb_info->modelist, &old_list); fb_videomode_to_modelist((const struct fb_videomode *)buf, i, &fb_info->modelist); @@ -185,7 +185,7 @@ static ssize_t store_modes(struct device *device, } else fb_destroy_modelist(&old_list); - release_console_sem(); + console_unlock(); return 0; } @@ -301,11 +301,11 @@ static ssize_t store_blank(struct device *device, char *last = NULL; int err; - acquire_console_sem(); + console_lock(); fb_info->flags |= FBINFO_MISC_USEREVENT; err = fb_blank(fb_info, simple_strtoul(buf, &last, 0)); fb_info->flags &= ~FBINFO_MISC_USEREVENT; - release_console_sem(); + console_unlock(); if (err < 0) return err; return count; @@ -364,9 +364,9 @@ static ssize_t store_pan(struct device *device, return -EINVAL; var.yoffset = simple_strtoul(last, &last, 0); - acquire_console_sem(); + console_lock(); err = fb_pan_display(fb_info, &var); - release_console_sem(); + console_unlock(); if (err < 0) return err; @@ -399,9 +399,9 @@ static ssize_t store_fbstate(struct device *device, state = simple_strtoul(buf, &last, 0); - acquire_console_sem(); + console_lock(); fb_set_suspend(fb_info, (int)state); - release_console_sem(); + console_unlock(); return count; } diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c index 70b1d9d51c96..b4f19db9bb54 100644 --- a/drivers/video/geode/gxfb_core.c +++ b/drivers/video/geode/gxfb_core.c @@ -344,10 +344,10 @@ static int gxfb_suspend(struct pci_dev *pdev, pm_message_t state) struct fb_info *info = pci_get_drvdata(pdev); if (state.event == PM_EVENT_SUSPEND) { - acquire_console_sem(); + console_lock(); gx_powerdown(info); fb_set_suspend(info, 1); - release_console_sem(); + console_unlock(); } /* there's no point in setting PCI states; we emulate PCI, so @@ -361,7 +361,7 @@ static int gxfb_resume(struct pci_dev *pdev) struct fb_info *info = pci_get_drvdata(pdev); int ret; - acquire_console_sem(); + console_lock(); ret = gx_powerup(info); if (ret) { printk(KERN_ERR "gxfb: power up failed!\n"); @@ -369,7 +369,7 @@ static int gxfb_resume(struct pci_dev *pdev) } fb_set_suspend(info, 0); - release_console_sem(); + console_unlock(); return 0; } #endif diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c index 39bdbedf43b4..416851ca8754 100644 --- a/drivers/video/geode/lxfb_core.c +++ b/drivers/video/geode/lxfb_core.c @@ -465,10 +465,10 @@ static int lxfb_suspend(struct pci_dev *pdev, pm_message_t state) struct fb_info *info = pci_get_drvdata(pdev); if (state.event == PM_EVENT_SUSPEND) { - acquire_console_sem(); + console_lock(); lx_powerdown(info); fb_set_suspend(info, 1); - release_console_sem(); + console_unlock(); } /* there's no point in setting PCI states; we emulate PCI, so @@ -482,7 +482,7 @@ static int lxfb_resume(struct pci_dev *pdev) struct fb_info *info = pci_get_drvdata(pdev); int ret; - acquire_console_sem(); + console_lock(); ret = lx_powerup(info); if (ret) { printk(KERN_ERR "lxfb: power up failed!\n"); @@ -490,7 +490,7 @@ static int lxfb_resume(struct pci_dev *pdev) } fb_set_suspend(info, 0); - release_console_sem(); + console_unlock(); return 0; } #else diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 5743ea25e818..318f6fb895b2 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c @@ -1574,7 +1574,7 @@ static int i810fb_suspend(struct pci_dev *dev, pm_message_t mesg) return 0; } - acquire_console_sem(); + console_lock(); fb_set_suspend(info, 1); if (info->fbops->fb_sync) @@ -1587,7 +1587,7 @@ static int i810fb_suspend(struct pci_dev *dev, pm_message_t mesg) pci_save_state(dev); pci_disable_device(dev); pci_set_power_state(dev, pci_choose_state(dev, mesg)); - release_console_sem(); + console_unlock(); return 0; } @@ -1605,7 +1605,7 @@ static int i810fb_resume(struct pci_dev *dev) return 0; } - acquire_console_sem(); + console_lock(); pci_set_power_state(dev, PCI_D0); pci_restore_state(dev); @@ -1621,7 +1621,7 @@ static int i810fb_resume(struct pci_dev *dev) fb_set_suspend (info, 0); info->fbops->fb_blank(VESA_NO_BLANKING, info); fail: - release_console_sem(); + console_unlock(); return 0; } /*********************************************************************** diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c index 670ecaa0385a..de366937c933 100644 --- a/drivers/video/jz4740_fb.c +++ b/drivers/video/jz4740_fb.c @@ -778,9 +778,9 @@ static int jzfb_suspend(struct device *dev) { struct jzfb *jzfb = dev_get_drvdata(dev); - acquire_console_sem(); + console_lock(); fb_set_suspend(jzfb->fb, 1); - release_console_sem(); + console_unlock(); mutex_lock(&jzfb->lock); if (jzfb->is_enabled) @@ -800,9 +800,9 @@ static int jzfb_resume(struct device *dev) jzfb_enable(jzfb); mutex_unlock(&jzfb->lock); - acquire_console_sem(); + console_lock(); fb_set_suspend(jzfb->fb, 0); - release_console_sem(); + console_unlock(); return 0; } diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c index cb013919e9ce..7e3a490e8d76 100644 --- a/drivers/video/mx3fb.c +++ b/drivers/video/mx3fb.c @@ -1177,9 +1177,9 @@ static int mx3fb_suspend(struct platform_device *pdev, pm_message_t state) struct mx3fb_data *mx3fb = platform_get_drvdata(pdev); struct mx3fb_info *mx3_fbi = mx3fb->fbi->par; - acquire_console_sem(); + console_lock(); fb_set_suspend(mx3fb->fbi, 1); - release_console_sem(); + console_unlock(); if (mx3_fbi->blank == FB_BLANK_UNBLANK) { sdc_disable_channel(mx3_fbi); @@ -1202,9 +1202,9 @@ static int mx3fb_resume(struct platform_device *pdev) sdc_set_brightness(mx3fb, mx3fb->backlight_level); } - acquire_console_sem(); + console_lock(); fb_set_suspend(mx3fb->fbi, 0); - release_console_sem(); + console_unlock(); return 0; } diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index efe10ff86d63..081dc4745274 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c @@ -1057,7 +1057,7 @@ static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t mesg) if (mesg.event == PM_EVENT_PRETHAW) mesg.event = PM_EVENT_FREEZE; - acquire_console_sem(); + console_lock(); par->pm_state = mesg.event; if (mesg.event & PM_EVENT_SLEEP) { @@ -1070,7 +1070,7 @@ static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t mesg) } dev->dev.power.power_state = mesg; - release_console_sem(); + console_unlock(); return 0; } @@ -1079,7 +1079,7 @@ static int nvidiafb_resume(struct pci_dev *dev) struct fb_info *info = pci_get_drvdata(dev); struct nvidia_par *par = info->par; - acquire_console_sem(); + console_lock(); pci_set_power_state(dev, PCI_D0); if (par->pm_state != PM_EVENT_FREEZE) { @@ -1097,7 +1097,7 @@ static int nvidiafb_resume(struct pci_dev *dev) nvidiafb_blank(FB_BLANK_UNBLANK, info); fail: - release_console_sem(); + console_unlock(); return 0; } #else diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index 9c0144ee7ae5..65560a1a0439 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c @@ -513,9 +513,9 @@ static int ps3fb_release(struct fb_info *info, int user) if (atomic_dec_and_test(&ps3fb.f_count)) { if (atomic_read(&ps3fb.ext_flip)) { atomic_set(&ps3fb.ext_flip, 0); - if (!try_acquire_console_sem()) { + if (console_trylock()) { ps3fb_sync(info, 0); /* single buffer */ - release_console_sem(); + console_unlock(); } } } @@ -830,14 +830,14 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd, if (vmode) { var = info->var; fb_videomode_to_var(&var, vmode); - acquire_console_sem(); + console_lock(); info->flags |= FBINFO_MISC_USEREVENT; /* Force, in case only special bits changed */ var.activate |= FB_ACTIVATE_FORCE; par->new_mode_id = val; retval = fb_set_var(info, &var); info->flags &= ~FBINFO_MISC_USEREVENT; - release_console_sem(); + console_unlock(); } break; } @@ -881,9 +881,9 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd, break; dev_dbg(info->device, "PS3FB_IOCTL_FSEL:%d\n", val); - acquire_console_sem(); + console_lock(); retval = ps3fb_sync(info, val); - release_console_sem(); + console_unlock(); break; default: @@ -903,9 +903,9 @@ static int ps3fbd(void *arg) set_current_state(TASK_INTERRUPTIBLE); if (ps3fb.is_kicked) { ps3fb.is_kicked = 0; - acquire_console_sem(); + console_lock(); ps3fb_sync(info, 0); /* single buffer */ - release_console_sem(); + console_unlock(); } schedule(); } diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c index dce8c97b4333..75738a928610 100644 --- a/drivers/video/s3fb.c +++ b/drivers/video/s3fb.c @@ -22,7 +22,7 @@ #include <linux/svga.h> #include <linux/init.h> #include <linux/pci.h> -#include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_sem() */ +#include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */ #include <video/vga.h> #ifdef CONFIG_MTRR @@ -1113,12 +1113,12 @@ static int s3_pci_suspend(struct pci_dev* dev, pm_message_t state) dev_info(info->device, "suspend\n"); - acquire_console_sem(); + console_lock(); mutex_lock(&(par->open_lock)); if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) { mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); return 0; } @@ -1129,7 +1129,7 @@ static int s3_pci_suspend(struct pci_dev* dev, pm_message_t state) pci_set_power_state(dev, pci_choose_state(dev, state)); mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); return 0; } @@ -1145,12 +1145,12 @@ static int s3_pci_resume(struct pci_dev* dev) dev_info(info->device, "resume\n"); - acquire_console_sem(); + console_lock(); mutex_lock(&(par->open_lock)); if (par->ref_count == 0) { mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); return 0; } @@ -1159,7 +1159,7 @@ static int s3_pci_resume(struct pci_dev* dev) err = pci_enable_device(dev); if (err) { mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); dev_err(info->device, "error %d enabling device for resume\n", err); return err; } @@ -1169,7 +1169,7 @@ static int s3_pci_resume(struct pci_dev* dev) fb_set_suspend(info, 0); mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); return 0; } diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 842d157e1025..487911e2926c 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -2373,7 +2373,7 @@ static int savagefb_suspend(struct pci_dev *dev, pm_message_t mesg) if (mesg.event == PM_EVENT_FREEZE) return 0; - acquire_console_sem(); + console_lock(); fb_set_suspend(info, 1); if (info->fbops->fb_sync) @@ -2385,7 +2385,7 @@ static int savagefb_suspend(struct pci_dev *dev, pm_message_t mesg) pci_save_state(dev); pci_disable_device(dev); pci_set_power_state(dev, pci_choose_state(dev, mesg)); - release_console_sem(); + console_unlock(); return 0; } @@ -2409,7 +2409,7 @@ static int savagefb_resume(struct pci_dev* dev) return 0; } - acquire_console_sem(); + console_lock(); pci_set_power_state(dev, PCI_D0); pci_restore_state(dev); @@ -2423,7 +2423,7 @@ static int savagefb_resume(struct pci_dev* dev) savagefb_set_par(info); fb_set_suspend(info, 0); savagefb_blank(FB_BLANK_UNBLANK, info); - release_console_sem(); + console_unlock(); return 0; } diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index 74d9f546a2e8..2b9e56a6bde4 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c @@ -1151,7 +1151,7 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) ch = info->par; - acquire_console_sem(); + console_lock(); /* HDMI plug in */ if (!sh_hdmi_must_reconfigure(hdmi) && @@ -1171,7 +1171,7 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) fb_set_suspend(info, 0); } - release_console_sem(); + console_unlock(); } else { ret = 0; if (!hdmi->info) @@ -1181,12 +1181,12 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) fb_destroy_modedb(hdmi->monspec.modedb); hdmi->monspec.modedb = NULL; - acquire_console_sem(); + console_lock(); /* HDMI disconnect */ fb_set_suspend(hdmi->info, 1); - release_console_sem(); + console_unlock(); pm_runtime_put(hdmi->dev); } diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index bd4840a8a6b7..bf12e53aed5c 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -912,9 +912,9 @@ static int sh_mobile_release(struct fb_info *info, int user) /* Nothing to reconfigure, when called from fbcon */ if (user) { - acquire_console_sem(); + console_lock(); sh_mobile_fb_reconfig(info); - release_console_sem(); + console_unlock(); } mutex_unlock(&ch->open_lock); diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c index b7dc1800efa9..bcb44a594ebc 100644 --- a/drivers/video/sm501fb.c +++ b/drivers/video/sm501fb.c @@ -2010,9 +2010,9 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info, /* tell console/fb driver we are suspending */ - acquire_console_sem(); + console_lock(); fb_set_suspend(fbi, 1); - release_console_sem(); + console_unlock(); /* backup copies in case chip is powered down over suspend */ @@ -2069,9 +2069,9 @@ static void sm501fb_resume_fb(struct sm501fb_info *info, memcpy_toio(par->cursor.k_addr, par->store_cursor, par->cursor.size); - acquire_console_sem(); + console_lock(); fb_set_suspend(fbi, 0); - release_console_sem(); + console_unlock(); vfree(par->store_fb); vfree(par->store_cursor); diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c index 6913fe168c25..dfef88c803d4 100644 --- a/drivers/video/tmiofb.c +++ b/drivers/video/tmiofb.c @@ -25,7 +25,7 @@ #include <linux/fb.h> #include <linux/interrupt.h> #include <linux/delay.h> -/* Why should fb driver call console functions? because acquire_console_sem() */ +/* Why should fb driver call console functions? because console_lock() */ #include <linux/console.h> #include <linux/mfd/core.h> #include <linux/mfd/tmio.h> @@ -944,7 +944,7 @@ static int tmiofb_suspend(struct platform_device *dev, pm_message_t state) struct mfd_cell *cell = dev->dev.platform_data; int retval = 0; - acquire_console_sem(); + console_lock(); fb_set_suspend(info, 1); @@ -965,7 +965,7 @@ static int tmiofb_suspend(struct platform_device *dev, pm_message_t state) if (cell->suspend) retval = cell->suspend(dev); - release_console_sem(); + console_unlock(); return retval; } @@ -976,7 +976,7 @@ static int tmiofb_resume(struct platform_device *dev) struct mfd_cell *cell = dev->dev.platform_data; int retval = 0; - acquire_console_sem(); + console_lock(); if (cell->resume) { retval = cell->resume(dev); @@ -992,7 +992,7 @@ static int tmiofb_resume(struct platform_device *dev) fb_set_suspend(info, 0); out: - release_console_sem(); + console_unlock(); return retval; } #else diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 289edd519527..4e66349e4366 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c @@ -1674,17 +1674,17 @@ static int parse_mode(const char *str, u32 *xres, u32 *yres) #ifdef CONFIG_PM static int viafb_suspend(void *unused) { - acquire_console_sem(); + console_lock(); fb_set_suspend(viafbinfo, 1); viafb_sync(viafbinfo); - release_console_sem(); + console_unlock(); return 0; } static int viafb_resume(void *unused) { - acquire_console_sem(); + console_lock(); if (viaparinfo->shared->vdev->engine_mmio) viafb_reset_engine(viaparinfo); viafb_set_par(viafbinfo); @@ -1692,7 +1692,7 @@ static int viafb_resume(void *unused) viafb_set_par(viafbinfo1); fb_set_suspend(viafbinfo, 0); - release_console_sem(); + console_unlock(); return 0; } diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c index 85d76ec4c63e..a2965ab92cfb 100644 --- a/drivers/video/vt8623fb.c +++ b/drivers/video/vt8623fb.c @@ -23,7 +23,7 @@ #include <linux/svga.h> #include <linux/init.h> #include <linux/pci.h> -#include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_sem() */ +#include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */ #include <video/vga.h> #ifdef CONFIG_MTRR @@ -819,12 +819,12 @@ static int vt8623_pci_suspend(struct pci_dev* dev, pm_message_t state) dev_info(info->device, "suspend\n"); - acquire_console_sem(); + console_lock(); mutex_lock(&(par->open_lock)); if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) { mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); return 0; } @@ -835,7 +835,7 @@ static int vt8623_pci_suspend(struct pci_dev* dev, pm_message_t state) pci_set_power_state(dev, pci_choose_state(dev, state)); mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); return 0; } @@ -850,7 +850,7 @@ static int vt8623_pci_resume(struct pci_dev* dev) dev_info(info->device, "resume\n"); - acquire_console_sem(); + console_lock(); mutex_lock(&(par->open_lock)); if (par->ref_count == 0) @@ -869,7 +869,7 @@ static int vt8623_pci_resume(struct pci_dev* dev) fail: mutex_unlock(&(par->open_lock)); - release_console_sem(); + console_unlock(); return 0; } diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index 3e6934d4bea8..a20218c2fda8 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c @@ -491,12 +491,12 @@ xenfb_make_preferred_console(void) if (console_set_on_cmdline) return; - acquire_console_sem(); + console_lock(); for_each_console(c) { if (!strcmp(c->name, "tty") && c->index == 0) break; } - release_console_sem(); + console_unlock(); if (c) { unregister_console(c); c->flags |= CON_CONSDEV; |