ar71xx: setup wdt_clock for AR913X to avoid a kernel bug
[openwrt.git] / target / linux / generic / files / crypto / ocf / cryptodev.c
index 87a4c37..8f0257c 100644 (file)
 __FBSDID("$FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.34 2007/05/09 19:37:02 gnn Exp $");
  */
 
-#ifndef AUTOCONF_INCLUDED
-#include <linux/config.h>
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
+#include <generated/autoconf.h>
+#else
+#include <linux/autoconf.h>
 #endif
 #include <linux/types.h>
 #include <linux/time.h>
@@ -977,10 +980,16 @@ cryptodev_open(struct inode *inode, struct file *filp)
        struct fcrypt *fcr;
 
        dprintk("%s()\n", __FUNCTION__);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+       /*
+        * on 2.6.35 private_data points to a miscdevice structure, we override
+        * it,  which is currently safe to do.
+        */
        if (filp->private_data) {
-               printk("cryptodev: Private data already exists !\n");
-               return(0);
+               printk("cryptodev: Private data already exists - %p!\n", filp->private_data);
+               return(-ENODEV);
        }
+#endif
 
        fcr = kmalloc(sizeof(*fcr), GFP_KERNEL);
        if (!fcr) {
@@ -1019,7 +1028,9 @@ static struct file_operations cryptodev_fops = {
        .owner = THIS_MODULE,
        .open = cryptodev_open,
        .release = cryptodev_release,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
        .ioctl = cryptodev_ioctl,
+#endif
 #ifdef HAVE_UNLOCKED_IOCTL
        .unlocked_ioctl = cryptodev_unlocked_ioctl,
 #endif
This page took 0.02775 seconds and 4 git commands to generate.