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
caf3413d
Commit
caf3413d
authored
Feb 20, 2003
by
Christoph Hellwig
Committed by
Linus Torvalds
Feb 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fix module refcounting of pcmcia socket drivers
parent
6fe56a9f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
63 deletions
+51
-63
drivers/pcmcia/cs.c
drivers/pcmcia/cs.c
+8
-1
drivers/pcmcia/hd64465_ss.c
drivers/pcmcia/hd64465_ss.c
+13
-17
drivers/pcmcia/i82092.c
drivers/pcmcia/i82092.c
+1
-5
drivers/pcmcia/i82365.c
drivers/pcmcia/i82365.c
+13
-17
drivers/pcmcia/pci_socket.c
drivers/pcmcia/pci_socket.c
+13
-16
drivers/pcmcia/sa1100_generic.c
drivers/pcmcia/sa1100_generic.c
+1
-2
drivers/pcmcia/tcic.c
drivers/pcmcia/tcic.c
+1
-5
include/pcmcia/ss.h
include/pcmcia/ss.h
+1
-0
No files found.
drivers/pcmcia/cs.c
View file @
caf3413d
...
...
@@ -244,7 +244,14 @@ static const lookup_t service_table[] = {
static
int
register_callback
(
socket_info_t
*
s
,
void
(
*
handler
)(
void
*
,
unsigned
int
),
void
*
info
)
{
return
s
->
ss_entry
->
register_callback
(
s
->
sock
,
handler
,
info
);
int
error
;
if
(
handler
&&
!
try_module_get
(
s
->
ss_entry
->
owner
))
return
-
ENODEV
;
error
=
s
->
ss_entry
->
register_callback
(
s
->
sock
,
handler
,
info
);
if
(
!
handler
)
module_put
(
s
->
ss_entry
->
owner
);
return
error
;
}
static
int
get_socket_status
(
socket_info_t
*
s
,
int
*
val
)
...
...
drivers/pcmcia/hd64465_ss.c
View file @
caf3413d
...
...
@@ -394,11 +394,6 @@ static int hs_register_callback(unsigned int sock,
DPRINTK
(
"hs_register_callback(%d)
\n
"
,
sock
);
sp
->
handler
=
handler
;
sp
->
handler_info
=
info
;
if
(
handler
==
0
)
{
MOD_DEC_USE_COUNT
;
}
else
{
MOD_INC_USE_COUNT
;
}
return
0
;
}
...
...
@@ -891,18 +886,19 @@ static void hs_interrupt(int irq, void *dev, struct pt_regs *regs)
/*============================================================*/
static
struct
pccard_operations
hs_operations
=
{
hs_init
,
hs_suspend
,
hs_register_callback
,
hs_inquire_socket
,
hs_get_status
,
hs_get_socket
,
hs_set_socket
,
hs_get_io_map
,
hs_set_io_map
,
hs_get_mem_map
,
hs_set_mem_map
,
hs_proc_setup
.
owner
=
THIS_MODULE
,
.
init
=
hs_init
,
.
suspend
=
hs_suspend
,
.
register_callback
=
hs_register_callback
,
.
inquire_socket
=
hs_inquire_socket
,
.
get_status
=
hs_get_status
,
.
get_socket
=
hs_get_socket
,
.
set_socket
=
hs_set_socket
,
.
get_io_map
=
hs_get_io_map
,
.
set_io_map
=
hs_set_io_map
,
.
get_mem_map
=
hs_get_mem_map
,
.
set_mem_map
=
hs_set_mem_map
,
.
proc_setup
=
hs_proc_setup
,
};
static
int
hs_init_socket
(
hs_socket_t
*
sp
,
int
irq
,
unsigned
long
mem_base
,
...
...
drivers/pcmcia/i82092.c
View file @
caf3413d
...
...
@@ -55,6 +55,7 @@ static struct pci_driver i82092aa_pci_drv = {
/* the pccard structure and its functions */
static
struct
pccard_operations
i82092aa_operations
=
{
.
owner
=
THIS_MODULE
,
.
init
=
i82092aa_init
,
.
suspend
=
i82092aa_suspend
,
.
register_callback
=
i82092aa_register_callback
,
...
...
@@ -465,11 +466,6 @@ static int i82092aa_register_callback(unsigned int sock, void (*handler)(void *,
enter
(
"i82092aa_register_callback"
);
sockets
[
sock
].
handler
=
handler
;
sockets
[
sock
].
info
=
info
;
if
(
handler
==
NULL
)
{
MOD_DEC_USE_COUNT
;
}
else
{
MOD_INC_USE_COUNT
;
}
leave
(
"i82092aa_register_callback"
);
return
0
;
}
/* i82092aa_register_callback */
...
...
drivers/pcmcia/i82365.c
View file @
caf3413d
...
...
@@ -1018,11 +1018,6 @@ static int pcic_register_callback(unsigned int sock, void (*handler)(void *, uns
{
socket
[
sock
].
handler
=
handler
;
socket
[
sock
].
info
=
info
;
if
(
handler
==
NULL
)
{
MOD_DEC_USE_COUNT
;
}
else
{
MOD_INC_USE_COUNT
;
}
return
0
;
}
/* pcic_register_callback */
...
...
@@ -1568,18 +1563,19 @@ static int pcic_suspend(unsigned int sock)
}
static
struct
pccard_operations
pcic_operations
=
{
pcic_init
,
pcic_suspend
,
pcic_register_callback
,
pcic_inquire_socket
,
pcic_get_status
,
pcic_get_socket
,
pcic_set_socket
,
pcic_get_io_map
,
pcic_set_io_map
,
pcic_get_mem_map
,
pcic_set_mem_map
,
pcic_proc_setup
.
owner
=
THIS_MODULE
,
.
init
=
pcic_init
,
.
suspend
=
pcic_suspend
,
.
register_callback
=
pcic_register_callback
,
.
inquire_socket
=
pcic_inquire_socket
,
.
get_status
=
pcic_get_status
,
.
get_socket
=
pcic_get_socket
,
.
set_socket
=
pcic_set_socket
,
.
get_io_map
=
pcic_get_io_map
,
.
set_io_map
=
pcic_set_io_map
,
.
get_mem_map
=
pcic_get_mem_map
,
.
set_mem_map
=
pcic_set_mem_map
,
.
proc_setup
=
pcic_proc_setup
,
};
/*====================================================================*/
...
...
drivers/pcmcia/pci_socket.c
View file @
caf3413d
...
...
@@ -66,10 +66,6 @@ static int pci_register_callback(unsigned int sock, void (*handler)(void *, unsi
socket
->
handler
=
handler
;
socket
->
info
=
info
;
if
(
handler
)
MOD_INC_USE_COUNT
;
else
MOD_DEC_USE_COUNT
;
return
0
;
}
...
...
@@ -154,18 +150,19 @@ static void pci_proc_setup(unsigned int sock, struct proc_dir_entry *base)
}
static
struct
pccard_operations
pci_socket_operations
=
{
pci_init_socket
,
pci_suspend_socket
,
pci_register_callback
,
pci_inquire_socket
,
pci_get_status
,
pci_get_socket
,
pci_set_socket
,
pci_get_io_map
,
pci_set_io_map
,
pci_get_mem_map
,
pci_set_mem_map
,
pci_proc_setup
.
owner
=
THIS_MODULE
,
.
init
=
pci_init_socket
,
.
suspend
=
pci_suspend_socket
,
.
register_callback
=
pci_register_callback
,
.
inquire_socket
=
pci_inquire_socket
,
.
get_status
=
pci_get_status
,
.
get_socket
=
pci_get_socket
,
.
set_socket
=
pci_set_socket
,
.
get_io_map
=
pci_get_io_map
,
.
set_io_map
=
pci_set_io_map
,
.
get_mem_map
=
pci_get_mem_map
,
.
set_mem_map
=
pci_set_mem_map
,
.
proc_setup
=
pci_proc_setup
,
};
static
int
__devinit
add_pci_socket
(
int
nr
,
struct
pci_dev
*
dev
,
struct
pci_socket_ops
*
ops
)
...
...
drivers/pcmcia/sa1100_generic.c
View file @
caf3413d
...
...
@@ -380,9 +380,7 @@ sa1100_pcmcia_register_callback(unsigned int sock,
if
(
handler
==
NULL
)
{
skt
->
handler
=
NULL
;
MOD_DEC_USE_COUNT
;
}
else
{
MOD_INC_USE_COUNT
;
skt
->
handler_info
=
info
;
skt
->
handler
=
handler
;
}
...
...
@@ -854,6 +852,7 @@ sa1100_pcmcia_proc_setup(unsigned int sock, struct proc_dir_entry *base)
#endif
/* defined(CONFIG_PROC_FS) */
static
struct
pccard_operations
sa1100_pcmcia_operations
=
{
.
owner
=
THIS_MODULE
,
.
init
=
sa1100_pcmcia_sock_init
,
.
suspend
=
sa1100_pcmcia_suspend
,
.
register_callback
=
sa1100_pcmcia_register_callback
,
...
...
drivers/pcmcia/tcic.c
View file @
caf3413d
...
...
@@ -638,11 +638,6 @@ static int tcic_register_callback(unsigned int lsock, void (*handler)(void *, un
{
socket_table
[
lsock
].
handler
=
handler
;
socket_table
[
lsock
].
info
=
info
;
if
(
handler
==
NULL
)
{
MOD_DEC_USE_COUNT
;
}
else
{
MOD_INC_USE_COUNT
;
}
return
0
;
}
/* tcic_register_callback */
...
...
@@ -1003,6 +998,7 @@ static int tcic_suspend(unsigned int sock)
}
static
struct
pccard_operations
tcic_operations
=
{
.
owner
=
THIS_MODULE
,
.
init
=
tcic_init
,
.
suspend
=
tcic_suspend
,
.
register_callback
=
tcic_register_callback
,
...
...
include/pcmcia/ss.h
View file @
caf3413d
...
...
@@ -126,6 +126,7 @@ typedef struct cb_bridge_map {
* Socket operations.
*/
struct
pccard_operations
{
struct
module
*
owner
;
int
(
*
init
)(
unsigned
int
sock
);
int
(
*
suspend
)(
unsigned
int
sock
);
int
(
*
register_callback
)(
unsigned
int
sock
,
void
(
*
handler
)(
void
*
,
unsigned
int
),
void
*
info
);
...
...
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