From: Greg Kroah-Hartman Date: Mon, 27 Oct 2014 05:32:27 +0000 (+0800) Subject: greybus: core: check for valid hcd callbacks X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=724b619dfbe1238eb8b9bd4916eeaf40b5640b28;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git greybus: core: check for valid hcd callbacks When registering a host controller, verify that all of the needed callbacks are present, so we don't have to do the testing on any "hot" paths when we want to send real data. Signed-off-by: Greg Kroah-Hartman Reviewed-by: Alex Elder alloc_gbuf_data) || + (!driver->free_gbuf_data) || + (!driver->submit_svc) || + (!driver->submit_gbuf) || + (!driver->abort_gbuf)) { + pr_err("Must implement all greybus_host_driver callbacks!\n"); + return NULL; + } + hd = kzalloc(sizeof(*hd) + driver->hd_priv_size, GFP_KERNEL); if (!hd) return NULL;