/* It's also responsible for power management interactions. Some configurations might not work with our current power sources. For now we just assume the gadget is always self-powered.  */
static int do_set_config(struct fsg_common *common, u8 new_config)
/* It's also responsible for power management interactions. Some configurations might not work with our current power sources. For now we just assume the gadget is always self-powered.  */
static int do_set_config(struct fsg_common *common, u8 new_config)
{
	int	rc = 0;
	if (common->config != 0) {
		DBG(common, "reset config\n");
		common->config = 0;
		rc = do_set_interface(common, -1);
	}
	if (new_config != 0) {
		common->config = new_config;
		rc = do_set_interface(common, 0);
		if (rc != 0)
			common->config = 0;
	}
	return rc;
}