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-next>] [day] [month] [year] [list]
Message-ID: <CAC+thW0Cx4pQDeZ2ZJfvFMfv23ExDmS5LDM8_-1Nz23t1TpJcA@mail.gmail.com>
Date:	Mon, 25 Jul 2011 15:55:34 +0200
From:	Andrea Galbusera <gizero@...il.com>
To:	LKML <linux-kernel@...r.kernel.org>
Subject: power: bq20z75: problem with optional battery detect gpio feature

Is the in-object feature really optional?
If battery_detect field in my bq20z75_platform_data structure is not
explicitly set, I suspect the driver ends up requesting an irq for the
GPIO number 0. This look indesirable.

Here is the relevant code snip form bq20z75_probe():

if (pdata) {
	bq20z75_device->gpio_detect =
		gpio_is_valid(pdata->battery_detect);    // GPIO 0 _IS_ a valid gpio !!
	bq20z75_device->pdata = pdata;
}

[...]

if (!bq20z75_device->gpio_detect)
	goto skip_gpio;

[...]

irq = gpio_to_irq(pdata->battery_detect);

[...]

rc = request_irq(irq, bq20z75_irq,
	IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
	dev_name(&client->dev), &bq20z75_device->power_supply);


I cannot find in gpio related headers any sort of "GPIO_INVALID"
symbol to explicitly declare that I don't want this feature. I'm
temporarily setting it to ARCH_NR_GPIOS but I believe we need to
disambiguate GPIO number 0 from "disable feature".
Correct?

Regards,
Andrea
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ