Merge branch 'hid-suspend' into picolcd
[pandora-kernel.git] / drivers / gpu / drm / drm_fb_helper.c
index 0f9e905..288ea2f 100644 (file)
@@ -27,7 +27,9 @@
  *      Dave Airlie <airlied@linux.ie>
  *      Jesse Barnes <jesse.barnes@intel.com>
  */
+#include <linux/kernel.h>
 #include <linux/sysrq.h>
+#include <linux/slab.h>
 #include <linux/fb.h>
 #include "drmP.h"
 #include "drm_crtc.h"
@@ -50,21 +52,6 @@ int drm_fb_helper_add_connector(struct drm_connector *connector)
 }
 EXPORT_SYMBOL(drm_fb_helper_add_connector);
 
-static int my_atoi(const char *name)
-{
-       int val = 0;
-
-       for (;; name++) {
-               switch (*name) {
-               case '0' ... '9':
-                       val = 10*val+(*name-'0');
-                       break;
-               default:
-                       return val;
-               }
-       }
-}
-
 /**
  * drm_fb_helper_connector_parse_command_line - parse command line for connector
  * @connector - connector to parse line for
@@ -111,7 +98,7 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_connector *con
                        namelen = i;
                        if (!refresh_specified && !bpp_specified &&
                            !yres_specified) {
-                               refresh = my_atoi(&name[i+1]);
+                               refresh = simple_strtol(&name[i+1], NULL, 10);
                                refresh_specified = 1;
                                if (cvt || rb)
                                        cvt = 0;
@@ -121,7 +108,7 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_connector *con
                case '-':
                        namelen = i;
                        if (!bpp_specified && !yres_specified) {
-                               bpp = my_atoi(&name[i+1]);
+                               bpp = simple_strtol(&name[i+1], NULL, 10);
                                bpp_specified = 1;
                                if (cvt || rb)
                                        cvt = 0;
@@ -130,7 +117,7 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_connector *con
                        break;
                case 'x':
                        if (!yres_specified) {
-                               yres = my_atoi(&name[i+1]);
+                               yres = simple_strtol(&name[i+1], NULL, 10);
                                yres_specified = 1;
                        } else
                                goto done;
@@ -170,7 +157,7 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_connector *con
                }
        }
        if (i < 0 && yres_specified) {
-               xres = my_atoi(name);
+               xres = simple_strtol(name, NULL, 10);
                res_specified = 1;
        }
 done:
@@ -297,6 +284,8 @@ static struct sysrq_key_op sysrq_drm_fb_helper_restore_op = {
        .help_msg = "force-fb(V)",
        .action_msg = "Restore framebuffer console",
 };
+#else
+static struct sysrq_key_op sysrq_drm_fb_helper_restore_op = { };
 #endif
 
 static void drm_fb_helper_on(struct fb_info *info)
@@ -694,7 +683,7 @@ int drm_fb_helper_set_par(struct fb_info *info)
        int i;
 
        if (var->pixclock != 0) {
-               DRM_ERROR("PIXEL CLCOK SET\n");
+               DRM_ERROR("PIXEL CLOCK SET\n");
                return -EINVAL;
        }