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
Kirill Smelkov
linux
Commits
6bc8a393
Commit
6bc8a393
authored
Jun 23, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/jgarzik/irda-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
2511765d
3c8b5914
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
25 deletions
+32
-25
drivers/net/irda/vlsi_ir.c
drivers/net/irda/vlsi_ir.c
+30
-21
include/net/irda/vlsi_ir.h
include/net/irda/vlsi_ir.h
+2
-4
No files found.
drivers/net/irda/vlsi_ir.c
View file @
6bc8a393
...
...
@@ -2,7 +2,7 @@
*
* vlsi_ir.c: VLSI82C147 PCI IrDA controller driver for Linux
*
* Copyright (c) 2001-200
2
Martin Diehl
* Copyright (c) 2001-200
3
Martin Diehl
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
...
...
@@ -28,7 +28,7 @@ MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>");
MODULE_LICENSE
(
"GPL"
);
#define DRIVER_NAME "vlsi_ir"
#define DRIVER_VERSION "v0.4"
#define DRIVER_VERSION "v0.4
a
"
/********************************************************/
...
...
@@ -149,6 +149,9 @@ static void vlsi_ring_debug(struct vlsi_ring *r)
/********************************************************/
/* needed regardless of CONFIG_PROC_FS */
static
struct
proc_dir_entry
*
vlsi_proc_root
=
NULL
;
#ifdef CONFIG_PROC_FS
static
int
vlsi_proc_pdev
(
struct
pci_dev
*
pdev
,
char
*
buf
,
int
len
)
...
...
@@ -394,8 +397,6 @@ static int vlsi_proc_print(struct net_device *ndev, char *buf, int len)
return
out
-
buf
;
}
static
struct
proc_dir_entry
*
vlsi_proc_root
=
NULL
;
struct
vlsi_proc_data
{
int
size
;
char
*
data
;
...
...
@@ -494,11 +495,18 @@ static int vlsi_proc_release(struct inode *inode, struct file *file)
}
static
struct
file_operations
vlsi_proc_fops
=
{
/* protect individual procdir file entry against rmmod */
.
owner
=
THIS_MODULE
,
.
open
=
vlsi_proc_open
,
.
llseek
=
vlsi_proc_lseek
,
.
read
=
vlsi_proc_read
,
.
release
=
vlsi_proc_release
,
};
#define VLSI_PROC_FOPS (&vlsi_proc_fops)
#else
/* CONFIG_PROC_FS */
#define VLSI_PROC_FOPS NULL
#endif
/********************************************************/
...
...
@@ -1800,8 +1808,7 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto
out_freedev
;
}
#ifdef CONFIG_PROC_FS
{
if
(
vlsi_proc_root
!=
NULL
)
{
struct
proc_dir_entry
*
ent
;
ent
=
create_proc_entry
(
ndev
->
name
,
S_IFREG
|
S_IRUGO
,
vlsi_proc_root
);
...
...
@@ -1810,11 +1817,11 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto
out_unregister
;
}
ent
->
data
=
ndev
;
ent
->
proc_fops
=
&
vlsi_proc_fops
;
ent
->
proc_fops
=
VLSI_PROC_FOPS
;
ent
->
size
=
0
;
idev
->
proc_entry
=
ent
;
}
#endif
}
else
idev
->
proc_entry
=
NULL
;
printk
(
KERN_INFO
"%s: registered device %s
\n
"
,
drivername
,
ndev
->
name
);
...
...
@@ -1851,12 +1858,10 @@ static void __devexit vlsi_irda_remove(struct pci_dev *pdev)
down
(
&
idev
->
sem
);
pci_set_drvdata
(
pdev
,
NULL
);
pci_disable_device
(
pdev
);
#ifdef CONFIG_PROC_FS
if
(
idev
->
proc_entry
)
{
remove_proc_entry
(
ndev
->
name
,
vlsi_proc_root
);
idev
->
proc_entry
=
NULL
;
}
#endif
up
(
&
idev
->
sem
);
unregister_netdev
(
ndev
);
...
...
@@ -1993,9 +1998,7 @@ static struct pci_driver vlsi_irda_driver = {
#endif
};
#ifdef CONFIG_PROC_FS
#define PROC_DIR ("driver/" DRIVER_NAME)
#endif
static
int
__init
vlsi_mod_init
(
void
)
{
...
...
@@ -2025,18 +2028,23 @@ static int __init vlsi_mod_init(void)
sirpulse
=
!!
sirpulse
;
#ifdef CONFIG_PROC_FS
/* create_proc_entry returns NULL if !CONFIG_PROC_FS.
* Failure to create the procfs entry is handled like running
* without procfs - it's not required for the driver to work.
*/
vlsi_proc_root
=
create_proc_entry
(
PROC_DIR
,
S_IFDIR
,
0
);
if
(
!
vlsi_proc_root
)
return
-
ENOMEM
;
#endif
if
(
vlsi_proc_root
)
{
/* protect registered procdir against module removal.
* Because we are in the module init path there's no race
* window after create_proc_entry (and no barrier needed).
*/
vlsi_proc_root
->
owner
=
THIS_MODULE
;
}
ret
=
pci_module_init
(
&
vlsi_irda_driver
);
#ifdef CONFIG_PROC_FS
if
(
ret
)
if
(
ret
&&
vlsi_proc_root
)
remove_proc_entry
(
PROC_DIR
,
0
);
#endif
return
ret
;
}
...
...
@@ -2044,6 +2052,7 @@ static int __init vlsi_mod_init(void)
static
void
__exit
vlsi_mod_exit
(
void
)
{
pci_unregister_driver
(
&
vlsi_irda_driver
);
if
(
vlsi_proc_root
)
remove_proc_entry
(
PROC_DIR
,
0
);
}
...
...
include/net/irda/vlsi_ir.h
View file @
6bc8a393
...
...
@@ -3,9 +3,9 @@
*
* vlsi_ir.h: VLSI82C147 PCI IrDA controller driver for Linux
*
* Version: 0.4
* Version: 0.4
a
*
* Copyright (c) 2001-200
2
Martin Diehl
* Copyright (c) 2001-200
3
Martin Diehl
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
...
...
@@ -730,9 +730,7 @@ typedef struct vlsi_irda_dev {
u32
cfg_space
[
64
/
sizeof
(
u32
)];
u8
resume_ok
;
#ifdef CONFIG_PROC_FS
struct
proc_dir_entry
*
proc_entry
;
#endif
}
vlsi_irda_dev_t
;
...
...
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