blob: 06ddfa14ac8e2bfa20d4f93bdc43f9af5af55faa [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 <dm.h>
9#include <rng.h>
10
11int dm_rng_read(struct udevice *dev, void *buffer, size_t size)
12{
13 const struct dm_rng_ops *ops = device_get_ops(dev);
14
15 if (!ops->read)
16 return -ENOSYS;
17
18 return ops->read(dev, buffer, size);
19}
20
21UCLASS_DRIVER(rng) = {
22 .name = "rng",
23 .id = UCLASS_RNG,
24};