Lines Matching refs:context

50 static void hotplug_event(u32 type, struct acpiphp_context *context);
61 struct acpiphp_context *context; in acpiphp_init_context() local
63 context = kzalloc(sizeof(*context), GFP_KERNEL); in acpiphp_init_context()
64 if (!context) in acpiphp_init_context()
67 context->refcount = 1; in acpiphp_init_context()
68 context->hp.notify = acpiphp_hotplug_notify; in acpiphp_init_context()
69 context->hp.fixup = acpiphp_post_dock_fixup; in acpiphp_init_context()
70 acpi_set_hp_context(adev, &context->hp); in acpiphp_init_context()
71 return context; in acpiphp_init_context()
82 struct acpiphp_context *context; in acpiphp_get_context() local
87 context = to_acpiphp_context(adev->hp); in acpiphp_get_context()
88 context->refcount++; in acpiphp_get_context()
89 return context; in acpiphp_get_context()
100 static void acpiphp_put_context(struct acpiphp_context *context) in acpiphp_put_context() argument
102 if (--context->refcount) in acpiphp_put_context()
105 WARN_ON(context->bridge); in acpiphp_put_context()
106 context->hp.self->hp = NULL; in acpiphp_put_context()
107 kfree(context); in acpiphp_put_context()
122 struct acpiphp_context *context; in acpiphp_grab_context() local
126 context = acpiphp_get_context(adev); in acpiphp_grab_context()
127 if (!context) in acpiphp_grab_context()
130 if (context->func.parent->is_going_away) { in acpiphp_grab_context()
131 acpiphp_put_context(context); in acpiphp_grab_context()
132 context = NULL; in acpiphp_grab_context()
136 get_bridge(context->func.parent); in acpiphp_grab_context()
137 acpiphp_put_context(context); in acpiphp_grab_context()
141 return context; in acpiphp_grab_context()
144 static void acpiphp_let_context_go(struct acpiphp_context *context) in acpiphp_let_context_go() argument
146 put_bridge(context->func.parent); in acpiphp_let_context_go()
151 struct acpiphp_context *context; in free_bridge() local
167 context = bridge->context; in free_bridge()
169 if (context) { in free_bridge()
171 put_bridge(context->func.parent); in free_bridge()
172 context->bridge = NULL; in free_bridge()
173 acpiphp_put_context(context); in free_bridge()
191 struct acpiphp_context *context = acpiphp_grab_context(adev); in acpiphp_post_dock_fixup() local
195 if (!context) in acpiphp_post_dock_fixup()
198 bus = context->func.slot->bus; in acpiphp_post_dock_fixup()
216 acpiphp_let_context_go(context); in acpiphp_post_dock_fixup()
230 struct acpiphp_context *context; in acpiphp_add_context() local
255 context = acpiphp_init_context(adev); in acpiphp_add_context()
256 if (!context) { in acpiphp_add_context()
261 newfunc = &context->func; in acpiphp_add_context()
284 acpiphp_put_context(context); in acpiphp_add_context()
774 static void hotplug_event(u32 type, struct acpiphp_context *context) in hotplug_event() argument
776 acpi_handle handle = context->hp.self->handle; in hotplug_event()
777 struct acpiphp_func *func = &context->func; in hotplug_event()
782 bridge = context->bridge; in hotplug_event()
830 struct acpiphp_context *context; in acpiphp_hotplug_notify() local
832 context = acpiphp_grab_context(adev); in acpiphp_hotplug_notify()
833 if (!context) in acpiphp_hotplug_notify()
836 hotplug_event(type, context); in acpiphp_hotplug_notify()
837 acpiphp_let_context_go(context); in acpiphp_hotplug_notify()
890 struct acpiphp_context *context; in acpiphp_enumerate_slots() local
898 context = acpiphp_get_context(adev); in acpiphp_enumerate_slots()
899 if (!context) in acpiphp_enumerate_slots()
902 bridge->context = context; in acpiphp_enumerate_slots()
903 context->bridge = bridge; in acpiphp_enumerate_slots()
905 get_bridge(context->func.parent); in acpiphp_enumerate_slots()