/* @dev: Device to supply @num_consumers: Number of consumers to register @consumers: Configuration of consumers; clients are stored here. */
int regulator_bulk_get(struct device *dev, int num_consumers, struct regulator_bulk_data *consumers)
/* @dev: Device to supply @num_consumers: Number of consumers to register @consumers: Configuration of consumers; clients are stored here. */
int regulator_bulk_get(struct device *dev, int num_consumers, struct regulator_bulk_data *consumers)
{
	int i;
	int ret;
	for (i = 0; i < num_consumers; i++)
		consumers[i].consumer = NULL;
	for (i = 0; i < num_consumers; i++) {
		consumers[i].consumer = regulator_get(dev,
						      consumers[i].supply);
		if (IS_ERR(consumers[i].consumer)) {
			ret = PTR_ERR(consumers[i].consumer);
			dev_err(dev, "Failed to get supply '%s': %d\n",
				consumers[i].supply, ret);
			consumers[i].consumer = NULL;
			goto err;
		}
	}
	return 0;
err:
	for (i = 0; i < num_consumers && consumers[i].consumer; i++)
		regulator_put(consumers[i].consumer);
	return ret;
}