clocksource: clean up parse_pmtmr()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 20 Oct 2012 04:46:02 +0000 (07:46 +0300)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 13 Nov 2012 19:04:50 +0000 (14:04 -0500)
I changed the strict_strtoul() to kstrtouint().  That has the check
for UINT_MAX built in to it so the ifdefs can be removed.  Also
I changed a printk() to pr_info().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
drivers/clocksource/acpi_pm.c

index 6b5cf02c35c88147970c69cd19048650bff7610d..5d1b9268bcaf4a99d3f7024852c962209a62bb5d 100644 (file)
@@ -233,16 +233,15 @@ fs_initcall(init_acpi_pm_clocksource);
  */
 static int __init parse_pmtmr(char *arg)
 {
-       unsigned long base;
+       unsigned int base;
+       int ret;
 
-       if (strict_strtoul(arg, 16, &base))
-               return -EINVAL;
-#ifdef CONFIG_X86_64
-       if (base > UINT_MAX)
-               return -ERANGE;
-#endif
-       printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n",
-              pmtmr_ioport, base);
+       ret = kstrtouint(arg, 16, &base);
+       if (ret)
+               return ret;
+
+       pr_info("PMTMR IOPort override: 0x%04x -> 0x%04x\n", pmtmr_ioport,
+               base);
        pmtmr_ioport = base;
 
        return 1;