Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364533
b: refs/heads/master
c: 4495afc
h: refs/heads/master
i:
  364531: 05210c0
v: v3
  • Loading branch information
Kishon Vijay Abraham I authored and Felipe Balbi committed Mar 18, 2013
1 parent 5c98237 commit 3654751
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e36a0c870f7dbbfa7ed13cd83b79be00bcd00380
refs/heads/master: 4495afcf713adb5bdb16504052952bdd0d11f90a
24 changes: 10 additions & 14 deletions trunk/drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ static int dwc3_omap_remove_core(struct device *dev, void *c)

static int dwc3_omap_probe(struct platform_device *pdev)
{
struct dwc3_omap_data *pdata = pdev->dev.platform_data;
struct device_node *node = pdev->dev.of_node;

struct dwc3_omap *omap;
Expand All @@ -326,6 +325,11 @@ static int dwc3_omap_probe(struct platform_device *pdev)
void __iomem *base;
void *context;

if (!node) {
dev_err(dev, "device node not found\n");
return -EINVAL;
}

omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);
if (!omap) {
dev_err(dev, "not enough memory\n");
Expand Down Expand Up @@ -387,12 +391,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)

reg = dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS);

if (node)
of_property_read_u32(node, "utmi-mode", &utmi_mode);
else if (pdata)
utmi_mode = pdata->utmi_mode;
else
dev_dbg(dev, "missing platform data\n");
of_property_read_u32(node, "utmi-mode", &utmi_mode);

switch (utmi_mode) {
case DWC3_OMAP_UTMI_MODE_SW:
Expand Down Expand Up @@ -435,13 +434,10 @@ static int dwc3_omap_probe(struct platform_device *pdev)

dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_SET_1, reg);

if (node) {
ret = of_platform_populate(node, NULL, NULL, dev);
if (ret) {
dev_err(&pdev->dev,
"failed to add create dwc3 core\n");
return ret;
}
ret = of_platform_populate(node, NULL, NULL, dev);
if (ret) {
dev_err(&pdev->dev, "failed to create dwc3 core\n");
return ret;
}

return 0;
Expand Down
4 changes: 0 additions & 4 deletions trunk/include/linux/platform_data/dwc3-omap.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,3 @@ enum dwc3_omap_utmi_mode {
DWC3_OMAP_UTMI_MODE_HW,
DWC3_OMAP_UTMI_MODE_SW,
};

struct dwc3_omap_data {
enum dwc3_omap_utmi_mode utmi_mode;
};

0 comments on commit 3654751

Please sign in to comment.