~emersion/drmdb

a79789ee97c47d6e540adddaf366b9575c9964be — Simon Ser 2 years ago 8287798
Fix alt device drivers
1 files changed, 3 insertions(+), 3 deletions(-)

M server.go
M server.go => server.go +3 -3
@@ 270,17 270,17 @@ func New() *echo.Echo {
			return c.JSON(http.StatusOK, n)
		} else {
			var altDevices []altDeviceData
			err := walk(func(k string, other *drmtree.Node) error {
			err := walk(func(k string, alt *drmtree.Node) error {
				if k == key {
					return nil
				}
				if other.Device.BusType != n.Device.BusType || other.Device.BusID() != n.Device.BusID() {
				if alt.Device.BusType != n.Device.BusType || alt.Device.BusID() != n.Device.BusID() {
					return nil
				}

				altDevices = append(altDevices, altDeviceData{
					Key: k,
					Driver: n.Driver,
					Driver: alt.Driver,
				})
				return nil
			})