[PATCH v2 1/1] ASoC: Intel: catpt: remove duplicating driver data retrieval

Andy Shevchenko andriy.shevchenko at linux.intel.com
Mon Jul 4 18:20:45 CEST 2022


On Mon, Jul 04, 2022 at 10:36:33AM +0300, Péter Ujfalusi wrote:
> On 03/07/2022 17:51, Andy Shevchenko wrote:

...

> We could just pass the "(const struct catpt_spec *)id->driver_data" in
> place of spec to catpt_dev_init() and we can get rid of the local
> temporary pointer?

I would not go this way for non-POD types.

> If not, then I would cast out the spec before it's use:
> spec = (const struct catpt_spec *)id->driver_data;
> catpt_dev_init(cdev, dev, spec);

This I can do (as well as in the other patch).

-- 
With Best Regards,
Andy Shevchenko




More information about the Alsa-devel mailing list