sdio: add modalias support

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
This commit is contained in:
Pierre Ossman
2007-06-17 11:34:23 +02:00
parent 9eb3a94d02
commit d59b66c7a5
2 changed files with 40 additions and 1 deletions

View File

@ -68,7 +68,26 @@ static int
sdio_bus_uevent(struct device *dev, char **envp, int num_envp, char *buf,
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;
}