Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KED Linux Kernel Fork
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KED Software Projects
Miscellaneous
KED Linux Kernel Fork
Commits
d59b66c7
Commit
d59b66c7
authored
17 years ago
by
Pierre Ossman
Browse files
Options
Downloads
Patches
Plain Diff
sdio: add modalias support
Signed-off-by:
Pierre Ossman
<
drzeus@drzeus.cx
>
parent
9eb3a94d
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/mmc/core/sdio_bus.c
+20
-1
20 additions, 1 deletion
drivers/mmc/core/sdio_bus.c
scripts/mod/file2alias.c
+20
-0
20 additions, 0 deletions
scripts/mod/file2alias.c
with
40 additions
and
1 deletion
drivers/mmc/core/sdio_bus.c
+
20
−
1
View file @
d59b66c7
...
@@ -68,7 +68,26 @@ static int
...
@@ -68,7 +68,26 @@ static int
sdio_bus_uevent
(
struct
device
*
dev
,
char
**
envp
,
int
num_envp
,
char
*
buf
,
sdio_bus_uevent
(
struct
device
*
dev
,
char
**
envp
,
int
num_envp
,
char
*
buf
,
int
buf_size
)
int
buf_size
)
{
{
envp
[
0
]
=
NULL
;
struct
sdio_func
*
func
=
dev_to_sdio_func
(
dev
);
int
i
=
0
,
length
=
0
;
if
(
add_uevent_var
(
envp
,
num_envp
,
&
i
,
buf
,
buf_size
,
&
length
,
"SDIO_CLASS=%02X"
,
func
->
class
))
return
-
ENOMEM
;
if
(
add_uevent_var
(
envp
,
num_envp
,
&
i
,
buf
,
buf_size
,
&
length
,
"SDIO_ID=%04X:%04X"
,
func
->
vendor
,
func
->
device
))
return
-
ENOMEM
;
if
(
add_uevent_var
(
envp
,
num_envp
,
&
i
,
buf
,
buf_size
,
&
length
,
"MODALIAS=sdio:c%02Xv%04Xd%04X"
,
func
->
class
,
func
->
vendor
,
func
->
device
))
return
-
ENOMEM
;
envp
[
i
]
=
NULL
;
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
scripts/mod/file2alias.c
+
20
−
0
View file @
d59b66c7
...
@@ -484,6 +484,22 @@ static int do_parisc_entry(const char *filename, struct parisc_device_id *id,
...
@@ -484,6 +484,22 @@ static int do_parisc_entry(const char *filename, struct parisc_device_id *id,
return
1
;
return
1
;
}
}
/* Looks like: sdio:cNvNdN. */
static
int
do_sdio_entry
(
const
char
*
filename
,
struct
sdio_device_id
*
id
,
char
*
alias
)
{
id
->
class
=
TO_NATIVE
(
id
->
class
);
id
->
vendor
=
TO_NATIVE
(
id
->
vendor
);
id
->
device
=
TO_NATIVE
(
id
->
device
);
strcpy
(
alias
,
"sdio:"
);
ADD
(
alias
,
"c"
,
id
->
class
!=
(
__u8
)
SDIO_ANY_ID
,
id
->
class
);
ADD
(
alias
,
"v"
,
id
->
vendor
!=
(
__u16
)
SDIO_ANY_ID
,
id
->
vendor
);
ADD
(
alias
,
"d"
,
id
->
device
!=
(
__u16
)
SDIO_ANY_ID
,
id
->
device
);
return
1
;
}
/* Ignore any prefix, eg. v850 prepends _ */
/* Ignore any prefix, eg. v850 prepends _ */
static
inline
int
sym_is
(
const
char
*
symbol
,
const
char
*
name
)
static
inline
int
sym_is
(
const
char
*
symbol
,
const
char
*
name
)
{
{
...
@@ -599,6 +615,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
...
@@ -599,6 +615,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
do_table
(
symval
,
sym
->
st_size
,
do_table
(
symval
,
sym
->
st_size
,
sizeof
(
struct
parisc_device_id
),
"parisc"
,
sizeof
(
struct
parisc_device_id
),
"parisc"
,
do_parisc_entry
,
mod
);
do_parisc_entry
,
mod
);
else
if
(
sym_is
(
symname
,
"__mod_sdio_device_table"
))
do_table
(
symval
,
sym
->
st_size
,
sizeof
(
struct
sdio_device_id
),
"sdio"
,
do_sdio_entry
,
mod
);
}
}
/* Now add out buffered information to the generated C source */
/* Now add out buffered information to the generated C source */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment