Commit df18feda authored by Chao Xie's avatar Chao Xie Committed by Felipe Balbi

usb: otg: mv_otg: remove unused clock

The origianl understanding of clock is wrong. The OTG controller
only have one clock input.
Passing clock name by pdata is wrong. The clock is defined by device
iteself.
Signed-off-by: default avatarChao Xie <chao.xie@marvell.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 1919811f
...@@ -237,18 +237,12 @@ static void mv_otg_start_periphrals(struct mv_otg *mvotg, int on) ...@@ -237,18 +237,12 @@ static void mv_otg_start_periphrals(struct mv_otg *mvotg, int on)
static void otg_clock_enable(struct mv_otg *mvotg) static void otg_clock_enable(struct mv_otg *mvotg)
{ {
unsigned int i; clk_prepare_enable(mvotg->clk);
for (i = 0; i < mvotg->clknum; i++)
clk_prepare_enable(mvotg->clk[i]);
} }
static void otg_clock_disable(struct mv_otg *mvotg) static void otg_clock_disable(struct mv_otg *mvotg)
{ {
unsigned int i; clk_disable_unprepare(mvotg->clk);
for (i = 0; i < mvotg->clknum; i++)
clk_disable_unprepare(mvotg->clk[i]);
} }
static int mv_otg_enable_internal(struct mv_otg *mvotg) static int mv_otg_enable_internal(struct mv_otg *mvotg)
...@@ -684,16 +678,14 @@ static int mv_otg_probe(struct platform_device *pdev) ...@@ -684,16 +678,14 @@ static int mv_otg_probe(struct platform_device *pdev)
struct mv_otg *mvotg; struct mv_otg *mvotg;
struct usb_otg *otg; struct usb_otg *otg;
struct resource *r; struct resource *r;
int retval = 0, clk_i, i; int retval = 0, i;
size_t size;
if (pdata == NULL) { if (pdata == NULL) {
dev_err(&pdev->dev, "failed to get platform data\n"); dev_err(&pdev->dev, "failed to get platform data\n");
return -ENODEV; return -ENODEV;
} }
size = sizeof(*mvotg) + sizeof(struct clk *) * pdata->clknum; mvotg = devm_kzalloc(&pdev->dev, sizeof(*mvotg), GFP_KERNEL);
mvotg = devm_kzalloc(&pdev->dev, size, GFP_KERNEL);
if (!mvotg) { if (!mvotg) {
dev_err(&pdev->dev, "failed to allocate memory!\n"); dev_err(&pdev->dev, "failed to allocate memory!\n");
return -ENOMEM; return -ENOMEM;
...@@ -708,15 +700,9 @@ static int mv_otg_probe(struct platform_device *pdev) ...@@ -708,15 +700,9 @@ static int mv_otg_probe(struct platform_device *pdev)
mvotg->pdev = pdev; mvotg->pdev = pdev;
mvotg->pdata = pdata; mvotg->pdata = pdata;
mvotg->clknum = pdata->clknum; mvotg->clk = devm_clk_get(&pdev->dev, NULL);
for (clk_i = 0; clk_i < mvotg->clknum; clk_i++) { if (IS_ERR(mvotg->clk))
mvotg->clk[clk_i] = devm_clk_get(&pdev->dev, return PTR_ERR(mvotg->clk);
pdata->clkname[clk_i]);
if (IS_ERR(mvotg->clk[clk_i])) {
retval = PTR_ERR(mvotg->clk[clk_i]);
return retval;
}
}
mvotg->qwork = create_singlethread_workqueue("mv_otg_queue"); mvotg->qwork = create_singlethread_workqueue("mv_otg_queue");
if (!mvotg->qwork) { if (!mvotg->qwork) {
......
...@@ -158,8 +158,7 @@ struct mv_otg { ...@@ -158,8 +158,7 @@ struct mv_otg {
unsigned int active; unsigned int active;
unsigned int clock_gating; unsigned int clock_gating;
unsigned int clknum; struct clk *clk;
struct clk *clk[0];
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment