Use newEndpoint() for initialization. Add an indirection for

newUSBTransfer.
This commit is contained in:
Sebastian Zagrodzki
2017-02-19 15:35:35 +01:00
parent 360740e76c
commit 2efb1a354f
2 changed files with 21 additions and 4 deletions

View File

@@ -122,9 +122,7 @@ func (d *Device) Close() error {
}
func (d *Device) OpenEndpoint(conf, iface, setup, epoint uint8) (Endpoint, error) {
end := &endpoint{
Device: d,
}
end := newEndpoint(d)
var setAlternate bool
for _, c := range d.Configs {