Commit f27a15d2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32

Pull AVR32 updates from Hans-Christian Egtvedt.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32:
  avr32: replace simple_strtoul() with kstrtoul()
  arch/avr32/mm/cache.c: export symbol flush_icache_range() for module using
  avr32: remove cpu_data macro to fix compiles
parents 01d5f3b5 4c3b7df4
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
static void __init check_bugs(void) static void __init check_bugs(void)
{ {
cpu_data->loops_per_jiffy = loops_per_jiffy; boot_cpu_data.loops_per_jiffy = loops_per_jiffy;
} }
#endif /* __ASM_AVR32_BUGS_H */ #endif /* __ASM_AVR32_BUGS_H */
...@@ -83,13 +83,8 @@ static inline unsigned int avr32_get_chip_revision(struct avr32_cpuinfo *cpu) ...@@ -83,13 +83,8 @@ static inline unsigned int avr32_get_chip_revision(struct avr32_cpuinfo *cpu)
extern struct avr32_cpuinfo boot_cpu_data; extern struct avr32_cpuinfo boot_cpu_data;
#ifdef CONFIG_SMP /* No SMP support so far */
extern struct avr32_cpuinfo cpu_data[];
#define current_cpu_data cpu_data[smp_processor_id()]
#else
#define cpu_data (&boot_cpu_data)
#define current_cpu_data boot_cpu_data #define current_cpu_data boot_cpu_data
#endif
/* This decides where the kernel will search for a free chunk of vm /* This decides where the kernel will search for a free chunk of vm
* space during mmap's * space during mmap's
......
...@@ -39,10 +39,12 @@ static ssize_t store_pc0event(struct device *dev, ...@@ -39,10 +39,12 @@ static ssize_t store_pc0event(struct device *dev,
size_t count) size_t count)
{ {
unsigned long val; unsigned long val;
char *endp; int ret;
val = simple_strtoul(buf, &endp, 0); ret = kstrtoul(buf, 0, &val);
if (endp == buf || val > 0x3f) if (ret)
return ret;
if (val > 0x3f)
return -EINVAL; return -EINVAL;
val = (val << 12) | (sysreg_read(PCCR) & 0xfffc0fff); val = (val << 12) | (sysreg_read(PCCR) & 0xfffc0fff);
sysreg_write(PCCR, val); sysreg_write(PCCR, val);
...@@ -61,11 +63,11 @@ static ssize_t store_pc0count(struct device *dev, ...@@ -61,11 +63,11 @@ static ssize_t store_pc0count(struct device *dev,
const char *buf, size_t count) const char *buf, size_t count)
{ {
unsigned long val; unsigned long val;
char *endp; int ret;
val = simple_strtoul(buf, &endp, 0); ret = kstrtoul(buf, 0, &val);
if (endp == buf) if (ret)
return -EINVAL; return ret;
sysreg_write(PCNT0, val); sysreg_write(PCNT0, val);
return count; return count;
...@@ -84,10 +86,12 @@ static ssize_t store_pc1event(struct device *dev, ...@@ -84,10 +86,12 @@ static ssize_t store_pc1event(struct device *dev,
size_t count) size_t count)
{ {
unsigned long val; unsigned long val;
char *endp; int ret;
val = simple_strtoul(buf, &endp, 0); ret = kstrtoul(buf, 0, &val);
if (endp == buf || val > 0x3f) if (ret)
return ret;
if (val > 0x3f)
return -EINVAL; return -EINVAL;
val = (val << 18) | (sysreg_read(PCCR) & 0xff03ffff); val = (val << 18) | (sysreg_read(PCCR) & 0xff03ffff);
sysreg_write(PCCR, val); sysreg_write(PCCR, val);
...@@ -106,11 +110,11 @@ static ssize_t store_pc1count(struct device *dev, ...@@ -106,11 +110,11 @@ static ssize_t store_pc1count(struct device *dev,
size_t count) size_t count)
{ {
unsigned long val; unsigned long val;
char *endp; int ret;
val = simple_strtoul(buf, &endp, 0); ret = kstrtoul(buf, 0, &val);
if (endp == buf) if (ret)
return -EINVAL; return ret;
sysreg_write(PCNT1, val); sysreg_write(PCNT1, val);
return count; return count;
...@@ -129,11 +133,11 @@ static ssize_t store_pccycles(struct device *dev, ...@@ -129,11 +133,11 @@ static ssize_t store_pccycles(struct device *dev,
size_t count) size_t count)
{ {
unsigned long val; unsigned long val;
char *endp; int ret;
val = simple_strtoul(buf, &endp, 0); ret = kstrtoul(buf, 0, &val);
if (endp == buf) if (ret)
return -EINVAL; return ret;
sysreg_write(PCCNT, val); sysreg_write(PCCNT, val);
return count; return count;
...@@ -152,11 +156,11 @@ static ssize_t store_pcenable(struct device *dev, ...@@ -152,11 +156,11 @@ static ssize_t store_pcenable(struct device *dev,
size_t count) size_t count)
{ {
unsigned long pccr, val; unsigned long pccr, val;
char *endp; int ret;
val = simple_strtoul(buf, &endp, 0); ret = kstrtoul(buf, 0, &val);
if (endp == buf) if (ret)
return -EINVAL; return ret;
if (val) if (val)
val = 1; val = 1;
......
...@@ -111,6 +111,7 @@ void flush_icache_range(unsigned long start, unsigned long end) ...@@ -111,6 +111,7 @@ void flush_icache_range(unsigned long start, unsigned long end)
__flush_icache_range(start & ~(linesz - 1), __flush_icache_range(start & ~(linesz - 1),
(end + linesz - 1) & ~(linesz - 1)); (end + linesz - 1) & ~(linesz - 1));
} }
EXPORT_SYMBOL(flush_icache_range);
/* /*
* This one is called from __do_fault() and do_swap_page(). * This one is called from __do_fault() and do_swap_page().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment