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: <20110427104339.GY13227@legolas.emea.dhcp.ti.com>
Date:	Wed, 27 Apr 2011 13:43:40 +0300
From:	Felipe Balbi <balbi@...com>
To:	Graeme Gregory <gg@...mlogic.co.uk>
Cc:	linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org,
	sameo@...ux.intel.com, balbi@...com, lrg@...mlogic.co.uk,
	broonie@...nsource.wolfsonmicro.com
Subject: Re: [PATCH 3/4] REGULATOR: TWL6025: add support to twl-regulator

Hi,

On Wed, Apr 27, 2011 at 10:39:50AM +0100, Graeme Gregory wrote:
> Adding support for the twl6025. Major difference in the twl6025 is the
> group functionality has been removed from the chip so this affects how
> regulators are enabled and disabled.
> 
> The names of the regulators also changed.
> 
> The DCDCs of the 6025 are software controllable as well.
> 
> Signed-off-by: Graeme Gregory <gg@...mlogic.co.uk>
> ---
>  drivers/regulator/twl-regulator.c |  447 ++++++++++++++++++++++++++++++++++---
>  1 files changed, 412 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
> index 2a808c2..c08a0de 100644
> --- a/drivers/regulator/twl-regulator.c
> +++ b/drivers/regulator/twl-regulator.c
> @@ -144,11 +158,14 @@ static int twl6030reg_is_enabled(struct regulator_dev *rdev)
>  	struct twlreg_info	*info = rdev_get_drvdata(rdev);
>  	int			grp, val;
>  
> -	grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
> -	if (grp < 0)
> -		return grp;
> +	if (!(twl_features() & TWL6025_SUBCLASS)) {

instead, why don't you pass some flag as platform_data to this driver,
which gets used to initialize a fiel in struct twlreg_info, then you use
that to do the checking.

> +		grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
> +		if (grp < 0)
> +			return grp;
>  
> -	grp &= P1_GRP_6030;
> +		grp &= P1_GRP_6030;
> +	} else
> +		grp = 1;

if one branch has {} add it to both.

-- 
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ