1 // 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 
dm_rng_read(struct udevice * dev,void * buffer,size_t size)10 int 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 
20 UCLASS_DRIVER(rng) = {
21 	.name = "rng",
22 	.id = UCLASS_RNG,
23 };
24