diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2010-08-23 13:53:10 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-09-23 20:14:13 -0400 |
commit | a1ed40cb258ba7a8574e662de5ae6ba4dc314436 (patch) | |
tree | aa525aa8623823afccc3b5fde185003f5cc22e8f /arch/arm/plat-omap/omap_device.c | |
parent | 6f7f63cc9adf3192e6fcac4e8bed5cc10fd924aa (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>
Diffstat (limited to 'arch/arm/plat-omap/omap_device.c')
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 20 |
1 files changed, 0 insertions, 20 deletions
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 | */ | ||
636 | bool 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 | * |