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: <20200330143716.GI2431644@ulmo>
Date:   Mon, 30 Mar 2020 16:37:16 +0200
From:   Thierry Reding <thierry.reding@...il.com>
To:     Paul Cercueil <paul@...pouillou.net>
Cc:     Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>, od@...c.me,
        linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Mathieu Malaterre <malat@...ian.org>,
        Artur Rojek <contact@...ur-rojek.eu>
Subject: Re: [PATCH v4 3/4] pwm: jz4740: Obtain regmap from parent node

On Mon, Mar 23, 2020 at 03:24:20PM +0100, Paul Cercueil wrote:
[...]
> diff --git a/drivers/pwm/pwm-jz4740.c b/drivers/pwm/pwm-jz4740.c
[...]
> @@ -196,12 +208,19 @@ static const struct pwm_ops jz4740_pwm_ops = {
>  static int jz4740_pwm_probe(struct platform_device *pdev)
>  {
>  	struct jz4740_pwm_chip *jz4740;
> +	struct device *dev = &pdev->dev;
>  
> -	jz4740 = devm_kzalloc(&pdev->dev, sizeof(*jz4740), GFP_KERNEL);
> +	jz4740 = devm_kzalloc(dev, sizeof(*jz4740), GFP_KERNEL);
>  	if (!jz4740)
>  		return -ENOMEM;
>  
> -	jz4740->chip.dev = &pdev->dev;
> +	jz4740->map = device_node_to_regmap(dev->parent->of_node);
> +	if (!jz4740->map) {

This seems wrong. According to the code, device_node_to_regmap() returns
an ERR_PTR()-encoded error code on failure, so I think this should be:

	if (IS_ERR(jz4740->map)) {
		...
		return PTR_ERR(jz4740->map);
	}

No need to resend for that, I can take care of that when applying. Let
me know if that doesn't work.

Thierry

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ