Lines Matching refs:dev
105 free_otherend_details(struct xenbus_device *dev) in free_otherend_details() argument
107 if (dev->otherend != NULL) { in free_otherend_details()
108 kmem_free((void *)dev->otherend, strlen(dev->otherend) + 1); in free_otherend_details()
109 dev->otherend = NULL; in free_otherend_details()
115 free_otherend_watch(struct xenbus_device *dev) in free_otherend_watch() argument
117 if (dev->otherend_watch.node) { in free_otherend_watch()
118 unregister_xenbus_watch(&dev->otherend_watch); in free_otherend_watch()
119 kmem_free((void *)dev->otherend_watch.node, in free_otherend_watch()
120 strlen(dev->otherend_watch.node) + 1); in free_otherend_watch()
121 dev->otherend_watch.node = NULL; in free_otherend_watch()
130 struct xenbus_device *dev = watch->dev; in otherend_changed() local
137 if (!dev->otherend || in otherend_changed()
138 strncmp(dev->otherend, vec[XS_WATCH_PATH], strlen(dev->otherend))) { in otherend_changed()
145 state = xenbus_read_driver_state(dev->otherend); in otherend_changed()
149 state, dev->otherend_watch.node, vec[XS_WATCH_PATH]); in otherend_changed()
151 if (dev->otherend_changed) in otherend_changed()
152 dev->otherend_changed(dev, state); in otherend_changed()
157 talk_to_otherend(struct xenbus_device *dev) in talk_to_otherend() argument
161 free_otherend_watch(dev); in talk_to_otherend()
162 free_otherend_details(dev); in talk_to_otherend()
164 if (dev->frontend) in talk_to_otherend()
165 err = read_backend_details(dev); in talk_to_otherend()
167 err = read_frontend_details(dev); in talk_to_otherend()
171 dev->otherend_watch.dev = dev; in talk_to_otherend()
172 return (xenbus_watch_path2(dev, dev->otherend, "state", in talk_to_otherend()
173 &dev->otherend_watch, otherend_changed)); in talk_to_otherend()