From 380218c08339039ea1130e7ec17d63f6182a91a7 Mon Sep 17 00:00:00 2001 From: Matthew Xie Date: Fri, 20 Jul 2012 16:21:26 -0700 Subject: Get the vendor interface as a structure pointer instead of function We donnot need the extra function to return the interface. bug 6853945 Change-Id: I693aa9f068a64ee5a5e9bc5ff3cc82ecf59d5de1 --- hci/src/bt_hw.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'hci') diff --git a/hci/src/bt_hw.c b/hci/src/bt_hw.c index 4878260..414ee60 100644 --- a/hci/src/bt_hw.c +++ b/hci/src/bt_hw.c @@ -238,7 +238,6 @@ static const bt_vendor_callbacks_t vnd_callbacks = { ******************************************************************************/ void init_vnd_if(unsigned char *local_bdaddr) { - bt_vendor_interface_t (*bt_vendor_get_interface_func)(void); void *dlhandle; dlhandle = dlopen("libbt-vendor.so", RTLD_NOW); @@ -248,20 +247,13 @@ void init_vnd_if(unsigned char *local_bdaddr) return; } - bt_vendor_get_interface_func = dlsym(dlhandle, "bt_vendor_get_interface"); - if (!bt_vendor_get_interface_func) + bt_vnd_if = (bt_vendor_interface_t *) dlsym(dlhandle, "BLUETOOTH_VENDOR_LIB_INTERFACE"); + if (!bt_vnd_if) { - ALOGE("!!! Failed to get bt_vendor_get_interface !!!"); + ALOGE("!!! Failed to get bt vendor interface !!!"); return; } - if ((bt_vnd_if=(bt_vendor_interface_t *) bt_vendor_get_interface_func)!=NULL) - { - bt_vnd_if->init(&vnd_callbacks, local_bdaddr); - } - else - { - ALOGE("!!! Failed to get BtVendorInterface !!!"); - } + bt_vnd_if->init(&vnd_callbacks, local_bdaddr); } -- cgit v1.1