mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-05 20:54:31 +00:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
99 lines
2.4 KiB
C
99 lines
2.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* An inteface for configuring a hardware via u-boot environment.
|
|
*
|
|
* Copyright (c) 2009 MontaVista Software, Inc.
|
|
* Copyright 2011 Freescale Semiconductor, Inc.
|
|
*
|
|
* Author: Anton Vorontsov <avorontsov@ru.mvista.com>
|
|
*/
|
|
|
|
#ifndef _HWCONFIG_H
|
|
#define _HWCONFIG_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/errno.h>
|
|
|
|
#ifdef CONFIG_HWCONFIG
|
|
|
|
extern int hwconfig_f(const char *opt, char *buf);
|
|
extern const char *hwconfig_arg_f(const char *opt, size_t *arglen, char *buf);
|
|
extern int hwconfig_arg_cmp_f(const char *opt, const char *arg, char *buf);
|
|
extern int hwconfig_sub_f(const char *opt, const char *subopt, char *buf);
|
|
extern const char *hwconfig_subarg_f(const char *opt, const char *subopt,
|
|
size_t *subarglen, char *buf);
|
|
extern int hwconfig_subarg_cmp_f(const char *opt, const char *subopt,
|
|
const char *subarg, char *buf);
|
|
#else
|
|
|
|
static inline int hwconfig_f(const char *opt, char *buf)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline const char *hwconfig_arg_f(const char *opt, size_t *arglen,
|
|
char *buf)
|
|
{
|
|
*arglen = 0;
|
|
return "";
|
|
}
|
|
|
|
static inline int hwconfig_arg_cmp_f(const char *opt, const char *arg,
|
|
char *buf)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline int hwconfig_sub_f(const char *opt, const char *subopt, char *buf)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline const char *hwconfig_subarg_f(const char *opt, const char *subopt,
|
|
size_t *subarglen, char *buf)
|
|
{
|
|
*subarglen = 0;
|
|
return "";
|
|
}
|
|
|
|
static inline int hwconfig_subarg_cmp_f(const char *opt, const char *subopt,
|
|
const char *subarg, char *buf)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
#endif /* CONFIG_HWCONFIG */
|
|
|
|
static inline int hwconfig(const char *opt)
|
|
{
|
|
return hwconfig_f(opt, NULL);
|
|
}
|
|
|
|
static inline const char *hwconfig_arg(const char *opt, size_t *arglen)
|
|
{
|
|
return hwconfig_arg_f(opt, arglen, NULL);
|
|
}
|
|
|
|
static inline int hwconfig_arg_cmp(const char *opt, const char *arg)
|
|
{
|
|
return hwconfig_arg_cmp_f(opt, arg, NULL);
|
|
}
|
|
|
|
static inline int hwconfig_sub(const char *opt, const char *subopt)
|
|
{
|
|
return hwconfig_sub_f(opt, subopt, NULL);
|
|
}
|
|
|
|
static inline const char *hwconfig_subarg(const char *opt, const char *subopt,
|
|
size_t *subarglen)
|
|
{
|
|
return hwconfig_subarg_f(opt, subopt, subarglen, NULL);
|
|
}
|
|
|
|
static inline int hwconfig_subarg_cmp(const char *opt, const char *subopt,
|
|
const char *subarg)
|
|
{
|
|
return hwconfig_subarg_cmp_f(opt, subopt, subarg, NULL);
|
|
}
|
|
|
|
#endif /* _HWCONFIG_H */
|