mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
[kernel] make gpio_dev compatible with GPIOLIB & GPIO_SYSFS (closes #4016)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12864 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
static int dev_major;
|
static int dev_major;
|
||||||
static unsigned int gpio_access_mask;
|
static unsigned int gpio_access_mask;
|
||||||
static struct class *gpio_class;
|
static struct class *gpiodev_class;
|
||||||
|
|
||||||
/* Counter is 1, if the device is not opened and zero (or less) if opened. */
|
/* Counter is 1, if the device is not opened and zero (or less) if opened. */
|
||||||
static atomic_t gpio_open_cnt = ATOMIC_INIT(1);
|
static atomic_t gpio_open_cnt = ATOMIC_INIT(1);
|
||||||
@@ -141,8 +141,8 @@ gpio_probe(struct platform_device *dev)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpio_class = class_create(THIS_MODULE, DEVNAME);
|
gpiodev_class = class_create(THIS_MODULE, DRVNAME);
|
||||||
class_device_create(gpio_class, NULL, MKDEV(dev_major, 0), NULL, DEVNAME);
|
class_device_create(gpiodev_class, NULL, MKDEV(dev_major, 0), NULL, DEVNAME);
|
||||||
|
|
||||||
printk(KERN_INFO DRVNAME ": gpio device registered with major %d\n", dev_major);
|
printk(KERN_INFO DRVNAME ": gpio device registered with major %d\n", dev_major);
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
static int dev_major;
|
static int dev_major;
|
||||||
static unsigned int gpio_access_mask;
|
static unsigned int gpio_access_mask;
|
||||||
static struct class *gpio_class;
|
static struct class *gpiodev_class;
|
||||||
|
|
||||||
/* Counter is 1, if the device is not opened and zero (or less) if opened. */
|
/* Counter is 1, if the device is not opened and zero (or less) if opened. */
|
||||||
static atomic_t gpio_open_cnt = ATOMIC_INIT(1);
|
static atomic_t gpio_open_cnt = ATOMIC_INIT(1);
|
||||||
@@ -141,8 +141,8 @@ gpio_probe(struct platform_device *dev)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpio_class = class_create(THIS_MODULE, DEVNAME);
|
gpiodev_class = class_create(THIS_MODULE, DRVNAME);
|
||||||
device_create(gpio_class, NULL, MKDEV(dev_major, 0), DEVNAME);
|
device_create(gpiodev_class, NULL, MKDEV(dev_major, 0), DEVNAME);
|
||||||
|
|
||||||
printk(KERN_INFO DRVNAME ": gpio device registered with major %d\n", dev_major);
|
printk(KERN_INFO DRVNAME ": gpio device registered with major %d\n", dev_major);
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
static int dev_major;
|
static int dev_major;
|
||||||
static unsigned int gpio_access_mask;
|
static unsigned int gpio_access_mask;
|
||||||
static struct class *gpio_class;
|
static struct class *gpiodev_class;
|
||||||
|
|
||||||
/* Counter is 1, if the device is not opened and zero (or less) if opened. */
|
/* Counter is 1, if the device is not opened and zero (or less) if opened. */
|
||||||
static atomic_t gpio_open_cnt = ATOMIC_INIT(1);
|
static atomic_t gpio_open_cnt = ATOMIC_INIT(1);
|
||||||
@@ -141,8 +141,8 @@ gpio_probe(struct platform_device *dev)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpio_class = class_create(THIS_MODULE, DEVNAME);
|
gpiodev_class = class_create(THIS_MODULE, DRVNAME);
|
||||||
device_create(gpio_class, NULL, MKDEV(dev_major, 0), dev, DEVNAME);
|
device_create(gpiodev_class, NULL, MKDEV(dev_major, 0), dev, DEVNAME);
|
||||||
|
|
||||||
printk(KERN_INFO DRVNAME ": gpio device registered with major %d\n", dev_major);
|
printk(KERN_INFO DRVNAME ": gpio device registered with major %d\n", dev_major);
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
static int dev_major;
|
static int dev_major;
|
||||||
static unsigned int gpio_access_mask;
|
static unsigned int gpio_access_mask;
|
||||||
static struct class *gpio_class;
|
static struct class *gpiodev_class;
|
||||||
|
|
||||||
/* Counter is 1, if the device is not opened and zero (or less) if opened. */
|
/* Counter is 1, if the device is not opened and zero (or less) if opened. */
|
||||||
static atomic_t gpio_open_cnt = ATOMIC_INIT(1);
|
static atomic_t gpio_open_cnt = ATOMIC_INIT(1);
|
||||||
@@ -141,8 +141,8 @@ gpio_probe(struct platform_device *dev)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpio_class = class_create(THIS_MODULE, DEVNAME);
|
gpiodev_class = class_create(THIS_MODULE, DRVNAME);
|
||||||
class_device_create(gpio_class, NULL, MKDEV(dev_major, 0), NULL, DEVNAME);
|
class_device_create(gpiodev_class, NULL, MKDEV(dev_major, 0), NULL, DEVNAME);
|
||||||
|
|
||||||
printk(KERN_INFO DRVNAME ": gpio device registered with major %d\n", dev_major);
|
printk(KERN_INFO DRVNAME ": gpio device registered with major %d\n", dev_major);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user