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

From: Andy Shevchenko
Date: Mon Jul 04 2022 - 12:21:25 EST


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