static void set_device_wakeable_complete(uint8_t status, uint16_t length,
					 const void *param, void *user_data)
{
	const struct mgmt_rp_set_device_flags *rp = param;
	struct btd_adapter *adapter = user_data;
	struct btd_device *dev;
	char addr[18];

	if (status != MGMT_STATUS_SUCCESS) {
		btd_error(adapter->dev_id, "Set device flags return status: %s",
			  mgmt_errstr(status));
		return;
	}

	if (length < sizeof(*rp)) {
		btd_error(adapter->dev_id,
			  "Too small Set Device Flags complete event: %d",
			  length);
		return;
	}

	ba2str(&rp->addr.bdaddr, addr);

	dev = btd_adapter_find_device(adapter, &rp->addr.bdaddr, rp->addr.type);
	if (!dev) {
		btd_error(adapter->dev_id,
			  "Set Device Flags complete for unknown device %s",
			  addr);
		return;
	}

	device_set_wake_allowed_complete(dev);
}
static void set_device_wakeable_complete(uint8_t status, uint16_t length,
					 const void *param, void *user_data)
{
	const struct mgmt_rp_set_device_flags *rp = param;
	struct btd_adapter *adapter = user_data;
	struct btd_device *dev;
	char addr[18];

	if (status != MGMT_STATUS_SUCCESS) {
		btd_error(adapter->dev_id, "Set device flags return status: %s",
			  mgmt_errstr(status));
		return;
	}

	if (length < sizeof(*rp)) {
		btd_error(adapter->dev_id,
			  "Too small Set Device Flags complete event: %d",
			  length);
		return;
	}

	ba2str(&rp->addr.bdaddr, addr);

	dev = btd_adapter_find_device(adapter, &rp->addr.bdaddr, rp->addr.type);
	if (!dev) {
		btd_error(adapter->dev_id,
			  "Set Device Flags complete for unknown device %s",
			  addr);
		return;
	}

	device_set_wake_allowed_complete(dev);
}