Commit 14101a06 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: 6fire: Reduce multi-level conditionals in usb6fire_chip_disconnect()



The current code has deep indentation levels because of multiple if's.
Make it returning and reduce the multi-level conditionals for
increasing the code readability.

No functional change, just but a code refactoring.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260414132218.411013-4-tiwai@suse.de
parent 4d5de85b
Loading
Loading
Loading
Loading
+23 −20
Original line number Diff line number Diff line
@@ -165,9 +165,14 @@ static void usb6fire_chip_disconnect(struct usb_interface *intf)

	guard(mutex)(&register_mutex);
	chip = usb_get_intfdata(intf);
	if (chip) { /* if !chip, fw upload has been performed */
	/* if !chip, fw upload has been performed */
	if (!chip)
		return;

	chip->intf_count--;
		if (!chip->intf_count) {
	if (chip->intf_count)
		return;

	chips[chip->regidx] = NULL;

	/*
@@ -184,8 +189,6 @@ static void usb6fire_chip_disconnect(struct usb_interface *intf)
	if (card)
		snd_card_free_when_closed(card);
}
	}
}

static const struct usb_device_id device_table[] = {
	{