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
b45aa330
Commit
b45aa330
authored
Jul 11, 2004
by
Dominik Brodowski
Committed by
Russell King
Jul 11, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PCMCIA] Use a class interface to provide sysfs attributes.
Patch from Dominik Brodowski
parent
61e4f592
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
drivers/pcmcia/cs.c
drivers/pcmcia/cs.c
+8
-10
drivers/pcmcia/cs_internal.h
drivers/pcmcia/cs_internal.h
+2
-1
drivers/pcmcia/socket_sysfs.c
drivers/pcmcia/socket_sysfs.c
+16
-3
No files found.
drivers/pcmcia/cs.c
View file @
b45aa330
...
...
@@ -695,13 +695,6 @@ static int pccardd(void *__skt)
skt
->
thread
=
NULL
;
complete_and_exit
(
&
skt
->
thread_done
,
0
);
}
if
(
pccard_sysfs_init
(
skt
))
{
printk
(
KERN_WARNING
"PCMCIA: unable to register sysfs attributes for socket 0x%p
\n
"
,
skt
);
skt
->
thread
=
NULL
;
class_device_unregister
(
&
skt
->
dev
);
complete_and_exit
(
&
skt
->
thread_done
,
0
);
}
complete
(
&
skt
->
thread_done
);
add_wait_queue
(
&
skt
->
thread_wait
,
&
wait
);
...
...
@@ -2175,16 +2168,21 @@ EXPORT_SYMBOL(pcmcia_socket_class);
static
int
__init
init_pcmcia_cs
(
void
)
{
printk
(
KERN_INFO
"%s
\n
"
,
release
);
printk
(
KERN_INFO
" %s
\n
"
,
options
);
int
ret
;
printk
(
KERN_INFO
"%s
\n
"
,
release
);
printk
(
KERN_INFO
" %s
\n
"
,
options
);
return
class_register
(
&
pcmcia_socket_class
);
ret
=
class_register
(
&
pcmcia_socket_class
);
if
(
ret
)
return
(
ret
);
return
class_interface_register
(
&
pccard_sysfs_interface
);
}
static
void
__exit
exit_pcmcia_cs
(
void
)
{
printk
(
KERN_INFO
"unloading Kernel Card Services
\n
"
);
release_resource_db
();
class_interface_unregister
(
&
pccard_sysfs_interface
);
class_unregister
(
&
pcmcia_socket_class
);
}
...
...
drivers/pcmcia/cs_internal.h
View file @
b45aa330
...
...
@@ -193,8 +193,9 @@ int adjust_resource_info(client_handle_t handle, adjust_t *adj);
void
release_resource_db
(
void
);
/* In socket_sysfs.c */
int
pccard_sysfs_init
(
struct
pcmcia_socket
*
s
)
;
extern
struct
class_interface
pccard_sysfs_interface
;
/* In cs.c */
extern
struct
rw_semaphore
pcmcia_socket_list_rwsem
;
extern
struct
list_head
pcmcia_socket_list
;
...
...
drivers/pcmcia/socket_sysfs.c
View file @
b45aa330
...
...
@@ -132,14 +132,27 @@ static struct class_device_attribute *pccard_socket_attributes[] = {
NULL
,
};
int
pccard_sysfs_init
(
struct
pcmcia_socket
*
s
)
static
int
__devinit
pccard_sysfs_add_socket
(
struct
class_device
*
class_dev
)
{
struct
class_device_attribute
*
attr
;
unsigned
int
i
;
int
ret
=
0
;
for
(
i
=
0
;
(
attr
=
pccard_socket_attributes
[
i
]);
i
++
)
{
if
((
ret
=
class_device_create_file
(
&
s
->
dev
,
attr
)))
if
((
ret
=
class_device_create_file
(
class_
dev
,
attr
)))
return
(
ret
);
}
return
(
ret
);
}
static
void
__devexit
pccard_sysfs_remove_socket
(
struct
class_device
*
class_dev
)
{
struct
class_device_attribute
*
attr
;
unsigned
int
i
;
for
(
i
=
0
;
(
attr
=
pccard_socket_attributes
[
i
]);
i
++
)
class_device_remove_file
(
class_dev
,
attr
);
}
struct
class_interface
pccard_sysfs_interface
=
{
.
class
=
&
pcmcia_socket_class
,
.
add
=
&
pccard_sysfs_add_socket
,
.
remove
=
__devexit_p
(
&
pccard_sysfs_remove_socket
),
};
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