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
b55cdbfa
Commit
b55cdbfa
authored
Jul 11, 2004
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PCMCIA] Clean up class device attribute registration and fix build error
parent
b45aa330
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
drivers/pcmcia/socket_sysfs.c
drivers/pcmcia/socket_sysfs.c
+17
-14
No files found.
drivers/pcmcia/socket_sysfs.c
View file @
b55cdbfa
...
...
@@ -47,8 +47,8 @@ static ssize_t pccard_show_type(struct class_device *dev, char *buf)
int
val
;
struct
pcmcia_socket
*
s
=
to_socket
(
dev
);
if
(
!
(
s
->
state
&
SOCKET_PRESENT
))
return
-
ENODEV
;
if
(
!
(
s
->
state
&
SOCKET_PRESENT
))
return
-
ENODEV
;
s
->
ops
->
get_status
(
s
,
&
val
);
if
(
val
&
SS_CARDBUS
)
return
sprintf
(
buf
,
"32-bit
\n
"
);
...
...
@@ -63,8 +63,8 @@ static ssize_t pccard_show_voltage(struct class_device *dev, char *buf)
int
val
;
struct
pcmcia_socket
*
s
=
to_socket
(
dev
);
if
(
!
(
s
->
state
&
SOCKET_PRESENT
))
return
-
ENODEV
;
if
(
!
(
s
->
state
&
SOCKET_PRESENT
))
return
-
ENODEV
;
s
->
ops
->
get_status
(
s
,
&
val
);
if
(
val
&
SS_3VCARD
)
return
sprintf
(
buf
,
"3.3V
\n
"
);
...
...
@@ -134,21 +134,24 @@ static struct class_device_attribute *pccard_socket_attributes[] = {
static
int
__devinit
pccard_sysfs_add_socket
(
struct
class_device
*
class_dev
)
{
unsigned
int
i
;
struct
class_device_attribute
**
attr
;
int
ret
=
0
;
for
(
i
=
0
;
(
attr
=
pccard_socket_attributes
[
i
]);
i
++
)
{
if
((
ret
=
class_device_create_file
(
class_dev
,
attr
)))
return
(
ret
);
}
return
(
ret
);
for
(
attr
=
pccard_socket_attributes
;
*
attr
;
attr
++
)
{
ret
=
class_device_create_file
(
class_dev
,
*
attr
);
if
(
ret
)
break
;
}
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_device_attribute
*
*
attr
;
for
(
attr
=
pccard_socket_attributes
;
*
attr
;
attr
++
)
class_device_remove_file
(
class_dev
,
*
attr
);
}
struct
class_interface
pccard_sysfs_interface
=
{
...
...
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