]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
d8587993 TC |
2 | /* |
3 | * Copyright (C) 2015 Thomas Chou <[email protected]> | |
d8587993 TC |
4 | */ |
5 | ||
6 | #include <common.h> | |
7 | #include <dm.h> | |
e9f62db6 | 8 | #include <dm/device-internal.h> |
d8587993 TC |
9 | #include <errno.h> |
10 | #include <mtd.h> | |
11 | ||
e9f62db6 MR |
12 | /** |
13 | * mtd_probe - Probe the device @dev if not already done | |
14 | * | |
15 | * @dev: U-Boot device to probe | |
16 | * | |
17 | * @return 0 on success, an error otherwise. | |
18 | */ | |
19 | int mtd_probe(struct udevice *dev) | |
20 | { | |
21 | if (device_active(dev)) | |
22 | return 0; | |
23 | ||
24 | return device_probe(dev); | |
25 | } | |
26 | ||
d8587993 TC |
27 | /* |
28 | * Implement a MTD uclass which should include most flash drivers. | |
29 | * The uclass private is pointed to mtd_info. | |
30 | */ | |
31 | ||
32 | UCLASS_DRIVER(mtd) = { | |
33 | .id = UCLASS_MTD, | |
34 | .name = "mtd", | |
41575d8e | 35 | .per_device_auto = sizeof(struct mtd_info), |
d8587993 | 36 | }; |