summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/board/devices.c
blob: 242a0d718e9173b9ca1c7aee4a9dadd85c7f31f7 (plain)
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
35
36
37
/*
 * Copyright (c) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
 *
 * Under GPLv2 only
 */

#include <common.h>
#include <driver.h>
#include <mach/linux.h>
#include <init.h>

static LIST_HEAD(sandbox_device_list);

int sandbox_add_device(struct device_d *dev)
{
	list_add(&dev->list, &sandbox_device_list);

	return 0;
}

static int sandbox_device_init(void)
{
	struct device_d *dev, *tmp;

	barebox_set_model("barebox sandbox");
	barebox_set_hostname("barebox");

	list_for_each_entry_safe(dev, tmp, &sandbox_device_list, list) {
		/* reset the list_head before registering for real */
		dev->list.prev = NULL;
		dev->list.next = NULL;
		platform_device_register(dev);
	}

	return 0;
}
postcore_initcall(sandbox_device_init);