diff options
author | LABBE Corentin <clabbe.montjoie@gmail.com> | 2015-11-05 04:33:54 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-11-24 05:41:53 -0500 |
commit | cc344980c76748e57c9c03100c2a14d36ab00334 (patch) | |
tree | cb47d9f5129a335ec678f5f773bc342c2ad47b14 | |
parent | d9c382421771560c6b282c100752a3c194cb5827 (diff) |
drm: modes: replace simple_strtoul by kstrtouint
The simple_strtoul function is marked as obsolete.
This patch replace it by kstrtouint.
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index cd74a0953f42..bde9b2911dc2 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
@@ -1230,7 +1230,7 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option, | |||
1230 | unsigned int xres = 0, yres = 0, bpp = 32, refresh = 0; | 1230 | unsigned int xres = 0, yres = 0, bpp = 32, refresh = 0; |
1231 | bool yres_specified = false, cvt = false, rb = false; | 1231 | bool yres_specified = false, cvt = false, rb = false; |
1232 | bool interlace = false, margins = false, was_digit = false; | 1232 | bool interlace = false, margins = false, was_digit = false; |
1233 | int i; | 1233 | int i, err; |
1234 | enum drm_connector_force force = DRM_FORCE_UNSPECIFIED; | 1234 | enum drm_connector_force force = DRM_FORCE_UNSPECIFIED; |
1235 | 1235 | ||
1236 | #ifdef CONFIG_FB | 1236 | #ifdef CONFIG_FB |
@@ -1250,7 +1250,9 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option, | |||
1250 | case '@': | 1250 | case '@': |
1251 | if (!refresh_specified && !bpp_specified && | 1251 | if (!refresh_specified && !bpp_specified && |
1252 | !yres_specified && !cvt && !rb && was_digit) { | 1252 | !yres_specified && !cvt && !rb && was_digit) { |
1253 | refresh = simple_strtol(&name[i+1], NULL, 10); | 1253 | err = kstrtouint(&name[i + 1], 10, &refresh); |
1254 | if (err) | ||
1255 | return false; | ||
1254 | refresh_specified = true; | 1256 | refresh_specified = true; |
1255 | was_digit = false; | 1257 | was_digit = false; |
1256 | } else | 1258 | } else |
@@ -1259,7 +1261,9 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option, | |||
1259 | case '-': | 1261 | case '-': |
1260 | if (!bpp_specified && !yres_specified && !cvt && | 1262 | if (!bpp_specified && !yres_specified && !cvt && |
1261 | !rb && was_digit) { | 1263 | !rb && was_digit) { |
1262 | bpp = simple_strtol(&name[i+1], NULL, 10); | 1264 | err = kstrtouint(&name[i + 1], 10, &bpp); |
1265 | if (err) | ||
1266 | return false; | ||
1263 | bpp_specified = true; | 1267 | bpp_specified = true; |
1264 | was_digit = false; | 1268 | was_digit = false; |
1265 | } else | 1269 | } else |
@@ -1267,7 +1271,9 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option, | |||
1267 | break; | 1271 | break; |
1268 | case 'x': | 1272 | case 'x': |
1269 | if (!yres_specified && was_digit) { | 1273 | if (!yres_specified && was_digit) { |
1270 | yres = simple_strtol(&name[i+1], NULL, 10); | 1274 | err = kstrtouint(&name[i + 1], 10, &yres); |
1275 | if (err) | ||
1276 | return false; | ||
1271 | yres_specified = true; | 1277 | yres_specified = true; |
1272 | was_digit = false; | 1278 | was_digit = false; |
1273 | } else | 1279 | } else |
@@ -1491,4 +1497,4 @@ int drm_mode_convert_umode(struct drm_display_mode *out, | |||
1491 | 1497 | ||
1492 | out: | 1498 | out: |
1493 | return ret; | 1499 | return ret; |
1494 | } \ No newline at end of file | 1500 | } |