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: <54E30CD6.6020905@ti.com>
Date:	Tue, 17 Feb 2015 11:41:42 +0200
From:	Roger Quadros <rogerq@...com>
To:	Robert ABEL <rabel@...-ec.uni-bielefeld.de>,
	<khilman@...prootsystems.com>, <tony@...mide.com>,
	<linux@....linux.org.uk>, <linux-omap@...r.kernel.org>
CC:	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/4] ARM OMAP2+ GPMC: add bus children

On 16/02/15 17:49, Robert ABEL wrote:
> This patch adds support for spawning busses as children of the GPMC.
> 
> Signed-off-by: Robert ABEL <rabel@...-ec.uni-bielefeld.de>
> ---
>  arch/arm/mach-omap2/gpmc.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
> index 4fa5ff1..c6c8543 100644
> --- a/arch/arm/mach-omap2/gpmc.c
> +++ b/arch/arm/mach-omap2/gpmc.c
> @@ -27,6 +27,7 @@
>  #include <linux/of_address.h>
>  #include <linux/of_mtd.h>
>  #include <linux/of_device.h>
> +#include <linux/of_platform.h>
>  #include <linux/mtd/nand.h>
>  #include <linux/pm_runtime.h>
>  
> @@ -1589,9 +1590,20 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
>  	gpmc_cs_set_timings(cs, &gpmc_t);
>  
>  no_timings:
> -	if (of_platform_device_create(child, NULL, &pdev->dev))
> +
> +	if (of_match_node(of_default_bus_match_table, child)) {
> +
> +		/* ignore return code, because 0 is ambiguous */
> +		of_platform_populate(child, of_default_bus_match_table, NULL, &pdev->dev);
>  		return 0;
>  
> +	} else {
> +
> +		if (of_platform_device_create(child, NULL, &pdev->dev))
> +			return 0;
> +
> +	}
> +

Can we simply use only
of_platform_populate(child, NULL, NULL, &pdev->dev)

That way we get rid of the if..else and let OF core take care of
creating buses or devices.

>  	dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name);
>  	ret = -ENODEV;
>  
> 

cheers,
-roger
--
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