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: <20161026141628.x42rbn5o2ekdoluk@atomide.com>
Date:   Wed, 26 Oct 2016 07:16:28 -0700
From:   Tony Lindgren <tony@...mide.com>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Jon Hunter <jonathanh@...dia.com>,
        Mark Rutland <mark.rutland@....com>,
        Rob Herring <robh+dt@...nel.org>,
        Grygorii Strashko <grygorii.strashko@...com>,
        Nishanth Menon <nm@...com>, linux-gpio@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-omap@...r.kernel.org
Subject: Re: [PATCH 2/4] pinctrl: single: Use generic parser and
 #pinctrl-cells for pinctrl-single,pins

* Tony Lindgren <tony@...mide.com> [161025 09:51]:
> We can now use generic parser. To support the legacy binding without
> #pinctrl-cells, add pcs_quirk_missing_pinctrl_cells() and warn about
> missing #pinctrl-cells.
...

> +/**
> + * pcs_quirk_missing_pinctrl_cells - handle legacy binding
> + * @pcs: pinctrl driver instance
> + * @np: device tree node
> + * @cells: number of cells
> + *
> + * Handle legacy binding with no #pinctrl-cells. This should be
> + * always two pinctrl-single,bit-per-mux and one for others.
> + * At some point we may want to consider removing this.
> + */
> +static int pcs_quirk_missing_pinctrl_cells(struct pcs_device *pcs,
> +					   struct device_node *np,
> +					   int cells)
> +{
> +	struct property *p;
> +	const char *name = "#pinctrl-cells";
> +	int error;
> +	u32 val;
> +
> +	error = of_property_read_u32(np, name, &val);
> +	if (!error)
> +		return 0;
> +
> +	dev_warn(pcs->dev, "please update dts to use %s = <%i>\n",
> +		 name, cells);
> +
> +	p = devm_kzalloc(pcs->dev, sizeof(*p), GFP_KERNEL);
> +	if (!p)
> +		return -ENOMEM;
> +
> +	p->length = sizeof(__be32);
> +	p->value = devm_kzalloc(pcs->dev, sizeof(__be32), GFP_KERNEL);
> +	if (!p->value)
> +		return -ENOMEM;
> +	*(__be32 *)p->value = cpu_to_be32(cells);
> +
> +	p->name = devm_kstrdup(pcs->dev, name, GFP_KERNEL);
> +	if (!p->name)
> +		return -ENOMEM;
> +
> +	pcs->missing_nr_pinctrl_cells = p;
> +
> +	return of_add_property(np, pcs->missing_nr_pinctrl_cells);
> +}

Looking at some make randconfig results, looks like we don't have
of_add_property() and of_remove_property() exported. Is there some
reason not to export them?

Regards,

Tony

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ