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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/