summaryrefslogtreecommitdiffstats
path: root/include/hwconfig.h
blob: d517f782fd95c86cc151b935d218f40d731a0663 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * An inteface for configuring a hardware via u-boot environment.
 *
 * Copyright (c) 2009  MontaVista Software, Inc.
 *
 * Author: Anton Vorontsov <avorontsov@ru.mvista.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.
 */

#ifndef _HWCONFIG_H
#define _HWCONFIG_H

#include <linux/types.h>
#include <asm/errno.h>

#ifdef CONFIG_HWCONFIG

extern int hwconfig(const char *opt);
extern const char *hwconfig_arg(const char *opt, size_t *arglen);
extern int hwconfig_arg_cmp(const char *opt, const char *arg);
extern int hwconfig_sub(const char *opt, const char *subopt);
extern const char *hwconfig_subarg(const char *opt, const char *subopt,
				   size_t *subarglen);
extern int hwconfig_subarg_cmp(const char *opt, const char *subopt,
			       const char *subarg);

#else

static inline int hwconfig(const char *opt)
{
	return -ENOSYS;
}

static inline const char *hwconfig_arg(const char *opt, size_t *arglen)
{
	*arglen = 0;
	return "";
}

static inline int hwconfig_arg_cmp(const char *opt, const char *arg)
{
	return -ENOSYS;
}

static inline int hwconfig_sub(const char *opt, const char *subopt)
{
	return -ENOSYS;
}

static inline const char *hwconfig_subarg(const char *opt, const char *subopt,
					  size_t *subarglen)
{
	*subarglen = 0;
	return "";
}

static inline int hwconfig_subarg_cmp(const char *opt, const char *subopt,
				      const char *subarg)
{
	return -ENOSYS;
}

#endif /* CONFIG_HWCONFIG */

#endif /* _HWCONFIG_H */
OpenPOWER on IntegriCloud