Sughosh Ganu | 90592ed | 2019-12-28 23:58:27 +0530 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (c) 2019, Linaro Limited |
| 4 | */ |
| 5 | |
Patrick Delaunay | 8131335 | 2021-04-27 11:02:19 +0200 | [diff] [blame] | 6 | #define LOG_CATEGORY UCLASS_RNG |
| 7 | |
Sughosh Ganu | 90592ed | 2019-12-28 23:58:27 +0530 | [diff] [blame] | 8 | #include <common.h> |
| 9 | #include <dm.h> |
| 10 | #include <rng.h> |
| 11 | |
| 12 | int 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 | |
| 22 | UCLASS_DRIVER(rng) = { |
| 23 | .name = "rng", |
| 24 | .id = UCLASS_RNG, |
| 25 | }; |