File: of_standard.c

package info (click to toggle)
oflib 0git20070620-8
  • links: PTS
  • area: main
  • in suites: buster
  • size: 144 kB
  • sloc: ansic: 751; makefile: 46
file content (34 lines) | stat: -rw-r--r-- 1,066 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/***************************************************************************
 *   (C) Copyright 2006, 2007 Alastair Poole.  <alastairpoole@gmail.com>   * 
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

#include "of_api.h"

void of_error(char *error)
{
	fprintf(stderr, "Error: %s\n", error);
	exit(EXIT_FAILURE);
}

void of_free_node(struct device_node *node)
{
	if (node->name)
		free(node->name);
	if (node->path)
		free(node->path);
	if (node->full_path)
		free(node->full_path);
	if (node->type)
		free(node->type);
	if (node->linux_phandle.data)
		free(node->linux_phandle.data);
	if (node->data)
		free(node->data);
	if (node)
		free(node);
}