mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-27 07:01:24 +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>
61 lines
1.3 KiB
C
61 lines
1.3 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <errno.h>
|
|
#include <misc.h>
|
|
|
|
/*
|
|
* Implement a miscellaneous uclass for those do not fit other more
|
|
* general classes. A set of generic read, write and ioctl methods may
|
|
* be used to access the device.
|
|
*/
|
|
|
|
int misc_read(struct udevice *dev, int offset, void *buf, int size)
|
|
{
|
|
const struct misc_ops *ops = device_get_ops(dev);
|
|
|
|
if (!ops->read)
|
|
return -ENOSYS;
|
|
|
|
return ops->read(dev, offset, buf, size);
|
|
}
|
|
|
|
int misc_write(struct udevice *dev, int offset, void *buf, int size)
|
|
{
|
|
const struct misc_ops *ops = device_get_ops(dev);
|
|
|
|
if (!ops->write)
|
|
return -ENOSYS;
|
|
|
|
return ops->write(dev, offset, buf, size);
|
|
}
|
|
|
|
int misc_ioctl(struct udevice *dev, unsigned long request, void *buf)
|
|
{
|
|
const struct misc_ops *ops = device_get_ops(dev);
|
|
|
|
if (!ops->ioctl)
|
|
return -ENOSYS;
|
|
|
|
return ops->ioctl(dev, request, buf);
|
|
}
|
|
|
|
int misc_call(struct udevice *dev, int msgid, void *tx_msg, int tx_size,
|
|
void *rx_msg, int rx_size)
|
|
{
|
|
const struct misc_ops *ops = device_get_ops(dev);
|
|
|
|
if (!ops->call)
|
|
return -ENOSYS;
|
|
|
|
return ops->call(dev, msgid, tx_msg, tx_size, rx_msg, rx_size);
|
|
}
|
|
|
|
UCLASS_DRIVER(misc) = {
|
|
.id = UCLASS_MISC,
|
|
.name = "misc",
|
|
};
|