linux-4.4.1/fmt_single_name()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#g1d1fbef]
#backlinks
*説明 [#u947e151]
-パス: [[linux-4.4.1/sound/soc/soc-core.c]]
-FIXME: これは何?
--説明
**引数 [#c3b89069]
-struct device *dev
--
--[[linux-4.4.1/device]]
-int *id
--
**返り値 [#nc7f07f0]
-char *
--
**参考 [#n44b92a7]
*実装 [#u75162cc]
/*
* Simplify DAI link configuration by removing ".-1" fro...
* and sanitizing names.
*/
static char *fmt_single_name(struct device *dev, int *id)
{
char *found, name[NAME_SIZE];
int id1, id2;
if (dev_name(dev) == NULL)
return NULL;
-
--[[linux-4.4.1/dev_name()]]
strlcpy(name, dev_name(dev), NAME_SIZE);
-
--[[linux-4.4.1/strlcpy()]]
/* are we a "%s.%d" name (platform and SPI compo...
found = strstr(name, dev->driver->name);
if (found) {
-
--[[linux-4.4.1/strstr()]]
/* get ID */
if (sscanf(&found[strlen(dev->driver->na...
/* discard ID from name if ID ==...
if (*id == -1)
found[strlen(dev->driver...
}
-
--[[linux-4.4.1/sscanf()]]
--[[linux-4.4.1/strlen()]]
} else {
/* I2C component devices are named "bus-...
if (sscanf(name, "%x-%x", &id1, &id2) ==...
char tmp[NAME_SIZE];
/* create unique ID number from ...
*id = ((id1 & 0xffff) << 16) + i...
/* sanitize component name for D...
snprintf(tmp, NAME_SIZE, "%s.%s"...
strlcpy(name, tmp, NAME_SIZE);
-
--[[linux-4.4.1/snprintf()]]
} else
*id = 0;
}
return kstrdup(name, GFP_KERNEL);
-
--[[linux-4.4.1/kstrdup()]]
}
*コメント [#xcfbdda8]
終了行:
*参照元 [#g1d1fbef]
#backlinks
*説明 [#u947e151]
-パス: [[linux-4.4.1/sound/soc/soc-core.c]]
-FIXME: これは何?
--説明
**引数 [#c3b89069]
-struct device *dev
--
--[[linux-4.4.1/device]]
-int *id
--
**返り値 [#nc7f07f0]
-char *
--
**参考 [#n44b92a7]
*実装 [#u75162cc]
/*
* Simplify DAI link configuration by removing ".-1" fro...
* and sanitizing names.
*/
static char *fmt_single_name(struct device *dev, int *id)
{
char *found, name[NAME_SIZE];
int id1, id2;
if (dev_name(dev) == NULL)
return NULL;
-
--[[linux-4.4.1/dev_name()]]
strlcpy(name, dev_name(dev), NAME_SIZE);
-
--[[linux-4.4.1/strlcpy()]]
/* are we a "%s.%d" name (platform and SPI compo...
found = strstr(name, dev->driver->name);
if (found) {
-
--[[linux-4.4.1/strstr()]]
/* get ID */
if (sscanf(&found[strlen(dev->driver->na...
/* discard ID from name if ID ==...
if (*id == -1)
found[strlen(dev->driver...
}
-
--[[linux-4.4.1/sscanf()]]
--[[linux-4.4.1/strlen()]]
} else {
/* I2C component devices are named "bus-...
if (sscanf(name, "%x-%x", &id1, &id2) ==...
char tmp[NAME_SIZE];
/* create unique ID number from ...
*id = ((id1 & 0xffff) << 16) + i...
/* sanitize component name for D...
snprintf(tmp, NAME_SIZE, "%s.%s"...
strlcpy(name, tmp, NAME_SIZE);
-
--[[linux-4.4.1/snprintf()]]
} else
*id = 0;
}
return kstrdup(name, GFP_KERNEL);
-
--[[linux-4.4.1/kstrdup()]]
}
*コメント [#xcfbdda8]
ページ名: