| // SPDX-License-Identifier: GPL-2.0+ |
| * Niel Fourie, DENX Software Engineering, lusus@denx.de. |
| static int do_lsblk(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) |
| struct driver *d = ll_entry_start(struct driver, driver); |
| const int n_ents = ll_entry_count(struct driver, driver); |
| ret = uclass_get(UCLASS_BLK, &uc); |
| puts("Could not get BLK uclass.\n"); |
| puts("Block Driver Devices\n"); |
| puts("-----------------------------\n"); |
| for (entry = d; entry < d + n_ents; entry++) { |
| if (entry->id != UCLASS_BLK) |
| printf("%-20.20s", entry->name); |
| uclass_foreach_dev(udev, uc) { |
| if (udev->driver != entry) |
| desc = dev_get_uclass_plat(udev); |
| printf("%c %s %u", i ? ',' : ':', |
| blk_get_uclass_name(desc->uclass_id), |
| U_BOOT_CMD(lsblk, 1, 0, do_lsblk, "list block drivers and devices", |
| "- display list of block device drivers and attached block devices" |