提交 64e94aaf 编写于 作者: R Rafael J. Wysocki

PM / Sleep: Simplify device_suspend_noirq()

Remove a few if () and return statements in device_suspend_noirq()
that aren't really necessary.
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
上级 d74e278a
...@@ -763,31 +763,23 @@ static pm_message_t resume_event(pm_message_t sleep_state) ...@@ -763,31 +763,23 @@ static pm_message_t resume_event(pm_message_t sleep_state)
*/ */
static int device_suspend_noirq(struct device *dev, pm_message_t state) static int device_suspend_noirq(struct device *dev, pm_message_t state)
{ {
int error; int error = 0;
if (dev->pm_domain) { if (dev->pm_domain) {
pm_dev_dbg(dev, state, "LATE power domain "); pm_dev_dbg(dev, state, "LATE power domain ");
error = pm_noirq_op(dev, &dev->pm_domain->ops, state); error = pm_noirq_op(dev, &dev->pm_domain->ops, state);
if (error)
return error;
} else if (dev->type && dev->type->pm) { } else if (dev->type && dev->type->pm) {
pm_dev_dbg(dev, state, "LATE type "); pm_dev_dbg(dev, state, "LATE type ");
error = pm_noirq_op(dev, dev->type->pm, state); error = pm_noirq_op(dev, dev->type->pm, state);
if (error)
return error;
} else if (dev->class && dev->class->pm) { } else if (dev->class && dev->class->pm) {
pm_dev_dbg(dev, state, "LATE class "); pm_dev_dbg(dev, state, "LATE class ");
error = pm_noirq_op(dev, dev->class->pm, state); error = pm_noirq_op(dev, dev->class->pm, state);
if (error)
return error;
} else if (dev->bus && dev->bus->pm) { } else if (dev->bus && dev->bus->pm) {
pm_dev_dbg(dev, state, "LATE "); pm_dev_dbg(dev, state, "LATE ");
error = pm_noirq_op(dev, dev->bus->pm, state); error = pm_noirq_op(dev, dev->bus->pm, state);
if (error)
return error;
} }
return 0; return error;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册