Commit 3b3eca31 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM / Runtime: Fix loops in pm_runtime_clk_notify()

The loops over connection ID strings in pm_runtime_clk_notify()
should actually iterate over the strings and not over the elements
of the first of them, so make them behave as appropriate.

This fixes a regression introduced by commit 600b776e
(OMAP1 / PM: Use generic clock manipulation routines for runtime PM).
Reported-and-tested-by: default avatarJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 99592ba4
...@@ -291,7 +291,7 @@ static int pm_runtime_clk_notify(struct notifier_block *nb, ...@@ -291,7 +291,7 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
{ {
struct pm_clk_notifier_block *clknb; struct pm_clk_notifier_block *clknb;
struct device *dev = data; struct device *dev = data;
char *con_id; char **con_id;
int error; int error;
dev_dbg(dev, "%s() %ld\n", __func__, action); dev_dbg(dev, "%s() %ld\n", __func__, action);
...@@ -309,8 +309,8 @@ static int pm_runtime_clk_notify(struct notifier_block *nb, ...@@ -309,8 +309,8 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
dev->pwr_domain = clknb->pwr_domain; dev->pwr_domain = clknb->pwr_domain;
if (clknb->con_ids[0]) { if (clknb->con_ids[0]) {
for (con_id = clknb->con_ids[0]; *con_id; con_id++) for (con_id = clknb->con_ids; *con_id; con_id++)
pm_runtime_clk_add(dev, con_id); pm_runtime_clk_add(dev, *con_id);
} else { } else {
pm_runtime_clk_add(dev, NULL); pm_runtime_clk_add(dev, NULL);
} }
...@@ -380,7 +380,7 @@ static int pm_runtime_clk_notify(struct notifier_block *nb, ...@@ -380,7 +380,7 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
{ {
struct pm_clk_notifier_block *clknb; struct pm_clk_notifier_block *clknb;
struct device *dev = data; struct device *dev = data;
char *con_id; char **con_id;
dev_dbg(dev, "%s() %ld\n", __func__, action); dev_dbg(dev, "%s() %ld\n", __func__, action);
...@@ -389,16 +389,16 @@ static int pm_runtime_clk_notify(struct notifier_block *nb, ...@@ -389,16 +389,16 @@ static int pm_runtime_clk_notify(struct notifier_block *nb,
switch (action) { switch (action) {
case BUS_NOTIFY_ADD_DEVICE: case BUS_NOTIFY_ADD_DEVICE:
if (clknb->con_ids[0]) { if (clknb->con_ids[0]) {
for (con_id = clknb->con_ids[0]; *con_id; con_id++) for (con_id = clknb->con_ids; *con_id; con_id++)
enable_clock(dev, con_id); enable_clock(dev, *con_id);
} else { } else {
enable_clock(dev, NULL); enable_clock(dev, NULL);
} }
break; break;
case BUS_NOTIFY_DEL_DEVICE: case BUS_NOTIFY_DEL_DEVICE:
if (clknb->con_ids[0]) { if (clknb->con_ids[0]) {
for (con_id = clknb->con_ids[0]; *con_id; con_id++) for (con_id = clknb->con_ids; *con_id; con_id++)
disable_clock(dev, con_id); disable_clock(dev, *con_id);
} else { } else {
disable_clock(dev, NULL); disable_clock(dev, NULL);
} }
......
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