Lines Matching +full:string +full:- +full:array +full:- +full:property
1 #include <linux/string.h>
13 * of_match_device - Tell if a struct device matches an of_device_id list
14 * @ids: array of of device match structures to search in
23 if ((!matches) || (!dev->of_node)) in of_match_device()
25 return of_match_node(matches, dev->of_node); in of_match_device()
35 tmp = get_device(&dev->dev); in of_dev_get()
46 put_device(&dev->dev); in of_dev_put()
52 BUG_ON(ofdev->dev.of_node == NULL); in of_device_add()
56 ofdev->name = dev_name(&ofdev->dev); in of_device_add()
57 ofdev->id = -1; in of_device_add()
62 if (!ofdev->dev.parent) in of_device_add()
63 set_dev_node(&ofdev->dev, of_node_to_nid(ofdev->dev.of_node)); in of_device_add()
65 return device_add(&ofdev->dev); in of_device_add()
70 device_initialize(&pdev->dev); in of_device_register()
77 device_unregister(&ofdev->dev); in of_device_unregister()
88 csize = snprintf(str, len, "of:N%sT%s", dev->of_node->name, in of_device_get_modalias()
89 dev->of_node->type); in of_device_get_modalias()
91 /* Get compatible property if any */ in of_device_get_modalias()
92 compat = of_get_property(dev->of_node, "compatible", &cplen); in of_device_get_modalias()
97 for (i = (cplen - 1); i >= 0 && !compat[i]; i--) in of_device_get_modalias()
98 cplen--; in of_device_get_modalias()
111 cplen = len - csize - 1; in of_device_get_modalias()
129 * of_device_uevent - Display OF related uevent information
136 if ((!dev) || (!dev->of_node)) in of_device_uevent()
137 return -ENODEV; in of_device_uevent()
139 if (add_uevent_var(env, "OF_NAME=%s", dev->of_node->name)) in of_device_uevent()
140 return -ENOMEM; in of_device_uevent()
142 if (add_uevent_var(env, "OF_TYPE=%s", dev->of_node->type)) in of_device_uevent()
143 return -ENOMEM; in of_device_uevent()
149 compat = of_get_property(dev->of_node, "compatible", &cplen); in of_device_uevent()
152 return -ENOMEM; in of_device_uevent()
156 cplen -= sl; in of_device_uevent()
161 return -ENOMEM; in of_device_uevent()
165 return -ENOMEM; in of_device_uevent()
167 sl = of_device_get_modalias(dev, &env->buf[env->buflen-1], in of_device_uevent()
168 sizeof(env->buf) - env->buflen); in of_device_uevent()
169 if (sl >= (sizeof(env->buf) - env->buflen)) in of_device_uevent()
170 return -ENOMEM; in of_device_uevent()
171 env->buflen += sl; in of_device_uevent()