output: Use wl_resource_get accessors for weston_output resources

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
diff --git a/src/compositor.c b/src/compositor.c
index 38ef095..e57f61f 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -502,19 +502,6 @@
 	pixman_region32_fini(&damage);
 }
 
-static struct wl_resource *
-find_resource_for_client(struct wl_list *list, struct wl_client *client)
-{
-        struct wl_resource *r;
-
-        wl_list_for_each(r, list, link) {
-                if (r->client == client)
-                        return r;
-        }
-
-        return NULL;
-}
-
 static void
 weston_surface_update_output_mask(struct weston_surface *es, uint32_t mask)
 {
@@ -536,7 +523,7 @@
 	wl_list_for_each(output, &es->compositor->output_list, link) {
 		if (1 << output->id & different)
 			resource =
-				find_resource_for_client(&output->resource_list,
+				wl_resource_find_for_client(&output->resource_list,
 							 client);
 		if (resource == NULL)
 			continue;
@@ -2489,7 +2476,7 @@
 
 static void unbind_resource(struct wl_resource *resource)
 {
-	wl_list_remove(&resource->link);
+	wl_list_remove(wl_resource_get_link(resource));
 	free(resource);
 }
 
@@ -2504,8 +2491,8 @@
 	resource = wl_client_add_object(client,
 					&wl_output_interface, NULL, id, data);
 
-	wl_list_insert(&output->resource_list, &resource->link);
-	resource->destroy = unbind_resource;
+	wl_list_insert(&output->resource_list, wl_resource_get_link(resource));
+	wl_resource_set_destructor(resource, unbind_resource);
 
 	wl_output_send_geometry(resource,
 				output->x,