aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2007-09-10 20:59:38 +0000
committerJohn Crispin <john@openwrt.org>2007-09-10 20:59:38 +0000
commitc4c29e8b689fb09de0d3fcdfac7c8b691aabbc1d (patch)
tree1c42f70a0545aff77b9fa3c8bcc220aa6e0a7154 /package
parentc4fa115e5ca6b90ea2c1cd36f0876818c6281200 (diff)
downloadupstream-c4c29e8b689fb09de0d3fcdfac7c8b691aabbc1d.tar.gz
upstream-c4c29e8b689fb09de0d3fcdfac7c8b691aabbc1d.tar.bz2
upstream-c4c29e8b689fb09de0d3fcdfac7c8b691aabbc1d.zip
fixed fonera mp3 driver sysfs and autoload
SVN-Revision: 8733
Diffstat (limited to 'package')
-rw-r--r--package/fonera-mp3-drv/Makefile2
-rw-r--r--package/fonera-mp3-drv/src/mp3_drv.c11
2 files changed, 11 insertions, 2 deletions
diff --git a/package/fonera-mp3-drv/Makefile b/package/fonera-mp3-drv/Makefile
index 1ce29e35fa..94c19f42c2 100644
--- a/package/fonera-mp3-drv/Makefile
+++ b/package/fonera-mp3-drv/Makefile
@@ -21,7 +21,7 @@ define KernelPackage/fonera-mp3-driver
DEPENDS:=@TARGET_atheros
TITLE:=Fonera-MP3 driver (VS1011X)
FILES:=$(PKG_BUILD_DIR)/mp3_drv.$(LINUX_KMOD_SUFFIX)
- AUTOLOAD:=$(call AutoLoad,25,mp3-drv)
+ AUTOLOAD:=$(call AutoLoad,25,mp3_drv)
endef
define KernelPackage/fonera-mp3-driver/description
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;