lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 6 May 2016 14:33:04 +0000
From:	"Opensource [Adam Thomson]" <Adam.Thomson.Opensource@...semi.com>
To:	Mark Brown <broonie@...nel.org>,
	"Opensource [Adam Thomson]" <Adam.Thomson.Opensource@...semi.com>
CC:	Liam Girdwood <lgirdwood@...il.com>,
	Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>,
	"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Support Opensource <Support.Opensource@...semi.com>,
	Sathyanarayana Nujella <sathyanarayana.nujella@...el.com>
Subject: RE: [PATCH 1/3] ASoC: da7219: Convert driver to use generic
 device/fwnode functions

On May 06, 2016, 13:27, Mark Brown 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.

For what we're doing here, both DT and ACPI match up well, and so what I've
implemented works on both sides. There are other examples of this already in the
Linux kernel, so I don't think it's anything particularly new.

> 
> > +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.

The intention was to just match against DT or ACPI and nothing else, so that
didn't feel generic enough to be pushed into the fwnode framework. However
I will take another look.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ