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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ebae8ead-d7c4-071b-7415-d83f2db9f9cc@wanyeetech.com>
Date:   Sat, 24 Jul 2021 14:43:56 +0800
From:   Zhou Yanjie <zhouyanjie@...yeetech.com>
To:     Paul Cercueil <paul@...pouillou.net>,
        Linus Walleij <linus.walleij@...aro.org>
Cc:     linux-mips@...r.kernel.org, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] pinctrl: ingenic: Add .max_register in regmap_config

Hi Paul,

On 2021/7/18 上午1:48, Paul Cercueil wrote:
> Compute the max register from the GPIO chip offset and number of GPIO
> chips.
>
> This permits to read all registers from debugfs.
>
> Signed-off-by: Paul Cercueil <paul@...pouillou.net>
> ---
>   drivers/pinctrl/pinctrl-ingenic.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)


Tested-by: 周琰杰 (Zhou Yanjie)<zhouyanjie@...yeetech.com>


> diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
> index 263498be8e31..2bbcb8063a16 100644
> --- a/drivers/pinctrl/pinctrl-ingenic.c
> +++ b/drivers/pinctrl/pinctrl-ingenic.c
> @@ -3759,6 +3759,7 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
>   	void __iomem *base;
>   	const struct ingenic_chip_info *chip_info;
>   	struct device_node *node;
> +	struct regmap_config regmap_config;
>   	unsigned int i;
>   	int err;
>   
> @@ -3776,8 +3777,10 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
>   	if (IS_ERR(base))
>   		return PTR_ERR(base);
>   
> -	jzpc->map = devm_regmap_init_mmio(dev, base,
> -			&ingenic_pinctrl_regmap_config);
> +	regmap_config = ingenic_pinctrl_regmap_config;
> +	regmap_config.max_register = chip_info->num_chips * chip_info->reg_offset;
> +
> +	jzpc->map = devm_regmap_init_mmio(dev, base, &regmap_config);
>   	if (IS_ERR(jzpc->map)) {
>   		dev_err(dev, "Failed to create regmap\n");
>   		return PTR_ERR(jzpc->map);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ