Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: fireface: rename callback functions

It's cleared that Fireface 400 transmits quadlet message for two purposes
at least; received MIDI messages and notification of knob control
operation. Nevertheless current implementation uses callback function name
just for MIDI messages.

This commit renames the callback functions.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20230112120954.500692-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Takashi Sakamoto and committed by
Takashi Iwai
50c597c7 af13842c

+16 -18
+6 -6
sound/firewire/fireface/ff-protocol-former.c
··· 402 402 // address. 403 403 // A write transaction to clear registered higher 4 bytes of destination address 404 404 // has an effect to suppress asynchronous transaction from device. 405 - static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset, 406 - __le32 *buf, size_t length) 405 + static void ff800_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf, 406 + size_t length) 407 407 { 408 408 int i; 409 409 ··· 418 418 } 419 419 420 420 const struct snd_ff_protocol snd_ff_protocol_ff800 = { 421 - .handle_midi_msg = ff800_handle_midi_msg, 421 + .handle_msg = ff800_handle_midi_msg, 422 422 .fill_midi_msg = former_fill_midi_msg, 423 423 .get_clock = former_get_clock, 424 424 .switch_fetching_mode = former_switch_fetching_mode, ··· 553 553 // input attenuation. This driver allocates destination address with '0000'0000 554 554 // in its lower offset and expects userspace application to configure the 555 555 // register for it. 556 - static void ff400_handle_midi_msg(struct snd_ff *ff, unsigned int offset, 557 - __le32 *buf, size_t length) 556 + static void ff400_handle_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf, 557 + size_t length) 558 558 { 559 559 int i; 560 560 ··· 592 592 } 593 593 594 594 const struct snd_ff_protocol snd_ff_protocol_ff400 = { 595 - .handle_midi_msg = ff400_handle_midi_msg, 595 + .handle_msg = ff400_handle_msg, 596 596 .fill_midi_msg = former_fill_midi_msg, 597 597 .get_clock = former_get_clock, 598 598 .switch_fetching_mode = former_switch_fetching_mode,
+3 -3
sound/firewire/fireface/ff-protocol-latter.c
··· 393 393 // input attenuation. This driver allocates for the first option 394 394 // (0x'....'....'0000'0000) and expects userspace application to configure the 395 395 // register for it. 396 - static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset, 397 - __le32 *buf, size_t length) 396 + static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset, const __le32 *buf, 397 + size_t length) 398 398 { 399 399 u32 data = le32_to_cpu(*buf); 400 400 unsigned int index = (data & 0x000000f0) >> 4; ··· 529 529 } 530 530 531 531 const struct snd_ff_protocol snd_ff_protocol_latter = { 532 - .handle_midi_msg = latter_handle_midi_msg, 532 + .handle_msg = latter_handle_midi_msg, 533 533 .fill_midi_msg = latter_fill_midi_msg, 534 534 .get_clock = latter_get_clock, 535 535 .switch_fetching_mode = latter_switch_fetching_mode,
+5 -7
sound/firewire/fireface/ff-transaction.c
··· 125 125 transmit_midi_msg(ff, 1); 126 126 } 127 127 128 - static void handle_midi_msg(struct fw_card *card, struct fw_request *request, 129 - int tcode, int destination, int source, 130 - int generation, unsigned long long offset, 131 - void *data, size_t length, void *callback_data) 128 + static void handle_msg(struct fw_card *card, struct fw_request *request, int tcode, 129 + int destination, int source, int generation, unsigned long long offset, 130 + void *data, size_t length, void *callback_data) 132 131 { 133 132 struct snd_ff *ff = callback_data; 134 133 __le32 *buf = data; ··· 135 136 fw_send_response(card, request, RCODE_COMPLETE); 136 137 137 138 offset -= ff->async_handler.offset; 138 - ff->spec->protocol->handle_midi_msg(ff, (unsigned int)offset, buf, 139 - length); 139 + ff->spec->protocol->handle_msg(ff, (unsigned int)offset, buf, length); 140 140 } 141 141 142 142 static int allocate_own_address(struct snd_ff *ff, int i) ··· 144 146 int err; 145 147 146 148 ff->async_handler.length = ff->spec->midi_addr_range; 147 - ff->async_handler.address_callback = handle_midi_msg; 149 + ff->async_handler.address_callback = handle_msg; 148 150 ff->async_handler.callback_data = ff; 149 151 150 152 midi_msg_region.start = 0x000100000000ull * i;
+2 -2
sound/firewire/fireface/ff.h
··· 110 110 }; 111 111 112 112 struct snd_ff_protocol { 113 - void (*handle_midi_msg)(struct snd_ff *ff, unsigned int offset, 114 - __le32 *buf, size_t length); 113 + void (*handle_msg)(struct snd_ff *ff, unsigned int offset, const __le32 *buf, 114 + size_t length); 115 115 int (*fill_midi_msg)(struct snd_ff *ff, 116 116 struct snd_rawmidi_substream *substream, 117 117 unsigned int port);