Re: [PATCH v1 2/2] ALSA: firewire: Make use of ieee1394's .driver_data_ptr

Andy Shevchenko <[email protected]> Mon, 20 Apr 2026 11:48:49 +0300
Newsgroups gmane.linux.sound,gmane.linux.kernel.firewire.devel
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
On Sun, Apr 19, 2026 at 08:42:14AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> Recently struct ieee1394_device_id gained a new member to store a pointer
> to driver data. Make use of that to get rid of a bunch of casts.

...

> -	if (!entry->driver_data)
> +	if (!entry->driver_data_ptr)
>  		detect_formats = snd_dice_stream_detect_current_formats;
>  	else
> -		detect_formats = (snd_dice_detect_formats_t)entry->driver_data;
> +		detect_formats = entry->driver_data_ptr;

While at it, I would negate the conditional:

	if (entry->driver_data_ptr)
		detect_formats = entry->driver_data_ptr;
	else
		detect_formats = snd_dice_stream_detect_current_formats;

-- 
With Best Regards,
Andy Shevchenko