diff options
author | John Crispin <blogic@openwrt.org> | 2007-09-10 20:59:38 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2007-09-10 20:59:38 +0000 |
commit | ee511ef3605e9cef7da20e7e43a9b94a9ce1a00a (patch) | |
tree | e7e08f184f510ead55755d67eef3fdb0a9cef20a /package/fonera-mp3-drv/src | |
parent | e4b75a96c9dfb7c507ccca5f9a7da68dc8fd2e06 (diff) | |
download | master-187ad058-ee511ef3605e9cef7da20e7e43a9b94a9ce1a00a.tar.gz master-187ad058-ee511ef3605e9cef7da20e7e43a9b94a9ce1a00a.tar.bz2 master-187ad058-ee511ef3605e9cef7da20e7e43a9b94a9ce1a00a.zip |
fixed fonera mp3 driver sysfs and autoload
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8733 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/fonera-mp3-drv/src')
-rw-r--r-- | package/fonera-mp3-drv/src/mp3_drv.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/package/fonera-mp3-drv/src/mp3_drv.c b/package/fonera-mp3-drv/src/mp3_drv.c index f2c0dd1664..9609444181 100644 --- a/package/fonera-mp3-drv/src/mp3_drv.c +++ b/package/fonera-mp3-drv/src/mp3_drv.c @@ -30,6 +30,7 @@ #include <linux/timer.h> #include <linux/init.h> #include <linux/genhd.h> +#include <linux/device.h> // do we want debuging info ? #if 0 @@ -271,6 +272,8 @@ struct file_operations modulemp3_fops = { release: module_close }; +static struct class *mp3_class; + static int __init mod_init(void){ printk("mp3_drv.ko : VS1011b Driver\n"); printk("mp3_drv.ko : Made by John '2B|!2B' Crispin (john@phrozen.org)\n"); @@ -280,7 +283,13 @@ static int __init mod_init(void){ printk( "mp3_drv.ko : Error whilst opening %s (%d)\n", DEV_NAME, DEV_MAJOR); return( -ENODEV ); } - + + printk("mp3_drv.ko : using sysfs to create device nodes\n"); + mp3_class = class_create(THIS_MODULE, DEV_NAME); + class_device_create(mp3_class, NULL, + MKDEV(DEV_MAJOR, 0), + NULL, DEV_NAME); + mp3_info[0].is_open = 0; printk("mp3_drv.ko : Device %s registered for major ID %d\n", DEV_NAME, DEV_MAJOR); crystal_freq = CRYSTAL12288; |