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: <bf750784-eb4a-675a-2ec4-bc52283dcc9a@pengutronix.de>
Date:   Sat, 26 Dec 2020 16:50:17 +0100
From:   Ahmad Fatoum <a.fatoum@...gutronix.de>
To:     Oleksandr Suvorov <oleksandr.suvorov@...adex.com>,
        linux-next@...r.kernel.org
Cc:     Igor Opaniuk <igor.opaniuk@...adex.com>,
        Marcel Ziswiler <marcel.ziswiler@...adex.com>,
        linux-kernel@...r.kernel.org,
        Philippe Schenker <philippe.schenker@...adex.com>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Lee Jones <lee.jones@...aro.org>,
        linux-stm32@...md-mailman.stormreply.com,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [Linux-stm32] [PATCH] mfd: stmpe: Support disabling sub-functions

Hello Oleksander,

On 26.12.20 10:47, Oleksandr Suvorov wrote:
> Add support of sub-functions disabling. It allows one to define
> an stmpe sub-function device in devicetree, but keep it disabled.
> 
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@...adex.com>
> ---
> 
>  drivers/mfd/stmpe.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> index 90f3292230c9..2182607b75f6 100644
> --- a/drivers/mfd/stmpe.c
> +++ b/drivers/mfd/stmpe.c
> @@ -1358,6 +1358,9 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata,
>  	pdata->autosleep = (pdata->autosleep_timeout) ? true : false;
>  
>  		(np, child) {
> +		/* skip disabled sub-function */
> +		if (!of_device_is_available(child))
> +			continue;

Better use for_each_available_child_of_node().

>  		if (of_node_name_eq(child, "stmpe_gpio")) {
>  			pdata->blocks |= STMPE_BLOCK_GPIO;
>  		} else if (of_node_name_eq(child, "stmpe_keypad")) {
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ