summaryrefslogtreecommitdiffstats
path: root/libpdbg
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2018-08-13 17:15:30 +1000
committerAlistair Popple <alistair@popple.id.au>2018-08-13 18:15:19 +1000
commit74dae25ea50a8197a26d8196f39bfc70310c4906 (patch)
tree4ba8a37a4e5ba8b485f43ed06ff45131fb5b2159 /libpdbg
parentfc52d52d28b76c421ab1093f432b6582f4d2ac24 (diff)
downloadpdbg-74dae25ea50a8197a26d8196f39bfc70310c4906.tar.gz
pdbg-74dae25ea50a8197a26d8196f39bfc70310c4906.zip
Remove PDBG_TARGET_PENDING_RELEASE status
This doesn't seem to be used for anything and simply creates another target state which adds complexity. Either a target was released or it wasn't (because it's children have not been released). Signed-off-by: Alistair Popple <alistair@popple.id.au>
Diffstat (limited to 'libpdbg')
-rw-r--r--libpdbg/libpdbg.h5
-rw-r--r--libpdbg/target.c9
2 files changed, 2 insertions, 12 deletions
diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h
index 694085c..e626786 100644
--- a/libpdbg/libpdbg.h
+++ b/libpdbg/libpdbg.h
@@ -38,8 +38,6 @@ struct pdbg_target *__pdbg_next_child_target(struct pdbg_target *parent, struct
* Selection code may set this.
*
* released - the target was enabled and has now been released.
- * pending release - the target was released but some children still enabled
- * so the ->release method hasn't been called yet.
*
* Initially these properties are read from the device tree. This allows the
* client application to select which targets it does not care about to avoid
@@ -48,8 +46,7 @@ struct pdbg_target *__pdbg_next_child_target(struct pdbg_target *parent, struct
*/
enum pdbg_target_status {PDBG_TARGET_UNKNOWN = 0, PDBG_TARGET_ENABLED,
PDBG_TARGET_DISABLED, PDBG_TARGET_MUSTEXIST,
- PDBG_TARGET_NONEXISTENT, PDBG_TARGET_RELEASED,
- PDBG_TARGET_PENDING_RELEASE };
+ PDBG_TARGET_NONEXISTENT, PDBG_TARGET_RELEASED};
#define pdbg_for_each_target(class, parent, target) \
for (target = __pdbg_next_target(class, parent, NULL); \
diff --git a/libpdbg/target.c b/libpdbg/target.c
index be3b845..b2f583f 100644
--- a/libpdbg/target.c
+++ b/libpdbg/target.c
@@ -291,7 +291,6 @@ enum pdbg_target_status pdbg_target_probe(struct pdbg_target *target)
status = pdbg_target_status(target);
assert(status != PDBG_TARGET_RELEASED);
- assert(status != PDBG_TARGET_PENDING_RELEASE);
if (status == PDBG_TARGET_DISABLED || status == PDBG_TARGET_NONEXISTENT
|| status == PDBG_TARGET_ENABLED)
@@ -320,7 +319,6 @@ enum pdbg_target_status pdbg_target_probe(struct pdbg_target *target)
return pdbg_target_status(target);
case PDBG_TARGET_RELEASED:
- case PDBG_TARGET_PENDING_RELEASE:
case PDBG_TARGET_MUSTEXIST:
case PDBG_TARGET_UNKNOWN:
/* We must know by now if the parent exists or not */
@@ -355,18 +353,13 @@ void pdbg_target_release(struct pdbg_target *target)
assert(target);
/* If it's not enabled, the parent wasn't enabled. */
- if ((pdbg_target_status(target) != PDBG_TARGET_ENABLED) &&
- (pdbg_target_status(target) != PDBG_TARGET_PENDING_RELEASE))
+ if ((pdbg_target_status(target) != PDBG_TARGET_ENABLED))
return;
- target->status = PDBG_TARGET_PENDING_RELEASE;
-
pdbg_for_each_child_target(target, child) {
/* Not all children released yet, stop here. */
if (pdbg_target_status(child) == PDBG_TARGET_ENABLED)
return;
- if (pdbg_target_status(child) == PDBG_TARGET_PENDING_RELEASE)
- return;
}
/* At this point any parents must exist and have already been probed */
OpenPOWER on IntegriCloud