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]
Message-ID: <20120618124513.GM3974@opensource.wolfsonmicro.com>
Date:	Mon, 18 Jun 2012 13:45:14 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	"AnilKumar, Chimata" <anilkumar@...com>
Cc:	"axel.lin@...il.com" <axel.lin@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Girdwood, Liam" <lrg@...com>, "Nori, Sekhar" <nsekhar@...com>
Subject: Re: [PATCH RFT] regulator: tps65217: Convert to
 regulator_[is_enabled|get_voltage_sel]_regmap

On Mon, Jun 18, 2012 at 12:39:38PM +0000, AnilKumar, Chimata wrote:

> +	if (config->regmap)
> +		rdev->regmap = config->regmap;
> +	else
> +		rdev->regmap = dev_get_regmap(dev->parent, NULL);

No, this would be broken.  We're specifically using the device we got
passed in.  In this case the fact that the regmap is on the MFD means
that the driver does need to explicitly set the regmap.  Or we should
have this be a multi-stage series of checks:

	if (config->regmap)
		rdev->regmap = config->regmap;
	else if (dev_get_regmap(dev, NULL))
		rdev->regmap = dev_get_regmap(dev, NULL);
	else if (dev->parent)
		rdev->regmap = dev_get_regmap(dev->parent, NULL);

which should cover the MFD case if there's no regmap on the child
without having to go through all the drivers doing it by hand.

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ