1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 NXP Semiconductors
4 * Copyright (C) 2017 Bin Meng <bmeng.cn@gmail.com>
11 #include <dm/device.h>
14 static int nvme_uclass_post_probe(struct udevice *udev)
17 struct udevice *ns_udev;
19 struct nvme_dev *ndev = dev_get_priv(udev);
21 /* Create a blk device for each namespace */
22 for (i = 0; i < ndev->nn; i++) {
24 * Encode the namespace id to the device name so that
25 * we can extract it when doing the probe.
27 sprintf(name, "blk#%d", i);
29 /* The real blksz and size will be set by nvme_blk_probe() */
30 ret = blk_create_devicef(udev, "nvme-blk", name, IF_TYPE_NVME,
31 -1, 512, 0, &ns_udev);
39 UCLASS_DRIVER(nvme) = {
42 .post_probe = nvme_uclass_post_probe,