/* pnp_auto_config_dev - automatically assigns resources to a device @dev: pointer to the desired device  */
int pnp_auto_config_dev(struct pnp_dev *dev)
/* pnp_auto_config_dev - automatically assigns resources to a device @dev: pointer to the desired device  */
int pnp_auto_config_dev(struct pnp_dev *dev)
{
	int i, ret;
	if (!pnp_can_configure(dev)) {
		pnp_dbg(&dev->dev, "configuration not supported\n");
		return -ENODEV;
	}
	ret = pnp_assign_resources(dev, 0);
	if (ret == 0)
		return 0;
	for (i = 1; i < dev->num_dependent_sets; i++) {
		ret = pnp_assign_resources(dev, i);
		if (ret == 0)
			return 0;
	}
	dev_err(&dev->dev, "unable to assign resources\n");
	return ret;
}