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] [day] [month] [year] [list]
Date:	Mon, 28 Jan 2013 08:58:26 -0700
From:	Stephen Warren <swarren@...dotorg.org>
To:	Laxman Dewangan <ldewangan@...dia.com>
CC:	sameo@...ux.intel.com, linux-doc@...r.kernel.org,
	devicetree-discuss@...ts.ozlabs.org,
	broonie@...nsource.wolfsonmicro.com, linux-kernel@...r.kernel.org,
	rob.herring@...xeda.com
Subject: Re: [PATCH RESEND 2/4] regulator: tps65090: add DT support

On 01/27/2013 01:57 AM, Laxman Dewangan wrote:
> Add DT support for TI PMIC tps65090 regulator driver. The DT of this
> device have node regulator and all regulator's node of this device is
> added under this node.
> 
> The device tree binding document has the required information for
> adding this device on DTS file.
> 
> Signed-off-by: Laxman Dewangan <ldewangan@...dia.com>
> Reviewed-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>

> diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c

> @@ -147,15 +228,20 @@ static int tps65090_regulator_probe(struct platform_device *pdev)
>  	struct tps65090_regulator_plat_data *tps_pdata;
>  	struct tps65090_regulator *pmic;
>  	struct tps65090_platform_data *tps65090_pdata;
> +	struct of_regulator_match *tps65090_reg_matches = NULL;
>  	int num;
>  	int ret;
>  
>  	dev_dbg(&pdev->dev, "Probing regulator\n");
>  
>  	tps65090_pdata = dev_get_platdata(pdev->dev.parent);
> -	if (!tps65090_pdata) {
> +	if (!tps65090_pdata && tps65090_mfd->pdata &&
> +			tps65090_mfd->dev->of_node)
> +		tps65090_pdata = tps65090_parse_dt_reg_data(pdev,
> +					&tps65090_reg_matches);

Why check "&& tps65090_mfd->pdata" here; why not always parse DT if
(!tps65090_pdata && tps65090_mfd->dev->of_node)? In that condition, the
parent MFD driver will always have allocated tps65090_mfd->pdata.


> +	if (IS_ERR_OR_NULL(tps65090_pdata)) {
>  		dev_err(&pdev->dev, "Platform data missing\n");
> -		return -EINVAL;
> +		return (tps65090_pdata) ? PTR_ERR(tps65090_pdata) : -EINVAL;

No need for () there.
--
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