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 <dm.h> |
| 9 | #include <rng.h> |
| 10 | |
| 11 | int 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 | |
| 21 | UCLASS_DRIVER(rng) = { |
| 22 | .name = "rng", |
| 23 | .id = UCLASS_RNG, |
| 24 | }; |