您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ sysdev_create_file函数代码示例

51自学网 2021-06-03 08:38:07
  C++
这篇教程C++ sysdev_create_file函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中sysdev_create_file函数的典型用法代码示例。如果您正苦于以下问题:C++ sysdev_create_file函数的具体用法?C++ sysdev_create_file怎么用?C++ sysdev_create_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了sysdev_create_file函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: init_rttest

static int init_rttest(void){	int ret, i;	spin_lock_init(&rttest_lock);	for (i = 0; i < MAX_RT_TEST_MUTEXES; i++)		rt_mutex_init(&mutexes[i]);	ret = sysdev_class_register(&rttest_sysclass);	if (ret)		return ret;	for (i = 0; i < MAX_RT_TEST_THREADS; i++) {		ret = init_test_thread(i);		if (ret)			break;		ret = sysdev_create_file(&thread_data[i].sysdev, &attr_status);		if (ret)			break;		ret = sysdev_create_file(&thread_data[i].sysdev, &attr_command);		if (ret)			break;	}	printk("Initializing RT-Tester: %s/n", ret ? "Failed" : "OK" );	return ret;}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:29,


示例2: omap_battery_init_devicefs

static int __init omap_battery_init_devicefs(void){	const struct archos_charge_config *charge_cfg;	int ret;	sysdev_class_register(&omap_battery_sysclass);		ret = sysdev_register(&omap_battery0_device);	if (ret < 0)		return ret;#ifdef CONFIG_POWER_SUPPLY	ret = platform_device_register(&archos_battery_device);	if (ret < 0) {		printk(KERN_INFO "omap_battery_init_devicefs: failed to register battery device/n");		return ret;	}#endif	sysdev_create_file(&omap_battery0_device, &attr_battery0_charge_state);	sysdev_create_file(&omap_battery0_device, &attr_battery0_charge_level);	sysdev_create_file(&omap_battery0_device, &attr_battery0_charge_usblevel);	/* charge pin */	charge_cfg = omap_get_config( ARCHOS_TAG_CHARGE, struct archos_charge_config );	if (charge_cfg && (hardware_rev < charge_cfg->nrev)) {		charge_gpio = charge_cfg->rev[hardware_rev];		GPIO_INIT_OUTPUT( charge_gpio );		omap_set_gpio_dataout( GPIO_PIN( charge_gpio ), 1);		} else		printk(KERN_DEBUG "omap_battery_init_devicefs: no board configuration found/n");		return 0;}
开发者ID:smartassfox,项目名称:archos_kernel_27,代码行数:34,


示例3: dma_create_sysfs_files

int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info){	struct sys_device *dev = &chan->dev;	char name[16];	int ret;	dev->id  = chan->vchan;	dev->cls = &dma_sysclass;	ret = sysdev_register(dev);	if (ret)		return ret;	ret |= sysdev_create_file(dev, &attr_dev_id);	ret |= sysdev_create_file(dev, &attr_count);	ret |= sysdev_create_file(dev, &attr_mode);	ret |= sysdev_create_file(dev, &attr_flags);	ret |= sysdev_create_file(dev, &attr_config);	if (unlikely(ret)) {		dev_err(&info->pdev->dev, "Failed creating attrs/n");		return ret;	}	snprintf(name, sizeof(name), "dma%d", chan->chan);	return sysfs_create_link(&info->pdev->dev.kobj, &dev->kobj, name);}
开发者ID:71eh,项目名称:open80211s,代码行数:27,


示例4: dvfs_sysdev_ctrl_init

static int dvfs_sysdev_ctrl_init(void){	int err;	err = sysdev_class_register(&dvfs_sysclass);	if (!err)		err = sysdev_register(&dvfs_device);	if (!err) {		err = sysdev_create_file(&dvfs_device, &attr_enable);		err = sysdev_create_file(&dvfs_device, &attr_status);	}	return err;}
开发者ID:twobob,项目名称:KK_kernel,代码行数:14,


示例5: register_node

/* * register_node - Setup a driverfs device for a node. * @num - Node number to use when creating the device. * * Initialize and register the node device. */int __init register_node(struct node *node, int num, struct node *parent){	int error;	node->cpumap = node_to_cpumask(num);	node->sysdev.id = num;	node->sysdev.cls = &node_class;	error = sys_device_register(&node->sysdev);	if (!error){		sysdev_create_file(&node->sysdev, &attr_cpumap);		sysdev_create_file(&node->sysdev, &attr_meminfo);	}	return error;}
开发者ID:sarnobat,项目名称:knoppix,代码行数:21,


示例6: register_mmu_stats

static int register_mmu_stats(struct sys_device *s){	if (!mmu_stats_supported)		return 0;	sysdev_create_file(s, &attr_mmustat_enable);	return sysfs_create_group(&s->kobj, &mmu_stat_group);}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:7,


示例7: cmm_sysfs_register

/** * cmm_sysfs_register - Register with sysfs * * Return value: * 	0 on success / other on failure **/static int cmm_sysfs_register(struct sys_device *sysdev){	int i, rc;	if ((rc = sysdev_class_register(&cmm_sysdev_class)))		return rc;	sysdev->id = 0;	sysdev->cls = &cmm_sysdev_class;	if ((rc = sysdev_register(sysdev)))		goto class_unregister;	for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) {		if ((rc = sysdev_create_file(sysdev, cmm_attrs[i])))			goto fail;	}	return 0;fail:	while (--i >= 0)		sysdev_remove_file(sysdev, cmm_attrs[i]);	sysdev_unregister(sysdev);class_unregister:	sysdev_class_unregister(&cmm_sysdev_class);	return rc;}
开发者ID:jakev,项目名称:CobraDroidBeta,代码行数:34,


示例8: register_node

/* * register_node - Setup a sysfs device for a node. * @num - Node number to use when creating the device. * * Initialize and register the node device. */int register_node(struct node *node, int num, struct node *parent){	int error;	node->sysdev.id = num;	node->sysdev.cls = &node_class;	error = sysdev_register(&node->sysdev);	if (!error){		sysdev_create_file(&node->sysdev, &attr_cpumap);		sysdev_create_file(&node->sysdev, &attr_meminfo);		sysdev_create_file(&node->sysdev, &attr_numastat);		sysdev_create_file(&node->sysdev, &attr_distance);	}	return error;}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:22,


示例9: topology_init

static int __init topology_init(void){	int cpu;	register_nodes();	register_cpu_notifier(&sysfs_cpu_nb);	for_each_possible_cpu(cpu) {		struct cpu *c = &per_cpu(cpu_devices, cpu);		/*		 * For now, we just see if the system supports making		 * the RTAS calls for CPU hotplug.  But, there may be a		 * more comprehensive way to do this for an individual		 * CPU.  For instance, the boot cpu might never be valid		 * for hotplugging.		 */		if (ppc_md.cpu_die)			c->hotpluggable = 1;		if (cpu_online(cpu) || c->hotpluggable) {			register_cpu(c, cpu);			sysdev_create_file(&c->sysdev, &attr_physical_id);		}		if (cpu_online(cpu))			register_cpu_online(cpu);	}	return 0;}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:32,


示例10: register_cpu_online

static void register_cpu_online(unsigned int cpu){	struct cpu *c = &per_cpu(cpu_devices, cpu);	struct sys_device *s = &c->sysdev;	int i;	for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++)		sysdev_create_file(s, &cpu_core_attrs[i]);	register_mmu_stats(s);}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:11,


示例11: dma_create_sysfs_files

int __init dma_create_sysfs_files(struct dma_channel *chan){	struct sys_device *dev = &chan->dev;	int ret;	dev->id  = chan->chan;	dev->cls = &dma_sysclass;	ret = sysdev_register(dev);	if (ret)		return ret;	sysdev_create_file(dev, &attr_dev_id);	sysdev_create_file(dev, &attr_count);	sysdev_create_file(dev, &attr_mode);	sysdev_create_file(dev, &attr_flags);	sysdev_create_file(dev, &attr_config);	return 0;}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:20,


示例12: leds_init

static int __init leds_init(void){	int ret;	ret = sysdev_class_register(&leds_sysclass);	if (ret == 0)		ret = sysdev_register(&leds_device);	if (ret == 0)		ret = sysdev_create_file(&leds_device, &attr_event);        if (ret == 0)                idle_notifier_register(&leds_idle_nb);	return ret;}
开发者ID:freak007,项目名称:hox-ncx-freakmod,代码行数:12,


示例13: init_cpu_idle_sysfs

static int __init init_cpu_idle_sysfs(void){	int error = sysdev_class_register(&cpu_idle_sysclass);	if (!error)		error = sysdev_register(&device_cpu_idle);	if (!error)		error = sysdev_create_file(				&device_cpu_idle, &attr_idle_count);	return error;}
开发者ID:twobob,项目名称:KK_kernel,代码行数:12,


示例14: mx50_accessory_sysdev_ctrl_init

static int mx50_accessory_sysdev_ctrl_init(void){	int err = 0;	err = sysdev_class_register(&mx50_accessory_sysclass);	if (!err)		err = sysdev_register(&mx50_accessory_device);	if (!err) {		sysdev_create_file(&mx50_accessory_device, &attr_mx50_accessory_state);	}	return err;}
开发者ID:twobob,项目名称:KK_kernel,代码行数:13,


示例15: cpu_add_sysdev_attr

int cpu_add_sysdev_attr(struct sysdev_attribute *attr){	int cpu;	mutex_lock(&cpu_mutex);	for_each_possible_cpu(cpu) {		sysdev_create_file(get_cpu_sysdev(cpu), attr);	}	mutex_unlock(&cpu_mutex);	return 0;}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:13,


示例16: register_node

/* * register_node - Setup a sysfs device for a node. * @num - Node number to use when creating the device. * * Initialize and register the node device. */int register_node(struct node *node, int num, struct node *parent){	int error;	node->sysdev.id = num;	node->sysdev.cls = &node_class;	error = sysdev_register(&node->sysdev);	if (!error){		sysdev_create_file(&node->sysdev, &attr_cpumap);		sysdev_create_file(&node->sysdev, &attr_cpulist);		sysdev_create_file(&node->sysdev, &attr_meminfo);		sysdev_create_file(&node->sysdev, &attr_numastat);		sysdev_create_file(&node->sysdev, &attr_distance);		scan_unevictable_register_node(node);		hugetlb_register_node(node);		compaction_register_node(node);	}	return error;}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:29,


示例17: qfprom_create_files

static int __init qfprom_create_files(struct sys_device *dev,					struct sysdev_attribute files[],					int size){	int i;	for (i = 0; i < size; i++) {		int err = sysdev_create_file(dev, &files[i]);		if (err) {			pr_err("%s: sysdev_create_file(%s)=%d/n",				__func__, files[i].attr.name, err);			return err;		}	}	return 0;}
开发者ID:darcyg,项目名称:ap_project_v2,代码行数:15,


示例18: register_cpu_online

static void register_cpu_online(unsigned int cpu){	struct cpu *c = &per_cpu(cpu_devices, cpu);	struct sys_device *s = &c->sysdev;	struct sysdev_attribute *attrs, *pmc_attrs;	int i, nattrs;	if (!firmware_has_feature(FW_FEATURE_ISERIES) &&			cpu_has_feature(CPU_FTR_SMT))		sysdev_create_file(s, &attr_smt_snooze_delay);	/* PMC stuff */	switch (cur_cpu_spec->pmc_type) {	case PPC_PMC_IBM:		attrs = ibm_common_attrs;		nattrs = sizeof(ibm_common_attrs) / sizeof(struct sysdev_attribute);		pmc_attrs = ibm_pmc_attrs;		break;	case PPC_PMC_PA6T:		/* PA Semi starts counting at PMC0 */		attrs = pa6t_attrs;		nattrs = sizeof(pa6t_attrs) / sizeof(struct sysdev_attribute);		pmc_attrs = NULL;		break;	default:		attrs = NULL;		nattrs = 0;		pmc_attrs = NULL;	}	for (i = 0; i < nattrs; i++)		sysdev_create_file(s, &attrs[i]);	if (pmc_attrs)		for (i = 0; i < cur_cpu_spec->num_pmcs; i++)			sysdev_create_file(s, &pmc_attrs[i]);	if (cpu_has_feature(CPU_FTR_MMCRA))		sysdev_create_file(s, &attr_mmcra);	if (cpu_has_feature(CPU_FTR_PURR))		sysdev_create_file(s, &attr_purr);	if (cpu_has_feature(CPU_FTR_SPURR))		sysdev_create_file(s, &attr_spurr);	if (cpu_has_feature(CPU_FTR_DSCR))		sysdev_create_file(s, &attr_dscr);}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:49,


示例19: topology_init

static int __init topology_init(void){	int cpu;	struct node *parent = NULL;	register_nodes();	register_cpu_notifier(&sysfs_cpu_nb);	for_each_cpu(cpu) {		struct cpu *c = &per_cpu(cpu_devices, cpu);#ifdef CONFIG_NUMA		/* The node to which a cpu belongs can't be known		 * until the cpu is made present.		 */		parent = NULL;		if (cpu_present(cpu))			parent = &node_devices[cpu_to_node(cpu)];#endif		/*		 * For now, we just see if the system supports making		 * the RTAS calls for CPU hotplug.  But, there may be a		 * more comprehensive way to do this for an individual		 * CPU.  For instance, the boot cpu might never be valid		 * for hotplugging.		 */		if (!ppc_md.cpu_die)			c->no_control = 1;		if (cpu_online(cpu) || (c->no_control == 0)) {			register_cpu(c, cpu, parent);			sysdev_create_file(&c->sysdev, &attr_physical_id);		}		if (cpu_online(cpu))			register_cpu_online(cpu);	}	return 0;}
开发者ID:1x23,项目名称:unifi-gpl,代码行数:42,


示例20: register_cpu

/* * register_cpu - Setup a driverfs device for a CPU. * @cpu - cpu->hotpluggable field set to 1 will generate a control file in *	  sysfs for this CPU. * @num - CPU number to use when creating the device. * * Initialize and register the CPU device. */int __devinit register_cpu(struct cpu *cpu, int num){	int error;	cpu->node_id = cpu_to_node(num);	cpu->sysdev.id = num;	cpu->sysdev.cls = &cpu_sysdev_class;	error = sysdev_register(&cpu->sysdev);	if (!error && cpu->hotpluggable)		register_cpu_control(cpu);	if (!error)		cpu_sys_devices[num] = &cpu->sysdev;	if (!error)		register_cpu_under_node(num, cpu_to_node(num));#ifdef CONFIG_KEXEC	if (!error)		error = sysdev_create_file(&cpu->sysdev, &attr_crash_notes);#endif	return error;}
开发者ID:B-Rich,项目名称:linux_drivers,代码行数:30,


示例21: msm_led_trigger_register_sysdev

/* * MSM LED Trigger Sys Device Register * * 1. Torch Mode *     enable: $ echo "1" > /sys/devices/system/led-flash/led-flash0/torch *    disable: $ echo "0" > /sys/devices/system/led-flash/led-flash0/torch * * 2. Flash Mode *     enable: $ echo "1" > /sys/devices/system/led-flash/led-flash0/flash *    disable: $ echo "0" > /sys/devices/system/led-flash/led-flash0/flash */static int32_t msm_led_trigger_register_sysdev(struct msm_led_flash_ctrl_t *fctrl){	int32_t i, rc;	rc = sysdev_class_register(&msm_led_trigger_sysdev_class);	if (rc) {			return rc;	}	msm_led_trigger_sysdev.id = 0;	msm_led_trigger_sysdev.cls = &msm_led_trigger_sysdev_class;	rc = sysdev_register(&msm_led_trigger_sysdev);	if (rc) {		sysdev_class_unregister(&msm_led_trigger_sysdev_class);		return rc;	}	for (i = 0; i < ARRAY_SIZE(msm_led_trigger_sysdev_attrs); ++i) {		rc = sysdev_create_file(&msm_led_trigger_sysdev, msm_led_trigger_sysdev_attrs[i]);		if (rc) {			goto msm_led_trigger_register_sysdev_failed;		}	}	msm_led_trigger_sysdev_fctrl = fctrl;	return 0;msm_led_trigger_register_sysdev_failed:	while (--i >= 0) sysdev_remove_file(&msm_led_trigger_sysdev, msm_led_trigger_sysdev_attrs[i]);	sysdev_unregister(&msm_led_trigger_sysdev);	sysdev_class_unregister(&msm_led_trigger_sysdev_class);	return rc;}
开发者ID:jimsmith80,项目名称:android_kernel_warp4,代码行数:48,


示例22: ftm_register_sysdev

/* * Sys device register * * sysdev file: * * /sys/devices/system/zte_ftm/zte_ftm0/fusion * /sys/devices/system/zte_ftm/zte_ftm0/simlocking */static int32_t ftm_register_sysdev(struct sys_device *sysdev){	int32_t ret;	int32_t i;	ret = sysdev_class_register(&ftm_sysdev_class);	if (ret) {		return ret;	}	sysdev->id = 0;	sysdev->cls = &ftm_sysdev_class;	ret = sysdev_register(sysdev);	if (ret) {		sysdev_class_unregister(&ftm_sysdev_class);		return ret;	}	for (i = 0; i < ARRAY_SIZE(ftm_attrs); i++) {		ret = sysdev_create_file(sysdev, ftm_attrs[i]);		if (ret) {			goto ftm_fail;		}	}	return 0;ftm_fail:	while (--i >= 0) sysdev_remove_file(sysdev, ftm_attrs[i]);	sysdev_unregister(sysdev);	sysdev_class_unregister(&ftm_sysdev_class);	  return ret;}
开发者ID:downthemachine,项目名称:android_kernel_zte_aurora,代码行数:45,


示例23: register_balloon

static int __init register_balloon(struct sys_device *sysdev){	int i, error;	error = sysdev_class_register(&balloon_sysdev_class);	if (error)		return error;	sysdev->id = 0;	sysdev->cls = &balloon_sysdev_class;	error = sysdev_register(sysdev);	if (error) {		sysdev_class_unregister(&balloon_sysdev_class);		return error;	}	for (i = 0; i < ARRAY_SIZE(balloon_attrs); i++) {		error = sysdev_create_file(sysdev, balloon_attrs[i]);		if (error)			goto fail;	}	error = sysfs_create_group(&sysdev->kobj, &balloon_info_group);	if (error)		goto fail;		return 0; fail:	while (--i >= 0)		sysdev_remove_file(sysdev, balloon_attrs[i]);	sysdev_unregister(sysdev);	sysdev_class_unregister(&balloon_sysdev_class);	return error;}
开发者ID:Jinjian0609,项目名称:UVP-Tools,代码行数:36,


示例24: register_cpu

/* * register_cpu - Setup a driverfs device for a CPU. * @cpu - Callers can set the cpu->no_control field to 1, to indicate not to *		  generate a control file in sysfs for this CPU. * @num - CPU number to use when creating the device. * * Initialize and register the CPU device. */int __devinit register_cpu(struct cpu *cpu, int num, struct node *root){	int error;	cpu->node_id = cpu_to_node(num);	cpu->sysdev.id = num;	cpu->sysdev.cls = &cpu_sysdev_class;	error = sysdev_register(&cpu->sysdev);	if (!error && root)		error = sysfs_create_link(&root->sysdev.kobj,					  &cpu->sysdev.kobj,					  kobject_name(&cpu->sysdev.kobj));	if (!error && !cpu->no_control)		register_cpu_control(cpu);	if (!error)		cpu_sys_devices[num] = &cpu->sysdev;#ifdef CONFIG_KEXEC	if (!error)		error = sysdev_create_file(&cpu->sysdev, &attr_crash_notes);#endif	return error;}
开发者ID:ena30,项目名称:snake-os,代码行数:32,


示例25: topology_init

static int __init topology_init(void){    int cpu;    for_each_possible_cpu(cpu) {        struct cpu *c = &per_cpu(cpu_devices, cpu);        register_cpu(c, cpu);#ifdef CONFIG_PERFORMANCE_COUNTERS        sysdev_create_file(&c->sysdev, &attr_pc0event);        sysdev_create_file(&c->sysdev, &attr_pc0count);        sysdev_create_file(&c->sysdev, &attr_pc1event);        sysdev_create_file(&c->sysdev, &attr_pc1count);        sysdev_create_file(&c->sysdev, &attr_pccycles);        sysdev_create_file(&c->sysdev, &attr_pcenable);#endif    }    return 0;}
开发者ID:274914765,项目名称:C,代码行数:21,


示例26: bq27541_battery_sysdev_ctrl_init

static int bq27541_battery_sysdev_ctrl_init(void){	int err = 0;	err = sysdev_class_register(&bq27541_battery_sysclass);	if (!err)		err = sysdev_register(&bq27541_battery_device);	if (!err) {		sysdev_create_file(&bq27541_battery_device, &attr_battery_id);		sysdev_create_file(&bq27541_battery_device, &attr_battery_current);		sysdev_create_file(&bq27541_battery_device, &attr_battery_voltage);		sysdev_create_file(&bq27541_battery_device, &attr_battery_temperature);		sysdev_create_file(&bq27541_battery_device, &attr_battery_capacity);		sysdev_create_file(&bq27541_battery_device, &attr_battery_mAH);		sysdev_create_file(&bq27541_battery_device, &attr_battery_voltage_thresholds);		sysdev_create_file(&bq27541_battery_device, &attr_battery_polling_intervals);		sysdev_create_file(&bq27541_battery_device, &attr_battery_temp_thresholds);		sysdev_create_file(&bq27541_battery_device, &attr_battery_i2c_address);		sysdev_create_file(&bq27541_battery_device, &attr_battery_error);		sysdev_create_file(&bq27541_battery_device, &attr_battery_suspend_current);		sysdev_create_file(&bq27541_battery_device, &attr_battery_current_diags);		sysdev_create_file(&bq27541_battery_device, &attr_battery_suspend_current_diags);		sysdev_create_file(&bq27541_battery_device, &attr_battery_cycl);		sysdev_create_file(&bq27541_battery_device, &attr_battery_lmd);		sysdev_create_file(&bq27541_battery_device, &attr_battery_cyct);		sysdev_create_file(&bq27541_battery_device, &attr_resume_stats);		sysdev_create_file(&bq27541_battery_device, &attr_battreg);		sysdev_create_file(&bq27541_battery_device, &attr_battreg_value);	}	return err;}
开发者ID:fread-ink,项目名称:fread-kernel-k4,代码行数:32,


示例27: summit_smb347_probe

static int summit_smb347_probe(struct i2c_client *client, const struct i2c_device_id *id){	struct summit_smb347_info *info;	int ret = 0;#ifdef SUMMIT_SMB347_DEBUG	int i = 0;#endif	int error = 0;	unsigned char value = 0xff;	info = kzalloc(sizeof(*info), GFP_KERNEL);	if (!info) {		return -ENOMEM;	}	client->addr = SUMMIT_SMB347_I2C_ADDRESS;	i2c_set_clientdata(client, info);	info->client = client;	info->charger.name = "summit_smb347";	info->charger.type = POWER_SUPPLY_TYPE_MAINS;	info->charger.get_property = smb347_get_property;	info->charger.properties = smb347_charger_props;	info->charger.num_properties = ARRAY_SIZE(smb347_charger_props);	ret = power_supply_register(&client->dev, &info->charger);	if (ret) {		dev_err(&client->dev, "failed: power supply register/n");		i2c_set_clientdata(client, NULL);		kfree(info);		return ret;	}	summit_smb347_i2c_client = info->client;	summit_smb347_i2c_client->addr = SUMMIT_SMB347_I2C_ADDRESS;	if (summit_smb347_read_id(&summit_smb347_id_reg) < 0)		return -ENODEV;	printk(KERN_INFO "Summit SMB347 detected, chip_id=0x%x/n", summit_smb347_id_reg);	ret = request_irq(summit_smb347_i2c_client->irq, summit_smb347_irq,			IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING, "summit_smb347", NULL);	if (ret != 0) {		printk(KERN_ERR "Failed to request IRQ %d: %d/n",				summit_smb347_i2c_client->irq, ret);	}	summit_smb347_init_registers();#ifdef SUMMIT_SMB347_DEBUG	for (i = 0; i <= 0xE; i++) {		ret = summit_smb347_i2c_read(i, &value);		printk(KERN_INFO "summit_smb347: reg=%d, value=0x%x/n", i, value);	}	for (i = 0x30; i <= 0x3F; i++) {		ret = summit_smb347_i2c_read(i, &value);		printk(KERN_INFO "summit_smb347: reg=%d, value=0x%x/n", i, value);	}#endif	error = sysdev_class_register(&smb347_reg_sysclass);	if (!error)		error = sysdev_register(&device_smb347_reg);	if (!error)		error = sysdev_create_file(&device_smb347_reg, &attr_smb347_reg);	error = sysdev_class_register(&smb347_register_sysclass);	if (!error)		error = sysdev_register(&device_smb347_register);	if (!error)		error = sysdev_create_file(&device_smb347_register, &attr_smb347_register);	return 0;}
开发者ID:fread-ink,项目名称:fread-kernel-k4,代码行数:79,


示例28: register_cpu_online

static void register_cpu_online(unsigned int cpu){	struct cpu *c = &per_cpu(cpu_devices, cpu);	struct sys_device *s = &c->sysdev;#ifndef CONFIG_PPC_ISERIES	if (cpu_has_feature(CPU_FTR_SMT))		sysdev_create_file(s, &attr_smt_snooze_delay);#endif	/* PMC stuff */	sysdev_create_file(s, &attr_mmcr0);	sysdev_create_file(s, &attr_mmcr1);	if (cpu_has_feature(CPU_FTR_MMCRA))		sysdev_create_file(s, &attr_mmcra);	if (cur_cpu_spec->num_pmcs >= 1)		sysdev_create_file(s, &attr_pmc1);	if (cur_cpu_spec->num_pmcs >= 2)		sysdev_create_file(s, &attr_pmc2);	if (cur_cpu_spec->num_pmcs >= 3)		sysdev_create_file(s, &attr_pmc3);	if (cur_cpu_spec->num_pmcs >= 4)		sysdev_create_file(s, &attr_pmc4);	if (cur_cpu_spec->num_pmcs >= 5)		sysdev_create_file(s, &attr_pmc5);	if (cur_cpu_spec->num_pmcs >= 6)		sysdev_create_file(s, &attr_pmc6);	if (cur_cpu_spec->num_pmcs >= 7)		sysdev_create_file(s, &attr_pmc7);	if (cur_cpu_spec->num_pmcs >= 8)		sysdev_create_file(s, &attr_pmc8);	if (cpu_has_feature(CPU_FTR_SMT))		sysdev_create_file(s, &attr_purr);}
开发者ID:1x23,项目名称:unifi-gpl,代码行数:38,


示例29: register_cpu_control

static void __cpuinit register_cpu_control(struct cpu *cpu){	sysdev_create_file(&cpu->sysdev, &attr_online);}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:4,



注:本文中的sysdev_create_file函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ sysdev_driver_register函数代码示例
C++ sysdev_class_register函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。