in interface.c [873:908]
static int gb_interface_activate_operation(struct gb_interface *intf,
enum gb_interface_type *intf_type)
{
struct gb_svc *svc = intf->hd->svc;
u8 type;
int ret;
dev_dbg(&intf->dev, "%s\n", __func__);
ret = gb_svc_intf_activate(svc, intf->interface_id, &type);
if (ret) {
dev_err(&intf->dev, "failed to activate: %d\n", ret);
return ret;
}
switch (type) {
case GB_SVC_INTF_TYPE_DUMMY:
*intf_type = GB_INTERFACE_TYPE_DUMMY;
/* FIXME: handle as an error for now */
return -ENODEV;
case GB_SVC_INTF_TYPE_UNIPRO:
*intf_type = GB_INTERFACE_TYPE_UNIPRO;
dev_err(&intf->dev, "interface type UniPro not supported\n");
/* FIXME: handle as an error for now */
return -ENODEV;
case GB_SVC_INTF_TYPE_GREYBUS:
*intf_type = GB_INTERFACE_TYPE_GREYBUS;
break;
default:
dev_err(&intf->dev, "unknown interface type: %u\n", type);
*intf_type = GB_INTERFACE_TYPE_UNKNOWN;
return -ENODEV;
}
return 0;
}