Exemplo n.º 1
0
static struct device *next_device(struct klist_iter *i)
{
	struct klist_node *n = klist_next(i);
	struct device *dev = NULL;
	struct device_private *dev_prv;

	if (n) {
		dev_prv = to_device_private_bus(n);
		dev = dev_prv->device;
	}
	return dev;
}
Exemplo n.º 2
0
struct device *my_class_dev_iter_next(struct class_dev_iter *iter)
{
	struct klist_node *knode;
	struct device *dev;

	while (1) {
		knode = klist_next(&iter->ki);

		// printk("\nknode %p ", knode);

		if (!knode) {
		//	printk("\n");
			return NULL;
		}

		dev = container_of(knode, struct device, knode_class);
		if (!iter->type || iter->type == dev->type) {
		//	printk("\nf dev %p\n", dev);
			return dev;
		}
	}
	printk("nodev found\n");
}
Exemplo n.º 3
0
static struct device *next_device(struct klist_iter *i)
{
	struct klist_node *n = klist_next(i);
	return n ? container_of(n, struct device, knode_driver) : NULL;
}
Exemplo n.º 4
0
Arquivo: pci.c Projeto: korepwx/pcore
static inline PCIDevice *pci_get_next_entry(KListEntry *itm) {
  KListEntry *le = klist_next(itm);
  if (le == &pci_list) 
    return NULL;
  return ktostruct(le, PCIDevice, pci_list);
}