diff --git a/libweston/compositor.c b/libweston/compositor.c index de6931ae..2f8af3c2 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -7203,10 +7203,14 @@ weston_compositor_create(struct wl_display *display, struct weston_compositor *ec; struct wl_event_loop *loop; + if (!log_ctx) + return NULL; + ec = zalloc(sizeof *ec); if (!ec) return NULL; + ec->weston_log_ctx = log_ctx; ec->wl_display = display; ec->user_data = user_data; wl_signal_init(&ec->destroy_signal); @@ -7258,9 +7262,6 @@ weston_compositor_create(struct wl_display *display, ec, bind_presentation)) goto fail; - if (weston_log_ctx_compositor_setup(ec, log_ctx) < 0) - goto fail; - if (weston_input_init(ec) != 0) goto fail; diff --git a/libweston/weston-log-internal.h b/libweston/weston-log-internal.h index ba5b51ce..9c94dbb5 100644 --- a/libweston/weston-log-internal.h +++ b/libweston/weston-log-internal.h @@ -93,9 +93,6 @@ weston_log_run_cb_new_subscription(struct weston_log_subscription *sub); void weston_debug_protocol_advertise_scopes(struct weston_log_context *log_ctx, struct wl_resource *res); -int -weston_log_ctx_compositor_setup(struct weston_compositor *compositor, - struct weston_log_context *log_ctx); int weston_vlog(const char *fmt, va_list ap); diff --git a/libweston/weston-log.c b/libweston/weston-log.c index 80b6eed8..2c5da4ac 100644 --- a/libweston/weston-log.c +++ b/libweston/weston-log.c @@ -398,28 +398,6 @@ weston_debug_protocol_advertise_scopes(struct weston_log_context *log_ctx, weston_debug_v1_send_available(res, scope->name, scope->desc); } -/** - * Connect weston_compositor structure to weston_log_context structure. - * - * \param compositor - * \param log_ctx - * \return 0 on success, -1 on failure - * - * Sets weston_compositor::weston_log_ctx. - * - * @ingroup log - */ -int -weston_log_ctx_compositor_setup(struct weston_compositor *compositor, - struct weston_log_context *log_ctx) -{ - assert(!compositor->weston_log_ctx); - assert(log_ctx); - - compositor->weston_log_ctx = log_ctx; - return 0; -} - /** Creates weston_log_context structure * * \return NULL in case of failure, or a weston_log_context object in case of