Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364779
b: refs/heads/master
c: 1919811
h: refs/heads/master
i:
  364777: 5e11e8f
  364775: 1e3f948
v: v3
  • Loading branch information
Chao Xie authored and Felipe Balbi committed Apr 2, 2013
1 parent 193d49f commit aa75d8d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 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: b65ae0f1a7b98c370967cf161ee87011e3ecdd77
refs/heads/master: 1919811fe635de4689b4f31a20da3d50196cf43f
3 changes: 1 addition & 2 deletions trunk/drivers/usb/gadget/mv_udc.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ struct mv_udc {
struct mv_usb_platform_data *pdata;

/* some SOC has mutiple clock sources for USB*/
unsigned int clknum;
struct clk *clk[0];
struct clk *clk;
};

/* endpoint data structure */
Expand Down
27 changes: 7 additions & 20 deletions trunk/drivers/usb/gadget/mv_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,18 +974,12 @@ static struct usb_ep_ops mv_ep_ops = {

static void udc_clock_enable(struct mv_udc *udc)
{
unsigned int i;

for (i = 0; i < udc->clknum; i++)
clk_prepare_enable(udc->clk[i]);
clk_prepare_enable(udc->clk);
}

static void udc_clock_disable(struct mv_udc *udc)
{
unsigned int i;

for (i = 0; i < udc->clknum; i++)
clk_disable_unprepare(udc->clk[i]);
clk_disable_unprepare(udc->clk);
}

static void udc_stop(struct mv_udc *udc)
Expand Down Expand Up @@ -2109,7 +2103,6 @@ static int mv_udc_probe(struct platform_device *pdev)
struct mv_usb_platform_data *pdata = pdev->dev.platform_data;
struct mv_udc *udc;
int retval = 0;
int clk_i = 0;
struct resource *r;
size_t size;

Expand All @@ -2118,8 +2111,7 @@ static int mv_udc_probe(struct platform_device *pdev)
return -ENODEV;
}

size = sizeof(*udc) + sizeof(struct clk *) * pdata->clknum;
udc = devm_kzalloc(&pdev->dev, size, GFP_KERNEL);
udc = devm_kzalloc(&pdev->dev, sizeof(*udc), GFP_KERNEL);
if (udc == NULL) {
dev_err(&pdev->dev, "failed to allocate memory for udc\n");
return -ENOMEM;
Expand All @@ -2145,15 +2137,10 @@ static int mv_udc_probe(struct platform_device *pdev)
}
}

udc->clknum = pdata->clknum;
for (clk_i = 0; clk_i < udc->clknum; clk_i++) {
udc->clk[clk_i] = devm_clk_get(&pdev->dev,
pdata->clkname[clk_i]);
if (IS_ERR(udc->clk[clk_i])) {
retval = PTR_ERR(udc->clk[clk_i]);
return retval;
}
}
/* udc only have one sysclk. */
udc->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(udc->clk))
return PTR_ERR(udc->clk);

r = platform_get_resource_byname(udc->dev, IORESOURCE_MEM, "capregs");
if (r == NULL) {
Expand Down

0 comments on commit aa75d8d

Please sign in to comment.