summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/amba/ambapp_parent.c
blob: ef6f7e2f0b930f399d48aab291bf8463b4f45f7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 *  AMBA Plug & Play routines
 *
 *  COPYRIGHT (c) 2011
 *  Aeroflex Gaisler
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 */

#include <stdlib.h>
#include <ambapp.h>

struct ambapp_dev *ambapp_find_parent(struct ambapp_dev *dev)
{
  while (dev->prev) {
    if (dev == dev->prev->children)
      return dev->prev;
    dev = dev->prev;
  }
  return NULL;
}