On Tue, 21 Aug 2012, Lan Tianyu wrote: > This patch is to add "auto" option to attribute portX/control. > When echo "auto", the port's feature PORT_POWER would be clear > if the port's connect type was mark not-used(connectability and > visibility are both cleared) and with no device attached. > @@ -4741,6 +4746,18 @@ static ssize_t store_port_power_control(struct device *dev, > usb_autopm_put_interface(intf); > if (ret < 0) > return -EIO; > + } else if (len == sizeof(auto_string) - 1 > + && strncmp(buf, auto_string, len) == 0) { > + hub_port->port_power_policy = USB_PORT_POWER_AUTO; > + if (hub_port->connect_type > + == USB_PORT_NOT_USED && !hub_port->child) { Minor style issue: When you indent a continuation line, the level of indenting should be different from the lines that follow so that it doesn't look as though the continuation line is part of the "if" block. > + usb_autopm_get_interface(intf); > + ret = clear_port_feature(hdev, port1, > + USB_PORT_FEAT_POWER); > + usb_autopm_put_interface(intf); > + if (ret < 0) > + return -EIO; > + } > } else > return -EINVAL; You forgot to change the logic in hub_power_on(). You have to handle the USB_PORT_POWER_AUTO case. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html