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: <5433A863.1040206@samsung.com>
Date:	Tue, 07 Oct 2014 10:46:27 +0200
From:	Krzysztof Kozłowski <k.kozlowski@...sung.com>
To:	Markus Pargmann <mpa@...gutronix.de>,
	Mark Brown <broonie@...nel.org>
Cc:	kernel@...gutronix.de, Liam Girdwood <lgirdwood@...il.com>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] regulator: Set ena_gpio_valid in regulator drivers

On 06.10.2014 22:17, Markus Pargmann wrote:
> This patch sets the new field ena_gpio_valid for all drivers which set a
> valid ena_gpio.
>
> Signed-off-by: Markus Pargmann <mpa@...gutronix.de>
> ---

(... looking only on s2m/s5m drivers)

> diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
> index b16c53a8272f..4d78477b9f57 100644
> --- a/drivers/regulator/s2mps11.c
> +++ b/drivers/regulator/s2mps11.c
> @@ -986,6 +986,7 @@ common_reg:
>   			config.of_node = rdata[i].of_node;
>   		}
>   		config.ena_gpio = s2mps11->ext_control_gpio[i];
> +		config.ena_gpio_valid = true;

This way you'll mark all regulators as GPIO enabled. This is won't 
produce an error (ena_gpio is initialized to -EINVAL by default) but I 
think it is misuse of the idea "ena_gpio_valid".

Instead maybe:
+		if (gpio_is_valid(s2mps11->ext_control_gpio[i]))
+			config.ena_gpio_valid = true;
?

>
>   		regulator = devm_regulator_register(&pdev->dev,
>   						&regulators[i], &config);
> diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
> index 0ab5cbeeb797..d258e6613831 100644
> --- a/drivers/regulator/s5m8767.c
> +++ b/drivers/regulator/s5m8767.c
> @@ -466,6 +466,7 @@ static void s5m8767_regulator_config_ext_control(struct s5m8767_info *s5m8767,
>   	}
>
>   	config->ena_gpio = rdata->ext_control_gpio;
> +	config->ena_gpio_valid = true;
>   	config->ena_gpio_flags = GPIOF_OUT_INIT_HIGH;
>   }

This looks fine.

Best regards,
Krzysztof

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