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]
Date:	Mon, 26 May 2014 14:03:00 +0800
From:	"Zhu, Lejun" <lejun.zhu@...ux.intel.com>
To:	Mark Brown <broonie@...nel.org>
CC:	lee.jones@...aro.org, sameo@...ux.intel.com,
	linux-kernel@...r.kernel.org, jacob.jun.pan@...ux.intel.com,
	bin.yang@...el.com
Subject: Re: [PATCH RESEND v2 2/4] mfd: intel_soc_pmic: I2C interface



On 5/24/2014 1:53 AM, Mark Brown wrote:
> On Fri, May 23, 2014 at 08:40:27AM +0800, Zhu, Lejun wrote:
> 
>> +static int pmic_i2c_lookup_gpio(struct device *dev, int acpi_index)
>> +{
>> +	struct gpio_desc *desc;
>> +	int gpio;
>> +
>> +	desc = gpiod_get_index(dev, KBUILD_MODNAME, acpi_index);
>> +	if (IS_ERR(desc))
>> +		return PTR_ERR(desc);
>> +
>> +	gpio = desc_to_gpio(desc);
>> +
>> +	gpiod_put(desc);
>> +
>> +	return gpio;
>> +}
> 
> Why not just have the driver work with the gpiod API, is there any real
> need to convert to a GPIO number?

The whole function will be removed since the gpio set code is removed
during probe.

>> +static const struct i2c_device_id pmic_i2c_id[] = {
>> +	{ "crystal_cove", (kernel_ulong_t)&crystal_cove_pmic},
>> +	{ "INT33FD", (kernel_ulong_t)&crystal_cove_pmic},
>> +	{ "INT33FD:00", (kernel_ulong_t)&crystal_cove_pmic},
>> +	{ }
>> +};
>> +MODULE_DEVICE_TABLE(i2c, pmic_i2c_id);
> 
> The INT33FD ones here look like they should only be in the ACPI table.

You are right. Only INT33FD:00 should be here.

>> +static int __init pmic_i2c_init(void)
>> +{
>> +	int ret;
>> +
>> +	ret = i2c_add_driver(&pmic_i2c_driver);
>> +	if (ret != 0)
>> +		pr_err("Failed to register pmic I2C driver: %d\n", ret);
>> +
>> +	return ret;
>> +}
>> +subsys_initcall(pmic_i2c_init);
> 
> module_i2c_driver() - you shouldn't need subsys_initcall().

I'll change it to module_init.

Best Regards
Lejun

--
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