sh: Fixup cpu_data references for the non-boot CPUs.
[linux-2.6.git] / arch / sh / oprofile / op_model_sh7750.c
index 5ec9ddc..ebee7e2 100644 (file)
@@ -142,7 +142,7 @@ static u64 sh7750_read_counter(int counter)
  */
 static inline int to_counter(struct file *file)
 {
-       const unsigned char *name = file->f_dentry->d_parent->d_name.name;
+       const unsigned char *name = file->f_path.dentry->d_parent->d_name.name;
 
        return (int)simple_strtol(name, NULL, 10);
 }
@@ -187,7 +187,7 @@ static ssize_t sh7750_write_count(struct file *file, const char __user *buf,
        return count;
 }
 
-static struct file_operations count_fops = {
+static const struct file_operations count_fops = {
        .read           = sh7750_read_count,
        .write          = sh7750_write_count,
 };
@@ -198,7 +198,7 @@ static int sh7750_perf_counter_create_files(struct super_block *sb, struct dentr
 
        for (i = 0; i < NR_CNTRS; i++) {
                struct dentry *dir;
-               char buf[3];
+               char buf[4];
 
                snprintf(buf, sizeof(buf), "%d", i);
                dir = oprofilefs_mkdir(sb, root, buf);
@@ -259,7 +259,7 @@ static struct oprofile_operations sh7750_perf_counter_ops = {
 
 int __init oprofile_arch_init(struct oprofile_operations **ops)
 {
-       if (!(cpu_data->flags & CPU_HAS_PERF_COUNTER))
+       if (!(current_cpu_data.flags & CPU_HAS_PERF_COUNTER))
                return -ENODEV;
 
        sh7750_perf_counter_ops.cpu_type = (char *)get_cpu_subtype();