diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c index c8340de0ed495..44f168c9bd9bf 100644 --- a/drivers/usb/typec/mux.c +++ b/drivers/usb/typec/mux.c @@ -193,56 +193,15 @@ static int mux_fwnode_match(struct device *dev, const void *fwnode) static void *typec_mux_match(struct fwnode_handle *fwnode, const char *id, void *data) { - const struct typec_altmode_desc *desc = data; struct device *dev; - bool match; - int nval; - u16 *val; - int ret; - int i; /* - * Check has the identifier already been "consumed". If it - * has, no need to do any extra connection identification. + * The connection identifier will be needed with device graph (OF graph). + * Device graph is not supported by this code yet, so bailing out. */ - match = !id; - if (match) - goto find_mux; - - /* Accessory Mode muxes */ - if (!desc) { - match = fwnode_property_present(fwnode, "accessory"); - if (match) - goto find_mux; - return NULL; - } - - /* Alternate Mode muxes */ - nval = fwnode_property_count_u16(fwnode, "svid"); - if (nval <= 0) - return NULL; - - val = kcalloc(nval, sizeof(*val), GFP_KERNEL); - if (!val) - return ERR_PTR(-ENOMEM); - - ret = fwnode_property_read_u16_array(fwnode, "svid", val, nval); - if (ret < 0) { - kfree(val); - return ERR_PTR(ret); - } - - for (i = 0; i < nval; i++) { - match = val[i] == desc->svid; - if (match) { - kfree(val); - goto find_mux; - } - } - kfree(val); - return NULL; + if (id) + return ERR_PTR(-ENOTSUPP); -find_mux: dev = class_find_device(&typec_mux_class, NULL, fwnode, mux_fwnode_match);