From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932444AbcEFM1B (ORCPT ); Fri, 6 May 2016 08:27:01 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:57798 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758028AbcEFM07 (ORCPT ); Fri, 6 May 2016 08:26:59 -0400 Date: Fri, 6 May 2016 13:26:43 +0100 From: Mark Brown To: Adam Thomson Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Support Opensource , Sathyanarayana Nujella Message-ID: <20160506122643.GS6292@sirena.org.uk> References: <4783487c3caa1d66f0a1d5b25c9b341aee1118e4.1462285398.git.Adam.Thomson.Opensource@diasemi.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PpHgzJIASOO9qXt6" Content-Disposition: inline In-Reply-To: <4783487c3caa1d66f0a1d5b25c9b341aee1118e4.1462285398.git.Adam.Thomson.Opensource@diasemi.com> X-Cookie: Use in well-ventilated area. User-Agent: Mutt/1.6.0 (2016-04-01) X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 1/3] ASoC: da7219: Convert driver to use generic device/fwnode functions X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --PpHgzJIASOO9qXt6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, May 05, 2016 at 11:53:04AM +0100, Adam Thomson wrote: > This change converts the driver from using the of_* functions to using > the device_* and fwnode_* functions for accssing DT related data. > This is in preparation for updates to support ACPI based initialisation. Is this *really* sensible? DT idioms don't always match up with ACPI idioms well and this isn't a trivial DT binding. > +static struct fwnode_handle *da7219_aad_of_named_fwhandle(struct device *dev, > + const char *name) > +{ > + struct fwnode_handle *child; > + struct device_node *of_node; > + > + /* Find first matching child node */ > + device_for_each_child_node(dev, child) { > + if (is_of_node(child)) { > + of_node = to_of_node(child); > + if (of_node_cmp(of_node->name, name) == 0) > + return child; > + } > + } > + > + return NULL; > +} There's nothing device specific about this, it should go in generic code. --PpHgzJIASOO9qXt6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXLI2CAAoJECTWi3JdVIfQDCQH/2d3ic1jg8vaqwtSezoctNlo 7hdRO4gpcCvJ2IzRMD6a4M9aApgtHSljbaV0UYw2ZajWryXjDBUEryZ9vwe4kvVE 8lHywVns+suAYtXynCwFvcDxEogSVFMdqG2nVW0/gZa2lbw6a35sugRipd+T+UeY Ap8R48RgXPlDOq0w/tpwMgrRzyAJwTt1Kdgfxt01rTMZYqSwpj53ZPniFJtH5Yc2 NoBjJzh8oCUwz5rHhMnQq2Xb6FeUh+j5wvViK8mZ6DXkac8NDHf3MgMGWqkGHZXa 535wJi3d5BxVMmNBwauaHROn+0Ccmm28pwO3+SQvMIhnBFBYOcOOBuXALtUuWWI= =zU9k -----END PGP SIGNATURE----- --PpHgzJIASOO9qXt6--