Skip to contentSkip to conversation

usb: musb: dsps: remove duplicated get_musb_port_mode()

PATCH New Bin Liu 1 participant 1 message Apr 16, 2018

Subsystems (2)
lore
Share & tools
lore

Bin Liu

author maintainer
#0 lore raw

PATCH 6/11 usb: musb: dsps: remove duplicated get_musb_port_mode()

musb_core already has musb_get_mode(), so remove the duplicate from musb_dsps.c.

---
 drivers/usb/musb/musb_dsps.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)
drivers/usb/musb/musb_dsps.c +1 -20
index 05a679d5e3a2..d077eefb5e2c 100644
@@ -731,25 +731,6 @@ static int get_int_prop(struct device_node *dn, const char *s)
 	return val;
 }
 
-static int get_musb_port_mode(struct device *dev)
-{
-	enum usb_dr_mode mode;
-
-	mode = usb_get_dr_mode(dev);
-	switch (mode) {
-	case USB_DR_MODE_HOST:
-		return MUSB_PORT_MODE_HOST;
-
-	case USB_DR_MODE_PERIPHERAL:
-		return MUSB_PORT_MODE_GADGET;
-
-	case USB_DR_MODE_UNKNOWN:
-	case USB_DR_MODE_OTG:
-	default:
-		return MUSB_PORT_MODE_DUAL_ROLE;
-	}
-}
-
 static int dsps_create_musb_pdev(struct dsps_glue *glue,
 		struct platform_device *parent)
 {
@@ -809,7 +790,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
 	config->num_eps = get_int_prop(dn, "mentor,num-eps");
 	config->ram_bits = get_int_prop(dn, "mentor,ram-bits");
 	config->host_port_deassert_reset_at_resume = 1;
-	pdata.mode = get_musb_port_mode(dev);
+	pdata.mode = musb_get_mode(dev);
 	/* DT keeps this entry in mA, musb expects it as per USB spec */
 	pdata.power = get_int_prop(dn, "mentor,power") / 2;