blob: 53108e1b3191638cd98eaab2196d63723a97f90e [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
Patrick Delaunay81313352021-04-27 11:02:19 +02006#define LOG_CATEGORY UCLASS_RNG
7
Sughosh Ganu90592ed2019-12-28 23:58:27 +05308#include <common.h>
9#include <dm.h>
10#include <rng.h>
11
12int dm_rng_read(struct udevice *dev, void *buffer, size_t size)
13{
14 const struct dm_rng_ops *ops = device_get_ops(dev);
15
16 if (!ops->read)
17 return -ENOSYS;
18
19 return ops->read(dev, buffer, size);
20}
21
22UCLASS_DRIVER(rng) = {
23 .name = "rng",
24 .id = UCLASS_RNG,
25};