linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zhu, Lejun" <lejun.zhu@linux.intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: lee.jones@linaro.org, sameo@linux.intel.com,
	linux-kernel@vger.kernel.org, jacob.jun.pan@linux.intel.com,
	bin.yang@intel.com
Subject: Re: [PATCH RESEND v2 2/4] mfd: intel_soc_pmic: I2C interface
Date: Mon, 26 May 2014 14:03:00 +0800	[thread overview]
Message-ID: <5382D914.4070603@linux.intel.com> (raw)
In-Reply-To: <20140523175312.GI22111@sirena.org.uk>



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


  reply	other threads:[~2014-05-26  6:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  0:40 [PATCH RESEND v2 0/4] mfd: Intel SoC Power Management IC Zhu, Lejun
2014-05-23  0:40 ` [PATCH RESEND v2 1/4] mfd: intel_soc_pmic: Core driver Zhu, Lejun
2014-05-23 17:49   ` Mark Brown
2014-05-26  6:01     ` Zhu, Lejun
2014-05-26 14:51       ` Mark Brown
2014-05-27  0:48         ` Zhu, Lejun
2014-05-27 11:20           ` Mark Brown
2014-05-28  0:55             ` Zhu, Lejun
2014-05-28 11:19               ` Mark Brown
2014-05-23  0:40 ` [PATCH RESEND v2 2/4] mfd: intel_soc_pmic: I2C interface Zhu, Lejun
2014-05-23 17:53   ` Mark Brown
2014-05-26  6:03     ` Zhu, Lejun [this message]
2014-05-23  0:40 ` [PATCH RESEND v2 3/4] mfd: intel_soc_pmic: Crystal Cove support Zhu, Lejun
2014-05-23  0:40 ` [PATCH RESEND v2 4/4] mfd: intel_soc_pmic: Build files Zhu, Lejun
2014-05-23 10:08 ` [PATCH RESEND v2 0/4] mfd: Intel SoC Power Management IC Lee Jones
2014-05-25 23:41   ` Zhu, Lejun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5382D914.4070603@linux.intel.com \
    --to=lejun.zhu@linux.intel.com \
    --cc=bin.yang@intel.com \
    --cc=broonie@kernel.org \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).