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:	Wed, 10 Feb 2016 10:44:19 +0100
From:	Philipp Zabel <p.zabel@...gutronix.de>
To:	Bernhard Walle <bernhard@...lle.de>
Cc:	lgirdwood@...il.com, broonie@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regulator: ltc3589: Make IRQ optional

Am Dienstag, den 09.02.2016, 21:14 +0100 schrieb Bernhard Walle:
> It's perfectly valid to use the LTC3589 without an interrupt pin
> connected to it. Currently, the driver probing fails when client->irq
> is 0 (which means "no interrupt"). Don't register the interrupt
> handler in that case but successfully finish the device probing instead.
> 
> Signed-off-by: Bernhard Walle <bernhard@...lle.de>

Acked-by: Philipp Zabel <p.zabel@...gutronix.de>

I suggest these small changes:

[...]
> @@ -520,12 +520,14 @@ static int ltc3589_probe(struct i2c_client *client,
>  		}
>  	}
>  
> -	ret = devm_request_threaded_irq(dev, client->irq, NULL, ltc3589_isr,
> -					IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> -					client->name, ltc3589);
> -	if (ret) {
> -		dev_err(dev, "Failed to request IRQ: %d\n", ret);
> -		return ret;
> +	if (client->irq != 0) {

How about using
	if (client->irq) {
here ...

> +		ret = devm_request_threaded_irq(dev, client->irq, NULL, ltc3589_isr,

... and reflowing this ...

> +						IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> +						client->name, ltc3589);
> +		if (ret) {
> +			dev_err(dev, "Failed to request IRQ %d: %d\n", client->irq, ret);

... and this long line.

regards
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ