aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/omap_device.c')
-rw-r--r--arch/arm/mach-omap2/omap_device.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index e417f7fcb2ba..4cb8fd9f741f 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -218,13 +218,13 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
218 */ 218 */
219static int _omap_device_enable_hwmods(struct omap_device *od) 219static int _omap_device_enable_hwmods(struct omap_device *od)
220{ 220{
221 int ret = 0;
221 int i; 222 int i;
222 223
223 for (i = 0; i < od->hwmods_cnt; i++) 224 for (i = 0; i < od->hwmods_cnt; i++)
224 omap_hwmod_enable(od->hwmods[i]); 225 ret |= omap_hwmod_enable(od->hwmods[i]);
225 226
226 /* XXX pass along return value here? */ 227 return ret;
227 return 0;
228} 228}
229 229
230/** 230/**
@@ -235,13 +235,13 @@ static int _omap_device_enable_hwmods(struct omap_device *od)
235 */ 235 */
236static int _omap_device_idle_hwmods(struct omap_device *od) 236static int _omap_device_idle_hwmods(struct omap_device *od)
237{ 237{
238 int ret = 0;
238 int i; 239 int i;
239 240
240 for (i = 0; i < od->hwmods_cnt; i++) 241 for (i = 0; i < od->hwmods_cnt; i++)
241 omap_hwmod_idle(od->hwmods[i]); 242 ret |= omap_hwmod_idle(od->hwmods[i]);
242 243
243 /* XXX pass along return value here? */ 244 return ret;
244 return 0;
245} 245}
246 246
247/* Public functions for use by core code */ 247/* Public functions for use by core code */
@@ -589,18 +589,20 @@ static int _od_runtime_suspend(struct device *dev)
589 int ret; 589 int ret;
590 590
591 ret = pm_generic_runtime_suspend(dev); 591 ret = pm_generic_runtime_suspend(dev);
592 if (ret)
593 return ret;
592 594
593 if (!ret) 595 return omap_device_idle(pdev);
594 omap_device_idle(pdev);
595
596 return ret;
597} 596}
598 597
599static int _od_runtime_resume(struct device *dev) 598static int _od_runtime_resume(struct device *dev)
600{ 599{
601 struct platform_device *pdev = to_platform_device(dev); 600 struct platform_device *pdev = to_platform_device(dev);
601 int ret;
602 602
603 omap_device_enable(pdev); 603 ret = omap_device_enable(pdev);
604 if (ret)
605 return ret;
604 606
605 return pm_generic_runtime_resume(dev); 607 return pm_generic_runtime_resume(dev);
606} 608}
@@ -734,7 +736,8 @@ int omap_device_enable(struct platform_device *pdev)
734 736
735 ret = _omap_device_enable_hwmods(od); 737 ret = _omap_device_enable_hwmods(od);
736 738
737 od->_state = OMAP_DEVICE_STATE_ENABLED; 739 if (ret == 0)
740 od->_state = OMAP_DEVICE_STATE_ENABLED;
738 741
739 return ret; 742 return ret;
740} 743}
@@ -764,7 +767,8 @@ int omap_device_idle(struct platform_device *pdev)
764 767
765 ret = _omap_device_idle_hwmods(od); 768 ret = _omap_device_idle_hwmods(od);
766 769
767 od->_state = OMAP_DEVICE_STATE_IDLE; 770 if (ret == 0)
771 od->_state = OMAP_DEVICE_STATE_IDLE;
768 772
769 return ret; 773 return ret;
770} 774}