--- fsam7400-0.5.2/fsam7400.c.orig 2014-02-12 16:35:14.972365220 +0100 +++ fsam7400-0.5.2/fsam7400.c 2014-02-12 16:50:41.000009768 +0100 @@ -321,6 +321,13 @@ static inline int common_proc_init(void) { struct proc_dir_entry *ent; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0) + static const struct file_operations proc_fops = { + .owner = THIS_MODULE, + .read = common_proc_get_radio, + .write = common_proc_set_radio, + }; +#endif int err = 0; dir_base = proc_mkdir(PROC_DIR, NULL); if (dir_base == NULL) { @@ -328,6 +335,7 @@ err = -ENOMEM; goto fail; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) ent = create_proc_entry(PROC_RADIO, S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP, dir_base); @@ -342,6 +350,18 @@ err = -ENOMEM; goto fail; } +#else + ent = proc_create(PROC_RADIO, + S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP, + dir_base, + &proc_fops); + if (ent == NULL) { + printk(KERN_ERR DRV_NAME ": Unable to initialize /proc/" + PROC_DIR "/" PROC_RADIO "\n"); + err = -ENOMEM; + goto fail; + } +#endif return 0; fail: common_proc_cleanup();