In the original change, rawmidi_info.tied_device showed -1 for the unknown or untied device. But this would require the user-space to check the protocol version and judge the value conditionally, which is rather error-prone. Instead, set the tied_device = 0 to be default as unknown, and indicate the real device with the offset 1, for achieving more backward compatibility.
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -730,7 +730,7 @@ enum { · 729 unmodified lines | ||
| 730 | 730 | #define SNDRV_RAWMIDI_INFO_UMP 0x00000008 |
| 731 | 731 | #define SNDRV_RAWMIDI_INFO_STREAM_INACTIVE 0x00000010 |
| 732 | 732 | |
| 733 | −#define SNDRV_RAWMIDI_DEVICE_UNKNOWN -1 | |
| 733 | +#define SNDRV_RAWMIDI_DEVICE_UNKNOWN 0 | |
| 734 | 734 | |
| 735 | 735 | struct snd_rawmidi_info { |
| 736 | 736 | unsigned int device; /* RO/WR (control): device number */ |