- printf("Can't %s %s %s.\nError: %d (%s)\n", getset, thing, for_dev,
- ret, errno_str(ret));
- return CMD_RET_FAILURE;
-}
-
-static int regulator_get(bool list_only, int get_seq, struct udevice **devp)
-{
- struct dm_regulator_uclass_platdata *uc_pdata;
- struct udevice *dev;
- int ret;
-
- if (devp)
- *devp = NULL;
-
- for (ret = uclass_first_device(UCLASS_REGULATOR, &dev); dev;
- ret = uclass_next_device(&dev)) {
- if (list_only) {
- uc_pdata = dev_get_uclass_platdata(dev);
- printf("|%*d | %*.*s @ %-*.*s| %s @ %s\n",
- LIMIT_SEQ, dev->seq,
- LIMIT_DEVNAME, LIMIT_DEVNAME, dev->name,
- LIMIT_OFNAME, LIMIT_OFNAME, uc_pdata->name,
- dev->parent->name,
- dev_get_uclass_name(dev->parent));
- continue;
- }
-
- if (dev->seq == get_seq) {
- if (devp)
- *devp = dev;
- else
- return -EINVAL;
-
- return 0;
- }
- }
-
- if (list_only)
- return ret;