[alsa-devel] [PATCH v3 2/2] ASoC: simple-card: add multi-CODECs in DT

Mark Brown broonie at kernel.org
Sat Nov 8 10:48:40 CET 2014


On Fri, Nov 07, 2014 at 08:05:57PM +0100, Jean-Francois Moine wrote:
> Mark Brown <broonie at kernel.org> wrote:

> > >  	} else {
> > > -		clk = of_clk_get(args.np, 0);
> > > +		clk = of_clk_get((struct device_node *) dai_np, 0);  

> > Adding this cast looks suspicous - why?  As far as I can tell the
> > original code didn't need one.

> Right, 'args.np' was (struct device_node *), but, now, 'dai_np' is
> (const struct device_node *).

> Changing 'dai_np' to (struct device_node *) in the
> asoc_simple_card_sub_parse_of() argument asks for a cast in calling
> this function because the field 'of_node' of the struct
> snd_soc_dai_link_component is (const struct device_node *).

> Do you better like this last cast?

No.  As Lars says having a cast in the first place is almost always a
sign that you're doing something wrong outside of passing things through
some of the generic callback interfaces.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20141108/f01d4bae/attachment.sig>


More information about the Alsa-devel mailing list