本文整理汇总了C++中debugfs_create_dir函数的典型用法代码示例。如果您正苦于以下问题:C++ debugfs_create_dir函数的具体用法?C++ debugfs_create_dir怎么用?C++ debugfs_create_dir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debugfs_create_dir函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: lustre_init
static int __init lustre_init(void)
{
struct lnet_process_id lnet_id;
struct timespec64 ts;
int i, rc, seed[2];
BUILD_BUG_ON(sizeof(LUSTRE_VOLATILE_HDR) != LUSTRE_VOLATILE_HDR_LEN + 1);
/* print an address of _any_ initialized kernel symbol from this
* module, to allow debugging with gdb that doesn't support data
* symbols from modules.
*/
CDEBUG(D_INFO, "Lustre client module (%p).\n",
&lustre_super_operations);
rc = -ENOMEM;
ll_inode_cachep = kmem_cache_create("lustre_inode_cache",
sizeof(struct ll_inode_info), 0,
SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT,
NULL);
if (!ll_inode_cachep)
goto out_cache;
ll_file_data_slab = kmem_cache_create("ll_file_data",
sizeof(struct ll_file_data), 0,
SLAB_HWCACHE_ALIGN, NULL);
if (!ll_file_data_slab)
goto out_cache;
llite_root = debugfs_create_dir("llite", debugfs_lustre_root);
if (IS_ERR_OR_NULL(llite_root)) {
rc = llite_root ? PTR_ERR(llite_root) : -ENOMEM;
llite_root = NULL;
goto out_cache;
}
llite_kset = kset_create_and_add("llite", NULL, lustre_kobj);
if (!llite_kset) {
rc = -ENOMEM;
goto out_debugfs;
}
cfs_get_random_bytes(seed, sizeof(seed));
/* Nodes with small feet have little entropy. The NID for this
* node gives the most entropy in the low bits
*/
for (i = 0;; i++) {
if (LNetGetId(i, &lnet_id) == -ENOENT)
break;
if (LNET_NETTYP(LNET_NIDNET(lnet_id.nid)) != LOLND)
seed[0] ^= LNET_NIDADDR(lnet_id.nid);
}
ktime_get_ts64(&ts);
cfs_srand(ts.tv_sec ^ seed[0], ts.tv_nsec ^ seed[1]);
rc = vvp_global_init();
if (rc != 0)
goto out_sysfs;
cl_inode_fini_env = cl_env_alloc(&cl_inode_fini_refcheck,
LCT_REMEMBER | LCT_NOREF);
if (IS_ERR(cl_inode_fini_env)) {
rc = PTR_ERR(cl_inode_fini_env);
goto out_vvp;
}
cl_inode_fini_env->le_ctx.lc_cookie = 0x4;
rc = ll_xattr_init();
if (rc != 0)
goto out_inode_fini_env;
lustre_register_client_fill_super(ll_fill_super);
lustre_register_kill_super_cb(ll_kill_super);
lustre_register_client_process_config(ll_process_config);
return 0;
out_inode_fini_env:
cl_env_put(cl_inode_fini_env, &cl_inode_fini_refcheck);
out_vvp:
vvp_global_fini();
out_sysfs:
kset_unregister(llite_kset);
out_debugfs:
debugfs_remove(llite_root);
out_cache:
kmem_cache_destroy(ll_inode_cachep);
kmem_cache_destroy(ll_file_data_slab);
return rc;
}
开发者ID:mkrufky,项目名称:linux,代码行数:94,代码来源:super25.c
示例2: bdi_debug_init
static void bdi_debug_init(void)
{
bdi_debug_root = debugfs_create_dir("bdi", NULL);
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:4,代码来源:backing-dev.c
示例3: microblaze_debugfs_init
static int microblaze_debugfs_init(void)
{
of_debugfs_root = debugfs_create_dir("microblaze", NULL);
return of_debugfs_root == NULL;
}
开发者ID:1703011,项目名称:asuswrt-merlin,代码行数:6,代码来源:setup.c
示例4: netfront_accel_debugfs_init
void netfront_accel_debugfs_init(void)
{
#if defined(CONFIG_DEBUG_FS)
sfc_debugfs_root = debugfs_create_dir(frontend_name, NULL);
#endif
}
开发者ID:AsadRaza,项目名称:OCTEON-Linux,代码行数:6,代码来源:accel_debugfs.c
示例5: snddev_icodec_init
static int __init snddev_icodec_init(void)
{
s32 rc;
struct snddev_icodec_drv_state *icodec_drv = &snddev_icodec_drv;
rc = platform_driver_register(&snddev_icodec_driver);
if (IS_ERR_VALUE(rc))
goto error_platform_driver;
icodec_drv->rx_mclk = clk_get(NULL, "mi2s_codec_rx_m_clk");
if (IS_ERR(icodec_drv->rx_mclk))
goto error_rx_mclk;
icodec_drv->rx_sclk = clk_get(NULL, "mi2s_codec_rx_s_clk");
if (IS_ERR(icodec_drv->rx_sclk))
goto error_rx_sclk;
icodec_drv->tx_mclk = clk_get(NULL, "mi2s_codec_tx_m_clk");
if (IS_ERR(icodec_drv->tx_mclk))
goto error_tx_mclk;
icodec_drv->tx_sclk = clk_get(NULL, "mi2s_codec_tx_s_clk");
if (IS_ERR(icodec_drv->tx_sclk))
goto error_tx_sclk;
icodec_drv->lpa_codec_clk = clk_get(NULL, "lpa_codec_clk");
if (IS_ERR(icodec_drv->lpa_codec_clk))
goto error_lpa_codec_clk;
icodec_drv->lpa_core_clk = clk_get(NULL, "lpa_core_clk");
if (IS_ERR(icodec_drv->lpa_core_clk))
goto error_lpa_core_clk;
icodec_drv->lpa_p_clk = clk_get(NULL, "lpa_pclk");
if (IS_ERR(icodec_drv->lpa_p_clk))
goto error_lpa_p_clk;
#ifdef CONFIG_DEBUG_FS
debugfs_sdev_dent = debugfs_create_dir("snddev_icodec", 0);
if (debugfs_sdev_dent) {
debugfs_afelb = debugfs_create_file("afe_loopback",
S_IFREG | S_IWUGO, debugfs_sdev_dent,
(void *) "afe_loopback", &snddev_icodec_debug_fops);
debugfs_adielb = debugfs_create_file("adie_loopback",
S_IFREG | S_IWUGO, debugfs_sdev_dent,
(void *) "adie_loopback", &snddev_icodec_debug_fops);
}
#endif
mutex_init(&icodec_drv->rx_lock);
mutex_init(&icodec_drv->tx_lock);
icodec_drv->rx_active = 0;
icodec_drv->tx_active = 0;
icodec_drv->lpa = NULL;
wake_lock_init(&icodec_drv->tx_idlelock, WAKE_LOCK_IDLE,
"snddev_tx_idle");
wake_lock_init(&icodec_drv->rx_idlelock, WAKE_LOCK_IDLE,
"snddev_rx_idle");
return 0;
error_lpa_p_clk:
clk_put(icodec_drv->lpa_core_clk);
error_lpa_core_clk:
clk_put(icodec_drv->lpa_codec_clk);
error_lpa_codec_clk:
clk_put(icodec_drv->tx_sclk);
error_tx_sclk:
clk_put(icodec_drv->tx_mclk);
error_tx_mclk:
clk_put(icodec_drv->rx_sclk);
error_rx_sclk:
clk_put(icodec_drv->rx_mclk);
error_rx_mclk:
platform_driver_unregister(&snddev_icodec_driver);
error_platform_driver:
MM_ERR("encounter error\n");
return -ENODEV;
}
开发者ID:lupohirp,项目名称:Acer-Liquid-A1-2.6.35,代码行数:71,代码来源:snddev_icodec.c
示例6: debugfs_create_dir
struct dentry *vidc_get_debugfs_root(void)
{
if (vidc_debugfs_root == NULL)
vidc_debugfs_root = debugfs_create_dir("vidc", NULL);
return vidc_debugfs_root;
}
开发者ID:LeeDroid-,项目名称:BrickDrOiD-pyramid-3.0,代码行数:6,代码来源:vidc_init.c
示例7: mmc_add_card_debugfs
void mmc_add_card_debugfs(struct mmc_card *card)
{
struct mmc_host *host = card->host;
struct dentry *root;
if (!host->debugfs_root)
return;
root = debugfs_create_dir(mmc_card_id(card), host->debugfs_root);
if (IS_ERR(root))
/* Don't complain -- debugfs just isn't enabled */
return;
if (!root)
/* Complain -- debugfs is enabled, but it failed to
* create the directory. */
goto err;
card->debugfs_root = root;
if (!debugfs_create_x32("state", S_IRUSR, root, &card->state))
goto err;
if (mmc_card_mmc(card) || mmc_card_sd(card))
if (!debugfs_create_file("status", S_IRUSR, root, card,
&mmc_dbg_card_status_fops))
goto err;
if (mmc_card_mmc(card)) {
if (!debugfs_create_file("ext_csd", S_IRUSR, root, card,
&mmc_dbg_ext_csd_fops))
goto err;
if (!debugfs_create_file("eol_status", S_IRUSR, root, card,
&mmc_dbg_ext_csd_eol_fops))
goto err;
if (!debugfs_create_file("dhs_type_a", S_IRUSR, root, card,
&mmc_dbg_ext_csd_life_time_type_a_fops))
goto err;
if (!debugfs_create_file("dhs_type_b", S_IRUSR, root, card,
&mmc_dbg_ext_csd_life_time_type_b_fops))
goto err;
if (!debugfs_create_file("emmc_device_type", S_IRUSR, root,
card, &mmc_dbg_ext_csd_device_type_fops))
goto err;
if (!debugfs_create_file("firmware_version", S_IRUSR, root,
card, &mmc_dbg_ext_csd_fw_v_fops))
goto err;
if (!debugfs_create_file("bkops_status", S_IRUSR, root, card,
&mmc_dbg_ext_csd_bkops_status_fops))
goto err;
if (!debugfs_create_file("bkops_support", S_IRUSR, root, card,
&mmc_dbg_ext_csd_bkops_support_fops))
goto err;
if (!debugfs_create_file("poweron_notify", S_IRUSR, root, card,
&mmc_dbg_ext_csd_pon_notify_fops))
goto err;
if (!debugfs_create_file("hpi_support", S_IRUSR, root, card,
&mmc_dbg_ext_csd_hpi_support_fops))
goto err;
}
if (mmc_card_sd(card))
if (!debugfs_create_file("speed_class", S_IROTH, root, card,
&mmc_dbg_card_speed_class_fops))
goto err;
return;
err:
debugfs_remove_recursive(root);
card->debugfs_root = NULL;
dev_err(&card->dev, "failed to initialize debugfs\n");
}
开发者ID:Toradex-Apalis-TK1-AndroidTV,项目名称:android_kernel_nvidia_mm,代码行数:72,代码来源:debugfs.c
示例8: i2400m_debugfs_add
int i2400m_debugfs_add(struct i2400m *i2400m)
{
int result;
struct device *dev = i2400m_dev(i2400m);
struct dentry *dentry = i2400m->wimax_dev.debugfs_dentry;
struct dentry *fd;
dentry = debugfs_create_dir("i2400m", dentry);
result = PTR_ERR(dentry);
if (IS_ERR(dentry)) {
if (result == -ENODEV)
result = 0; /* No debugfs support */
goto error;
}
i2400m->debugfs_dentry = dentry;
__debugfs_register("dl_", control, dentry);
__debugfs_register("dl_", driver, dentry);
__debugfs_register("dl_", debugfs, dentry);
__debugfs_register("dl_", fw, dentry);
__debugfs_register("dl_", netdev, dentry);
__debugfs_register("dl_", rfkill, dentry);
__debugfs_register("dl_", rx, dentry);
__debugfs_register("dl_", tx, dentry);
fd = debugfs_create_size_t("tx_in", 0400, dentry,
&i2400m->tx_in);
result = PTR_ERR(fd);
if (IS_ERR(fd) && result != -ENODEV) {
dev_err(dev, "Can't create debugfs entry "
"tx_in: %d\n", result);
goto error;
}
fd = debugfs_create_size_t("tx_out", 0400, dentry,
&i2400m->tx_out);
result = PTR_ERR(fd);
if (IS_ERR(fd) && result != -ENODEV) {
dev_err(dev, "Can't create debugfs entry "
"tx_out: %d\n", result);
goto error;
}
fd = debugfs_create_u32("state", 0600, dentry,
&i2400m->state);
result = PTR_ERR(fd);
if (IS_ERR(fd) && result != -ENODEV) {
dev_err(dev, "Can't create debugfs entry "
"state: %d\n", result);
goto error;
}
/*
* Trace received messages from user space
*
* In order to tap the bidirectional message stream in the
* 'msg' pipe, user space can read from the 'msg' pipe;
* however, due to limitations in libnl, we can't know what
* the different applications are sending down to the kernel.
*
* So we have this hack where the driver will echo any message
* received on the msg pipe from user space [through a call to
* wimax_dev->op_msg_from_user() into
* i2400m_op_msg_from_user()] into the 'trace' pipe that this
* driver creates.
*
* So then, reading from both the 'trace' and 'msg' pipes in
* user space will provide a full dump of the traffic.
*
* Write 1 to activate, 0 to clear.
*
* It is not really very atomic, but it is also not too
* critical.
*/
fd = debugfs_create_u8("trace_msg_from_user", 0600, dentry,
&i2400m->trace_msg_from_user);
result = PTR_ERR(fd);
if (IS_ERR(fd) && result != -ENODEV) {
dev_err(dev, "Can't create debugfs entry "
"trace_msg_from_user: %d\n", result);
goto error;
}
fd = debugfs_create_netdev_queue_stopped("netdev_queue_stopped",
dentry, i2400m);
result = PTR_ERR(fd);
if (IS_ERR(fd) && result != -ENODEV) {
dev_err(dev, "Can't create debugfs entry "
"netdev_queue_stopped: %d\n", result);
goto error;
}
fd = debugfs_create_file("rx_stats", 0600, dentry, i2400m,
&i2400m_rx_stats_fops);
result = PTR_ERR(fd);
if (IS_ERR(fd) && result != -ENODEV) {
dev_err(dev, "Can't create debugfs entry "
"rx_stats: %d\n", result);
goto error;
}
//.........这里部分代码省略.........
开发者ID:n-aizu,项目名称:rowboat-kernel,代码行数:101,代码来源:debugfs.c
示例9: b43legacy_debugfs_add_device
void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev)
{
struct b43legacy_dfsentry *e;
struct b43legacy_txstatus_log *log;
char devdir[16];
B43legacy_WARN_ON(!dev);
e = kzalloc(sizeof(*e), GFP_KERNEL);
if (!e) {
b43legacyerr(dev->wl, "debugfs: add device OOM\n");
return;
}
e->dev = dev;
log = &e->txstatlog;
log->log = kcalloc(B43legacy_NR_LOGGED_TXSTATUS,
sizeof(struct b43legacy_txstatus), GFP_KERNEL);
if (!log->log) {
b43legacyerr(dev->wl, "debugfs: add device txstatus OOM\n");
kfree(e);
return;
}
log->end = -1;
spin_lock_init(&log->lock);
dev->dfsentry = e;
snprintf(devdir, sizeof(devdir), "%s", wiphy_name(dev->wl->hw->wiphy));
e->subdir = debugfs_create_dir(devdir, rootdir);
if (!e->subdir || IS_ERR(e->subdir)) {
if (e->subdir == ERR_PTR(-ENODEV)) {
b43legacydbg(dev->wl, "DebugFS (CONFIG_DEBUG_FS) not "
"enabled in kernel config\n");
} else {
b43legacyerr(dev->wl, "debugfs: cannot create %s directory\n",
devdir);
}
dev->dfsentry = NULL;
kfree(log->log);
kfree(e);
return;
}
#define ADD_FILE(name, mode) \
do { \
struct dentry *d; \
d = debugfs_create_file(__stringify(name), \
mode, e->subdir, dev, \
&fops_##name.fops); \
e->file_##name.dentry = NULL; \
if (!IS_ERR(d)) \
e->file_##name.dentry = d; \
} while (0)
ADD_FILE(tsf, 0600);
ADD_FILE(ucode_regs, 0400);
ADD_FILE(shm, 0400);
ADD_FILE(txstat, 0400);
ADD_FILE(restart, 0200);
#undef ADD_FILE
b43legacy_add_dynamic_debug(dev);
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:64,代码来源:debugfs.c
示例10: b43legacy_debugfs_init
void b43legacy_debugfs_init(void)
{
rootdir = debugfs_create_dir(KBUILD_MODNAME, NULL);
if (IS_ERR(rootdir))
rootdir = NULL;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:6,代码来源:debugfs.c
示例11: mali_sysfs_register
int mali_sysfs_register(struct mali_dev *device, dev_t dev, const char *mali_dev_name)
{
int err = 0;
struct device * mdev;
device->mali_class = class_create(THIS_MODULE, mali_dev_name);
if (IS_ERR(device->mali_class))
{
err = PTR_ERR(device->mali_class);
goto init_class_err;
}
mdev = device_create(device->mali_class, NULL, dev, NULL, mali_dev_name);
if (IS_ERR(mdev))
{
err = PTR_ERR(mdev);
goto init_mdev_err;
}
mali_debugfs_dir = debugfs_create_dir(mali_dev_name, NULL);
if(ERR_PTR(-ENODEV) == mali_debugfs_dir)
{
/* Debugfs not supported. */
mali_debugfs_dir = NULL;
}
else
{
if(NULL != mali_debugfs_dir)
{
/* Debugfs directory created successfully; create files now */
struct dentry *mali_power_dir;
struct dentry *mali_gp_dir;
struct dentry *mali_pp_dir;
struct dentry *mali_l2_dir;
#if MALI_INTERNAL_TIMELINE_PROFILING_ENABLED
struct dentry *mali_profiling_dir;
#endif
mali_power_dir = debugfs_create_dir("power", mali_debugfs_dir);
if (mali_power_dir != NULL)
{
debugfs_create_file("power_events", 0400, mali_power_dir, NULL, &power_events_fops);
}
mali_gp_dir = debugfs_create_dir("gp", mali_debugfs_dir);
if (mali_gp_dir != NULL)
{
struct dentry *mali_gp_all_dir;
u32 ci;
struct mali_cluster *cluster;
mali_gp_all_dir = debugfs_create_dir("all", mali_gp_dir);
if (mali_gp_all_dir != NULL)
{
debugfs_create_file("counter_src0", 0400, mali_gp_all_dir, NULL, &gp_all_counter_src0_fops);
debugfs_create_file("counter_src1", 0400, mali_gp_all_dir, NULL, &gp_all_counter_src1_fops);
}
ci = 0;
cluster = mali_cluster_get_global_cluster(ci);
while (NULL != cluster)
{
u32 gi = 0;
struct mali_group *group = mali_cluster_get_group(cluster, gi);
while (NULL != group)
{
struct mali_gp_core *gp_core = mali_group_get_gp_core(group);
if (NULL != gp_core)
{
struct dentry *mali_gp_gpx_dir;
mali_gp_gpx_dir = debugfs_create_dir("gp0", mali_gp_dir);
if (NULL != mali_gp_gpx_dir)
{
debugfs_create_file("counter_src0", 0600, mali_gp_gpx_dir, gp_core, &gp_gpx_counter_src0_fops);
debugfs_create_file("counter_src1", 0600, mali_gp_gpx_dir, gp_core, &gp_gpx_counter_src1_fops);
}
break; /* no need to look for any other GP cores */
}
/* try next group */
gi++;
group = mali_cluster_get_group(cluster, gi);
}
/* try next cluster */
ci++;
cluster = mali_cluster_get_global_cluster(ci);
}
}
mali_pp_dir = debugfs_create_dir("pp", mali_debugfs_dir);
if (mali_pp_dir != NULL)
{
struct dentry *mali_pp_all_dir;
u32 ci;
struct mali_cluster *cluster;
mali_pp_all_dir = debugfs_create_dir("all", mali_pp_dir);
if (mali_pp_all_dir != NULL)
{
debugfs_create_file("counter_src0", 0400, mali_pp_all_dir, NULL, &pp_all_counter_src0_fops);
//.........这里部分代码省略.........
开发者ID:4yush5663,项目名称:android_kernel_samsung_i9500,代码行数:101,代码来源:mali_kernel_sysfs.c
示例12: bfin_debug_mmrs_init
static int __init bfin_debug_mmrs_init(void)
{
struct dentry *top, *parent;
pr_info("debug-mmrs: setting up Blackfin MMR debugfs\n");
top = debugfs_create_dir("blackfin", NULL);
if (top == NULL)
return -1;
parent = debugfs_create_dir("core_regs", top);
debugfs_create_file("cclk", S_IRUSR, parent, NULL, &fops_debug_cclk);
debugfs_create_file("sclk", S_IRUSR, parent, NULL, &fops_debug_sclk);
debugfs_create_x32("last_seqstat", S_IRUSR, parent, &last_seqstat);
D_SYSREG(cycles);
D_SYSREG(cycles2);
D_SYSREG(emudat);
D_SYSREG(seqstat);
D_SYSREG(syscfg);
parent = debugfs_create_dir("ctimer", top);
D32(TCNTL);
D32(TCOUNT);
D32(TPERIOD);
D32(TSCALE);
parent = debugfs_create_dir("cec", top);
D32(EVT0);
D32(EVT1);
D32(EVT2);
D32(EVT3);
D32(EVT4);
D32(EVT5);
D32(EVT6);
D32(EVT7);
D32(EVT8);
D32(EVT9);
D32(EVT10);
D32(EVT11);
D32(EVT12);
D32(EVT13);
D32(EVT14);
D32(EVT15);
D32(EVT_OVERRIDE);
D32(IMASK);
D32(IPEND);
D32(ILAT);
D32(IPRIO);
parent = debugfs_create_dir("debug", top);
D32(DBGSTAT);
D32(DSPID);
parent = debugfs_create_dir("mmu", top);
D32(SRAM_BASE_ADDRESS);
D32(DCPLB_ADDR0);
D32(DCPLB_ADDR10);
D32(DCPLB_ADDR11);
D32(DCPLB_ADDR12);
D32(DCPLB_ADDR13);
D32(DCPLB_ADDR14);
D32(DCPLB_ADDR15);
D32(DCPLB_ADDR1);
D32(DCPLB_ADDR2);
D32(DCPLB_ADDR3);
D32(DCPLB_ADDR4);
D32(DCPLB_ADDR5);
D32(DCPLB_ADDR6);
D32(DCPLB_ADDR7);
D32(DCPLB_ADDR8);
D32(DCPLB_ADDR9);
D32(DCPLB_DATA0);
D32(DCPLB_DATA10);
D32(DCPLB_DATA11);
D32(DCPLB_DATA12);
D32(DCPLB_DATA13);
D32(DCPLB_DATA14);
D32(DCPLB_DATA15);
D32(DCPLB_DATA1);
D32(DCPLB_DATA2);
D32(DCPLB_DATA3);
D32(DCPLB_DATA4);
D32(DCPLB_DATA5);
D32(DCPLB_DATA6);
D32(DCPLB_DATA7);
D32(DCPLB_DATA8);
D32(DCPLB_DATA9);
D32(DCPLB_FAULT_ADDR);
D32(DCPLB_STATUS);
D32(DMEM_CONTROL);
D32(DTEST_COMMAND);
D32(DTEST_DATA0);
D32(DTEST_DATA1);
D32(ICPLB_ADDR0);
D32(ICPLB_ADDR1);
D32(ICPLB_ADDR2);
D32(ICPLB_ADDR3);
D32(ICPLB_ADDR4);
//.........这里部分代码省略.........
开发者ID:Blackburn29,项目名称:PsycoKernel,代码行数:101,代码来源:debug-mmrs.c
示例13: bfin_debug_mmrs_can
static void __init __maybe_unused
bfin_debug_mmrs_can(struct dentry *parent, unsigned long base, int num)
{
static struct dentry *am, *mb;
int i, j;
char buf[32], *_buf = REGS_STR_PFX(buf, CAN, num);
if (!am) {
am = debugfs_create_dir("am", parent);
mb = debugfs_create_dir("mb", parent);
}
__CAN(MC1, mc1);
__CAN(MD1, md1);
__CAN(TRS1, trs1);
__CAN(TRR1, trr1);
__CAN(TA1, ta1);
__CAN(AA1, aa1);
__CAN(RMP1, rmp1);
__CAN(RML1, rml1);
__CAN(MBTIF1, mbtif1);
__CAN(MBRIF1, mbrif1);
__CAN(MBIM1, mbim1);
__CAN(RFH1, rfh1);
__CAN(OPSS1, opss1);
__CAN(MC2, mc2);
__CAN(MD2, md2);
__CAN(TRS2, trs2);
__CAN(TRR2, trr2);
__CAN(TA2, ta2);
__CAN(AA2, aa2);
__CAN(RMP2, rmp2);
__CAN(RML2, rml2);
__CAN(MBTIF2, mbtif2);
__CAN(MBRIF2, mbrif2);
__CAN(MBIM2, mbim2);
__CAN(RFH2, rfh2);
__CAN(OPSS2, opss2);
__CAN(CLOCK, clock);
__CAN(TIMING, timing);
__CAN(DEBUG, debug);
__CAN(STATUS, status);
__CAN(CEC, cec);
__CAN(GIS, gis);
__CAN(GIM, gim);
__CAN(GIF, gif);
__CAN(CONTROL, control);
__CAN(INTR, intr);
__CAN(VERSION, version);
__CAN(MBTD, mbtd);
__CAN(EWR, ewr);
__CAN(ESR, esr);
__CAN(UCCNT, uccnt);
__CAN(UCRC, ucrc);
__CAN(UCCNF, uccnf);
__CAN(VERSION2, version2);
for (i = 0; i < 32; ++i) {
sprintf(_buf, "AM%02iL", i);
debugfs_create_x16(buf, S_IRUSR|S_IWUSR, am,
(u16 *)(base + CAN_OFF(msk[i].aml)));
sprintf(_buf, "AM%02iH", i);
debugfs_create_x16(buf, S_IRUSR|S_IWUSR, am,
(u16 *)(base + CAN_OFF(msk[i].amh)));
for (j = 0; j < 3; ++j) {
sprintf(_buf, "MB%02i_DATA%i", i, j);
debugfs_create_x16(buf, S_IRUSR|S_IWUSR, mb,
(u16 *)(base + CAN_OFF(chl[i].data[j*2])));
}
sprintf(_buf, "MB%02i_LENGTH", i);
debugfs_create_x16(buf, S_IRUSR|S_IWUSR, mb,
(u16 *)(base + CAN_OFF(chl[i].dlc)));
sprintf(_buf, "MB%02i_TIMESTAMP", i);
debugfs_create_x16(buf, S_IRUSR|S_IWUSR, mb,
(u16 *)(base + CAN_OFF(chl[i].tsv)));
sprintf(_buf, "MB%02i_ID0", i);
debugfs_create_x16(buf, S_IRUSR|S_IWUSR, mb,
(u16 *)(base + CAN_OFF(chl[i].id0)));
sprintf(_buf, "MB%02i_ID1", i);
debugfs_create_x16(buf, S_IRUSR|S_IWUSR, mb,
(u16 *)(base + CAN_OFF(chl[i].id1)));
}
}
开发者ID:Blackburn29,项目名称:PsycoKernel,代码行数:87,代码来源:debug-mmrs.c
示例14: mmc_add_host_debugfs
void mmc_add_host_debugfs(struct mmc_host *host)
{
struct dentry *root;
root = debugfs_create_dir(mmc_hostname(host), NULL);
if (IS_ERR(root))
/* Don't complain -- debugfs just isn't enabled */
return;
if (!root)
/* Complain -- debugfs is enabled, but it failed to
* create the directory. */
goto err_root;
host->debugfs_root = root;
if (!debugfs_create_file("ios", S_IRUSR, root, host, &mmc_ios_fops))
goto err_node;
if (!debugfs_create_file("clock", S_IRUSR | S_IWUSR, root, host,
&mmc_clock_fops))
goto err_node;
if (!debugfs_create_file("max_clock", S_IRUSR | S_IWUSR, root, host,
&mmc_max_clock_fops))
goto err_node;
#ifdef CONFIG_MMC_CLKGATE
if (!debugfs_create_u32("clk_delay", (S_IRUSR | S_IWUSR),
root, &host->clk_delay))
goto err_node;
#endif
#ifdef CONFIG_FAIL_MMC_REQUEST
if (fail_request)
setup_fault_attr(&fail_default_attr, fail_request);
host->fail_mmc_request = fail_default_attr;
if (IS_ERR(fault_create_debugfs_attr("fail_mmc_request",
root,
&host->fail_mmc_request)))
goto err_node;
#endif
#ifdef CONFIG_MMC_CMD_LOG
if (!debugfs_create_file("cmd_log", S_IRUSR, root, host,
&mmc_cmd_log_fops))
goto err_node;
if (!debugfs_create_file("cmd_log_mode", S_IRUSR | S_IWUSR, root, host,
&mmc_cmd_log_mode_fops))
goto err_node;
if (!debugfs_create_file("cmd_log_size", S_IRUSR | S_IWUSR, root, host,
&mmc_cmd_log_size_fops))
goto err_node;
#endif
#ifdef CONFIG_MMC_CMD_LOG
if (!debugfs_create_file("cmd_log", S_IRUSR, root, host,
&mmc_cmd_log_fops))
goto err_node;
if (!debugfs_create_file("cmd_log_mode", S_IRUSR | S_IWUSR, root, host,
&mmc_cmd_log_mode_fops))
goto err_node;
if (!debugfs_create_file("cmd_log_size", S_IRUSR | S_IWUSR, root, host,
&mmc_cmd_log_size_fops))
goto err_node;
#endif
return;
err_node:
debugfs_remove_recursive(root);
host->debugfs_root = NULL;
err_root:
dev_err(&host->class_dev, "failed to initialize debugfs\n");
}
开发者ID:mlachwani,项目名称:Android_4.4.2_MotoG_Kernel,代码行数:70,代码来源:debugfs.c
示例15: xgbe_debugfs_init
void xgbe_debugfs_init(struct xgbe_prv_data *pdata)
{
struct dentry *pfile;
char *buf;
/* Set defaults */
pdata->debugfs_xgmac_reg = 0;
pdata->debugfs_xpcs_mmd = 1;
pdata->debugfs_xpcs_reg = 0;
buf = kasprintf(GFP_KERNEL, "amd-xgbe-%s", pdata->netdev->name);
if (!buf)
return;
pdata->xgbe_debugfs = debugfs_create_dir(buf, NULL);
if (!pdata->xgbe_debugfs) {
netdev_err(pdata->netdev, "debugfs_create_dir failed\n");
kfree(buf);
return;
}
pfile = debugfs_create_file("xgmac_register", 0600,
pdata->xgbe_debugfs, pdata,
&xgmac_reg_addr_fops);
if (!pfile)
netdev_err(pdata->netdev, "debugfs_create_file failed\n");
pfile = debugfs_create_file("xgmac_register_value", 0600,
pdata->xgbe_debugfs, pdata,
&xgmac_reg_value_fops);
if (!pfile)
netdev_err(pdata->netdev, "debugfs_create_file failed\n");
pfile = debugfs_create_file("xpcs_mmd", 0600,
pdata->xgbe_debugfs, pdata,
&xpcs_mmd_fops);
if (!pfile)
netdev_err(pdata->netdev, "debugfs_create_file failed\n");
pfile = debugfs_create_file("xpcs_register", 0600,
pdata->xgbe_debugfs, pdata,
&xpcs_reg_addr_fops);
if (!pfile)
netdev_err(pdata->netdev, "debugfs_create_file failed\n");
pfile = debugfs_create_file("xpcs_register_value", 0600,
pdata->xgbe_debugfs, pdata,
&xpcs_reg_value_fops);
if (!pfile)
netdev_err(pdata->netdev, "debugfs_create_file failed\n");
if (pdata->xprop_regs) {
pfile = debugfs_create_file("xprop_register", 0600,
pdata->xgbe_debugfs, pdata,
&xprop_reg_addr_fops);
if (!pfile)
netdev_err(pdata->netdev,
"debugfs_create_file failed\n");
pfile = debugfs_create_file("xprop_register_value", 0600,
pdata->xgbe_debugfs, pdata,
&xprop_reg_value_fops);
if (!pfile)
netdev_err(pdata->netdev,
"debugfs_create_file failed\n");
}
if (pdata->xi2c_regs) {
pfile = debugfs_create_file("xi2c_register", 0600,
pdata->xgbe_debugfs, pdata,
&xi2c_reg_addr_fops);
if (!pfile)
netdev_err(pdata->netdev,
"debugfs_create_file failed\n");
pfile = debugfs_create_file("xi2c_register_value", 0600,
pdata->xgbe_debugfs, pdata,
&xi2c_reg_value_fops);
if (!pfile)
netdev_err(pdata->netdev,
"debugfs_create_file failed\n");
}
kfree(buf);
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:85,代码来源:xgbe-debugfs.c
示例16: debugfs_create_dir
static __init struct dentry *tegra_edp_debugfs_dir(void)
{
return debugfs_create_dir("edp", NULL);
}
开发者ID:Klozz,项目名称:Grouper-3.4,代码行数:4,代码来源:edp.c
示例17: ath9k_init_debug
int ath9k_init_debug(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
struct ath_softc *sc = (struct ath_softc *) common->priv;
sc->debug.debugfs_phy = debugfs_create_dir("ath9k",
sc->hw->wiphy->debugfsdir);
if (!sc->debug.debugfs_phy)
return -ENOMEM;
#ifdef CPTCFG_ATH_DEBUG
debugfs_create_file("debug", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
sc, &fops_debug);
#endif
ath9k_dfs_init_debug(sc);
ath9k_tx99_init_debug(sc);
ath9k_spectral_init_debug(sc);
debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_dma);
debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_interrupt);
debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_xmit);
debugfs_create_file("queues", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_queues);
debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
&sc->tx.txq_max_pending[IEEE80211_AC_BK]);
debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
&sc->tx.txq_max_pending[IEEE80211_AC_BE]);
debugfs_create_u32("qlen_vi", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
&sc->tx.txq_max_pending[IEEE80211_AC_VI]);
debugfs_create_u32("qlen_vo", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
&sc->tx.txq_max_pending[IEEE80211_AC_VO]);
debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_misc);
debugfs_create_file("reset", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_reset);
debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_recv);
debugfs_create_file("phy_err", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_phy_err);
debugfs_create_u8("rx_chainmask", S_IRUSR, sc->debug.debugfs_phy,
&ah->rxchainmask);
debugfs_create_u8("tx_chainmask", S_IRUSR, sc->debug.debugfs_phy,
&ah->txchainmask);
debugfs_create_file("ani", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy, sc, &fops_ani);
debugfs_create_bool("paprd", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
&sc->sc_ah->config.enable_paprd);
debugfs_create_file("regidx", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
sc, &fops_regidx);
debugfs_create_file("regval", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
sc, &fops_regval);
debugfs_create_bool("ignore_extcca", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy,
&ah->config.cwm_ignore_extcca);
debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_regdump);
debugfs_create_file("dump_nfcal", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_dump_nfcal);
debugfs_create_file("base_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_base_eeprom);
debugfs_create_file("modal_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_modal_eeprom);
debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask);
debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy, &sc->sc_ah->gpio_val);
debugfs_create_file("antenna_diversity", S_IRUSR,
sc->debug.debugfs_phy, sc, &fops_antenna_diversity);
#ifdef CPTCFG_ATH9K_BTCOEX_SUPPORT
debugfs_create_file("bt_ant_diversity", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy, sc, &fops_bt_ant_diversity);
debugfs_create_file("btcoex", S_IRUSR, sc->debug.debugfs_phy, sc,
&fops_btcoex);
#endif
return 0;
}
开发者ID:houlixin,项目名称:BBB-TISDK,代码行数:81,代码来源:debug.c
示例18: fan53555_regulator_probe
static int fan53555_regulator_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct fan53555_device_info *di;
struct fan53555_platform_data *pdata;
struct regulator_config config = { };
unsigned int val;
int ret;
if (client->dev.of_node)
pdata = fan53555_get_of_platform_data(client);
else
pdata = client->dev.platform_data;
if (!pdata || !pdata->regulator) {
dev_err(&client->dev, "Platform data not found!\n");
return -ENODEV;
}
di = devm_kzalloc(&client->dev, sizeof(struct fan53555_device_info),
GFP_KERNEL);
if (!di) {
dev_err(&client->dev, "Failed to allocate device info data!\n");
return -ENOMEM;
}
di->regmap = devm_regmap_init_i2c(client, &fan53555_regmap_config);
if (IS_ERR(di->regmap)) {
dev_err(&client->dev, "Failed to allocate regmap!\n");
return PTR_ERR(di->regmap);
}
di->dev = &client->dev;
di->regulator = pdata->regulator;
i2c_set_clientdata(client, di);
/* Get chip ID */
ret = fan53555_read(di, FAN53555_ID1, &val);
if (ret < 0) {
dev_err(&client->dev, "Failed to get chip ID!\n");
return -ENODEV;
}
di->chip_id = val & DIE_ID;
/* Get chip revision */
ret = fan53555_read(di, FAN53555_ID2, &val);
if (ret < 0) {
dev_err(&client->dev, "Failed to get chip Rev!\n");
return -ENODEV;
}
di->chip_rev = val & DIE_REV;
dev_info(&client->dev, "FAN53555 Option[%d] Rev[%d] Detected!\n",
di->chip_id, di->chip_rev);
/* Device init */
ret = fan53555_device_setup(di, pdata);
if (ret < 0) {
dev_err(&client->dev, "Failed to setup device!\n");
return ret;
}
/* Set up from device tree */
if (client->dev.of_node) {
ret = fan53555_of_init(client->dev.of_node, di);
if (ret)
return ret;
}
/* Register regulator */
config.dev = di->dev;
config.init_data = di->regulator;
config.regmap = di->regmap;
config.driver_data = di;
config.of_node = client->dev.of_node;
ret = fan53555_regulator_register(di, &config);
if (ret < 0)
dev_err(&client->dev, "Failed to register regulator!\n");
di->debug_root = debugfs_create_dir("fan53555", NULL);
if (!di->debug_root)
dev_err(&client->dev, "Couldn't create debug dir\n");
if (di->debug_root) {
struct dentry *ent;
ent = debugfs_create_x32("address", S_IFREG | S_IWUSR | S_IRUGO,
di->debug_root,
&(di->peek_poke_address));
if (!ent)
dev_err(&client->dev, "Couldn't create address debug file rc = %d\n",
ret);
ent = debugfs_create_file("data", S_IFREG | S_IWUSR | S_IRUGO,
di->debug_root, di,
&poke_poke_debug_ops);
if (!ent)
dev_err(&client->dev, "Couldn't create data debug file rc = %d\n",
ret);
}
return ret;
}
开发者ID:AudioGod,项目名称:Gods_kernel_yu_msm8916,代码行数:98,代码来源:fan53555.c
示例19: adf_probe
static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct adf_accel_dev *accel_dev;
struct adf_accel_pci *accel_pci_dev;
struct adf_hw_device_data *hw_data;
char name[ADF_DEVICE_NAME_LENGTH];
unsigned int i, bar_nr;
int ret;
switch (ent->device) {
case ADF_DH895XCC_PCI_DEVICE_ID:
break;
default:
dev_err(&pdev->dev, "Invalid device 0x%x.\n", ent->device);
return -ENODEV;
}
if (num_possible_nodes() > 1 && dev_to_node(&pdev->dev) < 0) {
/* If the accelerator is connected to a node with no memory
* there is no point in using the accelerator since the remote
* memory transaction will be very slow. */
dev_err(&pdev->dev, "Invalid NUMA configuration.\n");
return -EINVAL;
}
accel_dev = kzalloc_node(sizeof(*accel_dev), GFP_KERNEL,
dev_to_node(&pdev->dev));
if (!accel_dev)
return -ENOMEM;
INIT_LIST_HEAD(&accel_dev->crypto_list);
/* Add accel device to accel table.
* This should be called before adf_cleanup_accel is called */
if (adf_devmgr_add_dev(accel_dev)) {
dev_err(&pdev->dev, "Failed to add new accelerator device.\n");
kfree(accel_dev);
return -EFAULT;
}
accel_dev->owner = THIS_MODULE;
/* Allocate and configure device configuration structure */
hw_data = kzalloc_node(sizeof(*hw_data), GFP_KERNEL,
dev_to_node(&pdev->dev));
if (!hw_data) {
ret = -ENOMEM;
goto out_err;
}
accel_dev->hw_device = hw_data;
switch (ent->device) {
case ADF_DH895XCC_PCI_DEVICE_ID:
adf_init_hw_data_dh895xcc(accel_dev->hw_device);
break;
default:
return -ENODEV;
}
accel_pci_dev = &accel_dev->accel_pci_dev;
pci_read_config_byte(pdev, PCI_REVISION_ID, &accel_pci_dev->revid);
pci_read_config_dword(pdev, ADF_DH895XCC_FUSECTL_OFFSET,
&hw_data->fuses);
/* Get Accelerators and Accelerators Engines masks */
hw_data->accel_mask = hw_data->get_accel_mask(hw_data->fuses);
hw_data->ae_mask = hw_data->get_ae_mask(hw_data->fuses);
accel_pci_dev->sku = hw_data->get_sku(hw_data);
accel_pci_dev->pci_dev = pdev;
/* If the device has no acceleration engines then ignore it. */
if (!hw_data->accel_mask || !hw_data->ae_mask ||
((~hw_data->ae_mask) & 0x01)) {
dev_err(&pdev->dev, "No acceleration units found");
ret = -EFAULT;
goto out_err;
}
/* Create dev top level debugfs entry */
snprintf(name, sizeof(name), "%s%s_dev%d", ADF_DEVICE_NAME_PREFIX,
hw_data->dev_class->name, hw_data->instance_id);
accel_dev->debugfs_dir = debugfs_create_dir(name, NULL);
if (!accel_dev->debugfs_dir) {
dev_err(&pdev->dev, "Could not create debugfs dir\n");
ret = -EINVAL;
goto out_err;
}
/* Create device configuration table */
ret = adf_cfg_dev_add(accel_dev);
if (ret)
goto out_err;
pcie_set_readrq(pdev, 1024);
/* enable PCI device */
if (pci_enable_device(pdev)) {
ret = -EFAULT;
goto out_err;
}
/* set dma identifier */
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
//.........这里部分代码省略.........
开发者ID:hemaprathaban,项目名称:linux-1,代码行数:101,代码来源:adf_drv.c
示例20: lbs_debugfs_init
void lbs_debugfs_init(void)
{
if (!lbs_dir)
lbs_dir = debugfs_create_dir("lbs_wireless", NULL);
}
开发者ID:03199618,项目名称:linux,代码行数:5,代码来源:debugfs.c
注:本文中的debugfs_create_dir函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论