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

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

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

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

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

示例1: node_match

static int node_match(struct device *dev, void *data){	struct of_device *op = to_of_device(dev);	struct device_node *dp = data;	return (op->node == dp);}
开发者ID:janrinze,项目名称:loox7xxport,代码行数:7,


示例2: ibmebus_unregister_device

static int ibmebus_unregister_device(struct device *dev){	device_remove_file(dev, &dev_attr_name);	of_device_unregister(to_of_device(dev));	return 0;}
开发者ID:420GrayFox,项目名称:dsl-n55u-bender,代码行数:7,


示例3: name_show

static ssize_t name_show(struct device *dev,				struct device_attribute *attr, char *buf){	struct of_device *ofdev;	ofdev = to_of_device(dev);	return sprintf(buf, "%s/n", ofdev->node->name);}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:8,


示例4: of_platform_device_shutdown

static void of_platform_device_shutdown(struct device *dev){    struct of_device *of_dev = to_of_device(dev);    struct of_platform_driver *drv = to_of_platform_driver(dev->driver);    if (dev->driver && drv->shutdown)        drv->shutdown(of_dev);}
开发者ID:274914765,项目名称:C,代码行数:8,


示例5: of_release_dev

/** * of_release_dev - free an of device structure when all users of it are finished. * @dev: device that's been disconnected * * Will be called only by the device core when all users of this of device are * done. */void of_release_dev(struct device *dev){	struct of_device *ofdev;	ofdev = to_of_device(dev);	of_node_put(ofdev->node);	kfree(ofdev);}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:15,


示例6: of_platform_device_remove

static int of_platform_device_remove(struct device *dev){	struct of_device * of_dev = to_of_device(dev);	struct of_platform_driver * drv = to_of_platform_driver(dev->driver);	if (dev->driver && drv->remove)		drv->remove(of_dev);	return 0;}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:9,


示例7: of_platform_device_suspend

static int of_platform_device_suspend(struct device *dev, pm_message_t state){	struct of_device * of_dev = to_of_device(dev);	struct of_platform_driver * drv = to_of_platform_driver(dev->driver);	int error = 0;	if (dev->driver && drv->suspend)		error = drv->suspend(of_dev, state);	return error;}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:10,


示例8: of_platform_device_resume

static int of_platform_device_resume(struct device * dev){	struct of_device * of_dev = to_of_device(dev);	struct of_platform_driver * drv = to_of_platform_driver(dev->driver);	int error = 0;	if (dev->driver && drv->resume)		error = drv->resume(of_dev);	return error;}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:10,


示例9: bus_find_device

struct of_device *of_find_device_by_phandle(phandle ph){	struct device *dev;	dev = bus_find_device(&of_platform_bus_type,			      NULL, &ph, of_dev_phandle_match);	if (dev)		return to_of_device(dev);	return NULL;}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:10,


示例10: device_to_node

static inline unsigned long device_to_node(struct device *hwdev){#ifdef CONFIG_NUMA	struct of_device *ofdev = to_of_device(hwdev);	return ofdev->numa_node;#else	return 0;#endif}
开发者ID:dduval,项目名称:kernel-rhel5,代码行数:10,


示例11: bus_find_device

struct of_device *of_find_device_by_node(struct device_node *dp){	struct device *dev = bus_find_device(&of_platform_bus_type, NULL,					     dp, node_match);	if (dev)		return to_of_device(dev);	return NULL;}
开发者ID:janrinze,项目名称:loox7xxport,代码行数:10,


示例12: of_platform_legacy_resume

static int of_platform_legacy_resume(struct device *dev){	struct of_device *of_dev = to_of_device(dev);	struct of_platform_driver *drv = to_of_platform_driver(dev->driver);	int ret = 0;	if (dev->driver && drv->resume)		ret = drv->resume(of_dev);	return ret;}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:10,


示例13: of_platform_legacy_suspend

static int of_platform_legacy_suspend(struct device *dev, pm_message_t mesg){	struct of_device *of_dev = to_of_device(dev);	struct of_platform_driver *drv = to_of_platform_driver(dev->driver);	int ret = 0;	if (dev->driver && drv->suspend)		ret = drv->suspend(of_dev, mesg);	return ret;}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:10,


示例14: axon_ram_sysfs_ecc

static ssize_taxon_ram_sysfs_ecc(struct device *dev, struct device_attribute *attr, char *buf){	struct of_device *device = to_of_device(dev);	struct axon_ram_bank *bank = device->dev.platform_data;	BUG_ON(!bank);	return sprintf(buf, "%ld/n", bank->ecc_counter);}
开发者ID:dduval,项目名称:kernel-rhel5,代码行数:10,


示例15: modalias_show

static ssize_t modalias_show(struct device *dev,				struct device_attribute *attr, char *buf){	struct of_device *ofdev = to_of_device(dev);	ssize_t len = 0;	len = of_device_get_modalias(ofdev, buf, PAGE_SIZE - 2);	buf[len] = '/n';	buf[len+1] = 0;	return len+1;}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:11,


示例16: of_platform_bus_match

static int of_platform_bus_match(struct device *dev, struct device_driver *drv){	struct of_device * of_dev = to_of_device(dev);	struct of_platform_driver * of_drv = to_of_platform_driver(drv);	const struct of_device_id * matches = of_drv->match_table;	if (!matches)		return 0;	return of_match_device(matches, of_dev) != NULL;}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:11,


示例17: get_device

struct of_device *of_dev_get(struct of_device *dev){	struct device *tmp;	if (!dev)		return NULL;	tmp = get_device(&dev->dev);	if (tmp)		return to_of_device(tmp);	else		return NULL;}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:12,


示例18: of_device_uevent

int of_device_uevent(struct device *dev, struct kobj_uevent_env *env){	struct of_device *ofdev;	const char *compat;	int seen = 0, cplen, sl;	if (!dev)		return -ENODEV;	ofdev = to_of_device(dev);	if (add_uevent_var(env, "OF_NAME=%s", ofdev->dev.of_node->name))		return -ENOMEM;	if (add_uevent_var(env, "OF_TYPE=%s", ofdev->dev.of_node->type))		return -ENOMEM;        /* Since the compatible field can contain pretty much anything         * it's not really legal to split it out with commas. We split it         * up using a number of environment variables instead. */	compat = of_get_property(ofdev->dev.of_node, "compatible", &cplen);	while (compat && *compat && cplen > 0) {		if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat))			return -ENOMEM;		sl = strlen (compat) + 1;		compat += sl;		cplen -= sl;		seen++;	}	if (add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen))		return -ENOMEM;	/* modalias is trickier, we add it in 2 steps */	if (add_uevent_var(env, "MODALIAS="))		return -ENOMEM;	sl = of_device_get_modalias(ofdev, &env->buf[env->buflen-1],				    sizeof(env->buf) - env->buflen);	if (sl >= (sizeof(env->buf) - env->buflen))		return -ENOMEM;	env->buflen += sl;	return 0;}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:46,


示例19: do_pd_setup

static int do_pd_setup(struct fs_enet_private *fep){	struct of_device *ofdev = to_of_device(fep->dev);	fep->interrupt = of_irq_to_resource(ofdev->node, 0, NULL);	if (fep->interrupt == NO_IRQ)		return -EINVAL;	fep->scc.sccp = of_iomap(ofdev->node, 0);	if (!fep->scc.sccp)		return -EINVAL;	fep->scc.ep = of_iomap(ofdev->node, 1);	if (!fep->scc.ep) {		iounmap(fep->scc.sccp);		return -EINVAL;	}	return 0;}
开发者ID:LouZiffer,项目名称:m900_kernel_cupcake-SDX,代码行数:20,


示例20: do_pd_setup

static int do_pd_setup(struct fs_enet_private *fep){	struct of_device *ofdev = to_of_device(fep->dev);	struct fs_platform_info *fpi = fep->fpi;	int ret = -EINVAL;	fep->interrupt = of_irq_to_resource(ofdev->node, 0, NULL);	if (fep->interrupt == NO_IRQ)		goto out;	fep->fcc.fccp = of_iomap(ofdev->node, 0);	if (!fep->fcc.fccp)		goto out;	fep->fcc.ep = of_iomap(ofdev->node, 1);	if (!fep->fcc.ep)		goto out_fccp;	fep->fcc.fcccp = of_iomap(ofdev->node, 2);	if (!fep->fcc.fcccp)		goto out_ep;	fep->fcc.mem = (void __iomem *)cpm2_immr;	fpi->dpram_offset = cpm_dpalloc(128, 8);	if (IS_ERR_VALUE(fpi->dpram_offset)) {		ret = fpi->dpram_offset;		goto out_fcccp;	}	return 0;out_fcccp:	iounmap(fep->fcc.fcccp);out_ep:	iounmap(fep->fcc.ep);out_fccp:	iounmap(fep->fcc.fccp);out:	return ret;}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:40,


示例21: of_platform_device_probe

static int of_platform_device_probe(struct device *dev){	int error = -ENODEV;	struct of_platform_driver *drv;	struct of_device *of_dev;	const struct of_device_id *match;	drv = to_of_platform_driver(dev->driver);	of_dev = to_of_device(dev);	if (!drv->probe)		return error;	of_dev_get(of_dev);	match = of_match_device(drv->match_table, of_dev);	if (match)		error = drv->probe(of_dev, match);	if (error)		of_dev_put(of_dev);	return error;}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:23,


示例22: build_device_resources

static void __init build_device_resources(struct of_device *op,					  struct device *parent){	struct of_device *p_op;	struct of_bus *bus;	int na, ns;	int index, num_reg;	const void *preg;	if (!parent)		return;	p_op = to_of_device(parent);	bus = of_match_bus(p_op->node);	bus->count_cells(op->node, &na, &ns);	preg = of_get_property(op->node, bus->addr_prop_name, &num_reg);	if (!preg || num_reg == 0)		return;	/* Convert to num-cells.  */	num_reg /= 4;	/* Conver to num-entries.  */	num_reg /= na + ns;	for (index = 0; index < num_reg; index++) {		struct resource *r = &op->resource[index];		u32 addr[OF_MAX_ADDR_CELLS];		const u32 *reg = (preg + (index * ((na + ns) * 4)));		struct device_node *dp = op->node;		struct device_node *pp = p_op->node;		struct of_bus *pbus, *dbus;		u64 size, result = OF_BAD_ADDR;		unsigned long flags;		int dna, dns;		int pna, pns;		size = of_read_addr(reg + na, ns);		flags = bus->get_flags(reg);		memcpy(addr, reg, na * 4);		/* If the immediate parent has no ranges property to apply,		 * just use a 1<->1 mapping.		 */		if (of_find_property(pp, "ranges", NULL) == NULL) {			result = of_read_addr(addr, na);			goto build_res;		}		dna = na;		dns = ns;		dbus = bus;		while (1) {			dp = pp;			pp = dp->parent;			if (!pp) {				result = of_read_addr(addr, dna);				break;			}			pbus = of_match_bus(pp);			pbus->count_cells(dp, &pna, &pns);			if (build_one_resource(dp, dbus, pbus, addr,					       dna, dns, pna))				break;			dna = pna;			dns = pns;			dbus = pbus;		}	build_res:		memset(r, 0, sizeof(*r));		if (of_resource_verbose)			printk("%s reg[%d] -> %llx/n",			       op->node->full_name, index,			       result);		if (result != OF_BAD_ADDR) {			r->start = result & 0xffffffff;			r->end = result + size - 1;			r->flags = flags | ((result >> 32ULL) & 0xffUL);		}		r->name = op->node->name;	}
开发者ID:janrinze,项目名称:loox7xxport,代码行数:90,


示例23: to_of_device

static inline struct iommu_table *device_to_table(struct device *hwdev){	struct of_device *ofdev = to_of_device(hwdev);	return hwdev ? ofdev->iommu : NULL;}
开发者ID:dduval,项目名称:kernel-rhel5,代码行数:6,


示例24: device_to_mask

static inline unsigned long device_to_mask(struct device *hwdev){	struct of_device *ofdev = to_of_device(hwdev);	return ofdev->dma_mask;}
开发者ID:dduval,项目名称:kernel-rhel5,代码行数:6,


示例25: nwpserial_register_port

int nwpserial_register_port(struct uart_port *port){	struct nwpserial_port *up = NULL;	int ret = -1;	int i;	static int first = 1;	int dcr_len;	int dcr_base;	struct device_node *dn;	mutex_lock(&nwpserial_mutex);	dn = to_of_device(port->dev)->dev.of_node;	if (dn == NULL)		goto out;	/* get dcr base. */	dcr_base = dcr_resource_start(dn, 0);	/* find matching entry */	for (i = 0; i < NWPSERIAL_NR; i++)		if (nwpserial_ports[i].port.iobase == dcr_base) {			up = &nwpserial_ports[i];			break;		}	/* we didn't find a mtching entry, search for a free port */	if (up == NULL)		for (i = 0; i < NWPSERIAL_NR; i++)			if (nwpserial_ports[i].port.type == PORT_UNKNOWN &&				nwpserial_ports[i].port.iobase == 0) {				up = &nwpserial_ports[i];				break;			}	if (up == NULL) {		ret = -EBUSY;		goto out;	}	if (first)		uart_register_driver(&nwpserial_reg);	first = 0;	up->port.membase      = port->membase;	up->port.irq          = port->irq;	up->port.uartclk      = port->uartclk;	up->port.fifosize     = port->fifosize;	up->port.regshift     = port->regshift;	up->port.iotype       = port->iotype;	up->port.flags        = port->flags;	up->port.mapbase      = port->mapbase;	up->port.private_data = port->private_data;	if (port->dev)		up->port.dev = port->dev;	if (up->port.iobase != dcr_base) {		up->port.ops          = &nwpserial_pops;		up->port.fifosize     = 16;		spin_lock_init(&up->port.lock);		up->port.iobase = dcr_base;		dcr_len = dcr_resource_len(dn, 0);		up->dcr_host = dcr_map(dn, dcr_base, dcr_len);		if (!DCR_MAP_OK(up->dcr_host)) {			printk(KERN_ERR "Cannot map DCR resources for NWPSERIAL");			goto out;		}	}	ret = uart_add_one_port(&nwpserial_reg, &up->port);	if (ret == 0)		ret = up->port.line;out:	mutex_unlock(&nwpserial_mutex);	return ret;}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:82,


示例26: of_dev_phandle_match

static int of_dev_phandle_match(struct device *dev, void *data){	phandle *ph = data;	return to_of_device(dev)->node->linux_phandle == *ph;}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:5,


示例27: of_dev_node_match

static int of_dev_node_match(struct device *dev, void *data){	return to_of_device(dev)->node == data;}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:4,


示例28: bw2_probe

static int __devinit bw2_probe(struct of_device *dev, const struct of_device_id *match){	struct of_device *op = to_of_device(&dev->dev);	return bw2_init_one(op);}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:6,



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


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