aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2010-08-23 13:53:10 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-09-23 20:14:13 -0400
commita1ed40cb258ba7a8574e662de5ae6ba4dc314436 (patch)
treeaa525aa8623823afccc3b5fde185003f5cc22e8f
parent6f7f63cc9adf3192e6fcac4e8bed5cc10fd924aa (diff)
Revert "OMAP: omap_device: add omap_device_is_valid()"
This reverts commit 0007122ad85cc36b1c18c0b59344093ca210d206. The dereference method of checking for a valid omap_device when wrapping a platform_device is rather unsafe and dangerous. Instead, a better way of checking for a valid omap-device is to use a common parent device for all omap_devices, then a check can simply be made using the device parent. The only user of this API was the initial version of the runtime PM core for OMAP. This has now been switched to check device parent, so there are no more users of this API. Acked-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h2
-rw-r--r--arch/arm/plat-omap/omap_device.c20
2 files changed, 0 insertions, 22 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 25cd9ac3b095..bad4c3df70d8 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -62,7 +62,6 @@
62 * 62 *
63 */ 63 */
64struct omap_device { 64struct omap_device {
65 u32 magic;
66 struct platform_device pdev; 65 struct platform_device pdev;
67 struct omap_hwmod **hwmods; 66 struct omap_hwmod **hwmods;
68 struct omap_device_pm_latency *pm_lats; 67 struct omap_device_pm_latency *pm_lats;
@@ -82,7 +81,6 @@ int omap_device_shutdown(struct platform_device *pdev);
82 81
83/* Core code interface */ 82/* Core code interface */
84 83
85bool omap_device_is_valid(struct omap_device *od);
86int omap_device_count_resources(struct omap_device *od); 84int omap_device_count_resources(struct omap_device *od);
87int omap_device_fill_resources(struct omap_device *od, struct resource *res); 85int omap_device_fill_resources(struct omap_device *od, struct resource *res);
88 86
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index d2b160942ccc..7f05f4911862 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -90,12 +90,6 @@
90#define USE_WAKEUP_LAT 0 90#define USE_WAKEUP_LAT 0
91#define IGNORE_WAKEUP_LAT 1 91#define IGNORE_WAKEUP_LAT 1
92 92
93/*
94 * OMAP_DEVICE_MAGIC: used to determine whether a struct omap_device
95 * obtained via container_of() is in fact a struct omap_device
96 */
97#define OMAP_DEVICE_MAGIC 0xf00dcafe
98
99/* Private functions */ 93/* Private functions */
100 94
101/** 95/**
@@ -414,8 +408,6 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
414 od->pm_lats = pm_lats; 408 od->pm_lats = pm_lats;
415 od->pm_lats_cnt = pm_lats_cnt; 409 od->pm_lats_cnt = pm_lats_cnt;
416 410
417 od->magic = OMAP_DEVICE_MAGIC;
418
419 if (is_early_device) 411 if (is_early_device)
420 ret = omap_early_device_register(od); 412 ret = omap_early_device_register(od);
421 else 413 else
@@ -627,18 +619,6 @@ int omap_device_align_pm_lat(struct platform_device *pdev,
627} 619}
628 620
629/** 621/**
630 * omap_device_is_valid - Check if pointer is a valid omap_device
631 * @od: struct omap_device *
632 *
633 * Return whether struct omap_device pointer @od points to a valid
634 * omap_device.
635 */
636bool omap_device_is_valid(struct omap_device *od)
637{
638 return (od && od->magic == OMAP_DEVICE_MAGIC);
639}
640
641/**
642 * omap_device_get_pwrdm - return the powerdomain * associated with @od 622 * omap_device_get_pwrdm - return the powerdomain * associated with @od
643 * @od: struct omap_device * 623 * @od: struct omap_device *
644 * 624 *