blob: b6af3b8606a763b4bf18eb3ba87ba0b7502297e5 [file] [log] [blame]
Sughosh Ganu90592ed2019-12-28 23:58:27 +05301// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (c) 2019, Linaro Limited
4 */
5
6#include <common.h>
7#include <dm.h>
8#include <rng.h>
9
10int dm_rng_read(struct udevice *dev, void *buffer, size_t size)
11{
12 const struct dm_rng_ops *ops = device_get_ops(dev);
13
14 if (!ops->read)
15 return -ENOSYS;
16
17 return ops->read(dev, buffer, size);
18}
19
20UCLASS_DRIVER(rng) = {
21 .name = "rng",
22 .id = UCLASS_RNG,
23};