V4L/DVB: bttv: remove bogus prio check in g_frequency
[safe/jmp/linux-2.6] / drivers / video / uvesafb.c
index e98baf6..7b8839e 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/fb.h>
 #include <linux/io.h>
 #include <linux/mutex.h>
+#include <linux/slab.h>
 #include <video/edid.h>
 #include <video/uvesafb.h>
 #ifdef CONFIG_X86
@@ -67,11 +68,14 @@ static DEFINE_MUTEX(uvfb_lock);
  * find the kernel part of the task struct, copy the registers and
  * the buffer contents and then complete the task.
  */
-static void uvesafb_cn_callback(struct cn_msg *msg)
+static void uvesafb_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
 {
        struct uvesafb_task *utask;
        struct uvesafb_ktask *task;
 
+       if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN))
+               return;
+
        if (msg->seq >= UVESAFB_TASKS_MAX)
                return;
 
@@ -1408,23 +1412,6 @@ static int uvesafb_check_var(struct fb_var_screeninfo *var,
        return 0;
 }
 
-static void uvesafb_save_state(struct fb_info *info)
-{
-       struct uvesafb_par *par = info->par;
-
-       if (par->vbe_state_saved)
-               kfree(par->vbe_state_saved);
-
-       par->vbe_state_saved = uvesafb_vbe_state_save(par);
-}
-
-static void uvesafb_restore_state(struct fb_info *info)
-{
-       struct uvesafb_par *par = info->par;
-
-       uvesafb_vbe_state_restore(par, par->vbe_state_saved);
-}
-
 static struct fb_ops uvesafb_ops = {
        .owner          = THIS_MODULE,
        .fb_open        = uvesafb_open,
@@ -1438,8 +1425,6 @@ static struct fb_ops uvesafb_ops = {
        .fb_imageblit   = cfb_imageblit,
        .fb_check_var   = uvesafb_check_var,
        .fb_set_par     = uvesafb_set_par,
-       .fb_save_state  = uvesafb_save_state,
-       .fb_restore_state = uvesafb_restore_state,
 };
 
 static void __devinit uvesafb_init_info(struct fb_info *info,
@@ -1456,15 +1441,6 @@ static void __devinit uvesafb_init_info(struct fb_info *info,
        info->fix.ypanstep = par->ypan ? 1 : 0;
        info->fix.ywrapstep = (par->ypan > 1) ? 1 : 0;
 
-       /*
-        * If we were unable to get the state buffer size, disable
-        * functions for saving and restoring the hardware state.
-        */
-       if (par->vbe_state_size == 0) {
-               info->fbops->fb_save_state = NULL;
-               info->fbops->fb_restore_state = NULL;
-       }
-
        /* Disable blanking if the user requested so. */
        if (!blank)
                info->fbops->fb_blank = NULL;