aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/omap_device.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-07-09 21:15:20 -0400
committerPaul Walmsley <paul@pwsan.com>2011-07-09 21:15:20 -0400
commit8f0d69dedcf1d10f9f72845f17f9a09a6ef0d66c (patch)
tree20c5cc235b8101f0019fa1fa72507a161b947ba5 /arch/arm/plat-omap/omap_device.c
parentecba3287b4121dcf3ca7607fe71c205913edec06 (diff)
OMAP: omap_device: replace _find_by_pdev() with to_omap_device()
The omap_device layer currently has two ways of getting an omap_device pointer from a platform_device pointer. Replace current usage of _find_by_pdev() with to_omap_device() since to_omap_device() is more familiar to the existing to_platform_device() used when getting a platform_device pointer from a struct device pointer. Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/plat-omap/omap_device.c')
-rw-r--r--arch/arm/plat-omap/omap_device.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 49fc0df0c21f..c8b9cd1716ba 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -236,11 +236,6 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
236 return 0; 236 return 0;
237} 237}
238 238
239static inline struct omap_device *_find_by_pdev(struct platform_device *pdev)
240{
241 return container_of(pdev, struct omap_device, pdev);
242}
243
244/** 239/**
245 * _add_optional_clock_clkdev - Add clkdev entry for hwmod optional clocks 240 * _add_optional_clock_clkdev - Add clkdev entry for hwmod optional clocks
246 * @od: struct omap_device *od 241 * @od: struct omap_device *od
@@ -316,7 +311,7 @@ u32 omap_device_get_context_loss_count(struct platform_device *pdev)
316 struct omap_device *od; 311 struct omap_device *od;
317 u32 ret = 0; 312 u32 ret = 0;
318 313
319 od = _find_by_pdev(pdev); 314 od = to_omap_device(pdev);
320 315
321 if (od->hwmods_cnt) 316 if (od->hwmods_cnt)
322 ret = omap_hwmod_get_context_loss_count(od->hwmods[0]); 317 ret = omap_hwmod_get_context_loss_count(od->hwmods[0]);
@@ -611,7 +606,7 @@ int omap_device_enable(struct platform_device *pdev)
611 int ret; 606 int ret;
612 struct omap_device *od; 607 struct omap_device *od;
613 608
614 od = _find_by_pdev(pdev); 609 od = to_omap_device(pdev);
615 610
616 if (od->_state == OMAP_DEVICE_STATE_ENABLED) { 611 if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
617 WARN(1, "omap_device: %s.%d: %s() called from invalid state %d\n", 612 WARN(1, "omap_device: %s.%d: %s() called from invalid state %d\n",
@@ -650,7 +645,7 @@ int omap_device_idle(struct platform_device *pdev)
650 int ret; 645 int ret;
651 struct omap_device *od; 646 struct omap_device *od;
652 647
653 od = _find_by_pdev(pdev); 648 od = to_omap_device(pdev);
654 649
655 if (od->_state != OMAP_DEVICE_STATE_ENABLED) { 650 if (od->_state != OMAP_DEVICE_STATE_ENABLED) {
656 WARN(1, "omap_device: %s.%d: %s() called from invalid state %d\n", 651 WARN(1, "omap_device: %s.%d: %s() called from invalid state %d\n",
@@ -681,7 +676,7 @@ int omap_device_shutdown(struct platform_device *pdev)
681 int ret, i; 676 int ret, i;
682 struct omap_device *od; 677 struct omap_device *od;
683 678
684 od = _find_by_pdev(pdev); 679 od = to_omap_device(pdev);
685 680
686 if (od->_state != OMAP_DEVICE_STATE_ENABLED && 681 if (od->_state != OMAP_DEVICE_STATE_ENABLED &&
687 od->_state != OMAP_DEVICE_STATE_IDLE) { 682 od->_state != OMAP_DEVICE_STATE_IDLE) {
@@ -722,7 +717,7 @@ int omap_device_align_pm_lat(struct platform_device *pdev,
722 int ret = -EINVAL; 717 int ret = -EINVAL;
723 struct omap_device *od; 718 struct omap_device *od;
724 719
725 od = _find_by_pdev(pdev); 720 od = to_omap_device(pdev);
726 721
727 if (new_wakeup_lat_limit == od->dev_wakeup_lat) 722 if (new_wakeup_lat_limit == od->dev_wakeup_lat)
728 return 0; 723 return 0;