Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
31436269
Commit
31436269
authored
Apr 08, 2004
by
Hanna V. Linder
Committed by
Greg Kroah-Hartman
Apr 08, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] add class support to dsp56k.c
Here is a patch that adds sysfs class support to /drivers/char/dsp56k.c
parent
cdf1a041
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
drivers/char/dsp56k.c
drivers/char/dsp56k.c
+25
-2
No files found.
drivers/char/dsp56k.c
View file @
31436269
...
...
@@ -35,6 +35,7 @@
#include <linux/init.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/smp_lock.h>
#include <linux/device.h>
#include <asm/atarihw.h>
#include <asm/traps.h>
...
...
@@ -149,6 +150,8 @@ static struct dsp56k_device {
int
tx_wsize
,
rx_wsize
;
}
dsp56k
;
static
struct
class_simple
*
dsp56k_class
;
static
int
dsp56k_reset
(
void
)
{
u_char
status
;
...
...
@@ -502,6 +505,8 @@ static char banner[] __initdata = KERN_INFO "DSP56k driver installed\n";
static
int
__init
dsp56k_init_driver
(
void
)
{
int
err
=
0
;
if
(
!
MACH_IS_ATARI
||
!
ATARIHW_PRESENT
(
DSP56K
))
{
printk
(
"DSP56k driver: Hardware not present
\n
"
);
return
-
ENODEV
;
...
...
@@ -511,17 +516,35 @@ static int __init dsp56k_init_driver(void)
printk
(
"DSP56k driver: Unable to register driver
\n
"
);
return
-
ENODEV
;
}
dsp56k_class
=
class_simple_create
(
THIS_MODULE
,
"dsp56k"
);
if
(
IS_ERR
(
dsp56k_class
))
{
err
=
PTR_ERR
(
dsp56k_class
);
goto
out_chrdev
;
}
class_simple_device_add
(
dsp56k_class
,
MKDEV
(
DSP56K_MAJOR
,
0
),
NULL
,
"dsp56k"
);
devfs_mk_cdev
(
MKDEV
(
DSP56K_MAJOR
,
0
),
err
=
devfs_mk_cdev
(
MKDEV
(
DSP56K_MAJOR
,
0
),
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
"dsp56k"
);
if
(
err
)
goto
out_class
;
printk
(
banner
);
return
0
;
goto
out
;
out_class:
class_simple_device_remove
(
MKDEV
(
DSP56K_MAJOR
,
0
));
class_simple_destroy
(
dsp56k_class
);
out_chrdev:
unregister_chrdev
(
DSP56K_MAJOR
,
"dsp56k"
);
out:
return
err
;
}
module_init
(
dsp56k_init_driver
);
static
void
__exit
dsp56k_cleanup_driver
(
void
)
{
class_simple_device_remove
(
MKDEV
(
DSP56K_MAJOR
,
0
));
class_simple_destroy
(
dsp56k_class
);
unregister_chrdev
(
DSP56K_MAJOR
,
"dsp56k"
);
devfs_remove
(
"dsp56k"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment