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]
Date: Tue, 12 Sep 2023 13:04:56 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Herve Codina <herve.codina@...tlin.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew@...n.ch>, 
	Rob Herring <robh+dt@...nel.org>, 
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>, 
	Lee Jones <lee@...nel.org>, Qiang Zhao <qiang.zhao@....com>, Li Yang <leoyang.li@....com>, 
	Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, 
	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>, Shengjiu Wang <shengjiu.wang@...il.com>, 
	Xiubo Li <Xiubo.Lee@...il.com>, Fabio Estevam <festevam@...il.com>, 
	Nicolin Chen <nicoleotsuka@...il.com>, Christophe Leroy <christophe.leroy@...roup.eu>, 
	Randy Dunlap <rdunlap@...radead.org>, netdev@...r.kernel.org, 
	linuxppc-dev@...ts.ozlabs.org, devicetree@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, alsa-devel@...a-project.org, 
	Simon Horman <horms@...nel.org>, Christophe JAILLET <christophe.jaillet@...adoo.fr>, 
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v5 28/31] pinctrl: Add support for the Lantic PEF2256 pinmux

Hi Herve,

thanks for your patch!

On Tue, Sep 12, 2023 at 12:15 PM Herve Codina <herve.codina@...tlin.com> wrote:

> The Lantiq PEF2256 is a framer and line interface component designed to
> fulfill all required interfacing between an analog E1/T1/J1 line and the
> digital PCM system highway/H.100 bus.
>
> This kind of component can be found in old telecommunication system.
> It was used to digital transmission of many simultaneous telephone calls
> by time-division multiplexing. Also using HDLC protocol, WAN networks
> can be reached through the framer.
>
> This pinmux support handles the pin muxing part (pins RP(A..D) and pins
> XP(A..D)) of the PEF2256.
>
> Signed-off-by: Herve Codina <herve.codina@...tlin.com>
> Reviewed-by: Christophe Leroy <christophe.leroy@...roup.eu>
> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>

Nice to see this as a proper pin control driver!

>  drivers/pinctrl/pinctrl-pef2256-regs.h |  65 ++++++
>  drivers/pinctrl/pinctrl-pef2256.c      | 308 +++++++++++++++++++++++++

Do you really need a separate header just for some registers?
But it's a matter of taste so I'm not gonna complain if you want
it this way.

> +config PINCTRL_PEF2256
> +       tristate "Lantiq PEF2256 (FALC56) pin controller driver"
> +       depends on OF && FRAMER_PEF2256
> +       select PINMUX

select PINCONF

> +       select GENERIC_PINCONF

This brings it in implicitly but I prefer that you just select it.

> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*

I think SPDX mandates that you start the tag with C99 comments

// SPDX-License-Identifier: GPL-2.0-only

> +       /* We map 1 group <-> 1 pin */

Also known as "the qualcomm trick", but hey: it's fine.

> +static int pef2256_register_pinctrl(struct pef2256_pinctrl *pef2256)
> +{
> +       struct pinctrl_dev      *pctrl;
> +
> +       pef2256->pctrl_desc.name    = dev_name(pef2256->dev);
> +       pef2256->pctrl_desc.owner   = THIS_MODULE;
> +       pef2256->pctrl_desc.pctlops = &pef2256_pctlops;
> +       pef2256->pctrl_desc.pmxops  = &pef2256_pmxops;
> +       if (pef2256->version == PEF2256_VERSION_1_2) {
> +               pef2256->pctrl_desc.pins  = pef2256_v12_pins;
> +               pef2256->pctrl_desc.npins = ARRAY_SIZE(pef2256_v12_pins);
> +               pef2256->functions  = pef2256_v12_functions;
> +               pef2256->nfunctions = ARRAY_SIZE(pef2256_v12_functions);
> +       } else {
> +               pef2256->pctrl_desc.pins  = pef2256_v2x_pins;
> +               pef2256->pctrl_desc.npins = ARRAY_SIZE(pef2256_v2x_pins);
> +               pef2256->functions  = pef2256_v2x_functions;
> +               pef2256->nfunctions = ARRAY_SIZE(pef2256_v2x_functions);
> +       }
> +
> +       pctrl = devm_pinctrl_register(pef2256->dev, &pef2256->pctrl_desc, pef2256);
> +       if (IS_ERR(pctrl)) {
> +               dev_err(pef2256->dev, "pinctrl driver registration failed\n");
> +               return PTR_ERR(pctrl);
> +       }
> +
> +       return 0;

You could use
return dev_err_probe(...);

> +       pef2256_reset_pinmux(pef2256_pinctrl);
> +       ret = pef2256_register_pinctrl(pef2256_pinctrl);
> +       if (ret)
> +               return ret;

Or you could use it down here.

With or without these changes (because they are nitpicks)
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ