linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavan Kondeti <pkondeti@codeaurora.org>
To: Gregory Bean <gbean@codeaurora.org>
Cc: dwalker@codeaurora.org, linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Baruch Siach <baruch@tkos.co.il>
Subject: Re: [PATCH v3 1/2] msm: gpio: Add v2 gpio support to MSM SoCs.
Date: Thu, 18 Nov 2010 16:22:57 +0530	[thread overview]
Message-ID: <20101118105257.GC11700@codeaurora.org> (raw)
In-Reply-To: <1289943516-11367-1-git-send-email-gbean@codeaurora.org>

Hi Greg,

On Tue, Nov 16, 2010 at 01:38:35PM -0800, Gregory Bean wrote:
> Beginning with the MSM8x60, the hardware block responsible for gpio
> support changes.  Provide gpiolib support for the new v2 architecture.
> 
> Cc: Baruch Siach <baruch@tkos.co.il>
> Signed-off-by: Gregory Bean <gbean@codeaurora.org>
> +static int __devinit msm_gpio_probe(struct platform_device *dev)
> +{
> +	int ret;
> +
> +	spin_lock_init(&tlmm_lock);

Not required. DEFINE_SPINLOCK() would have initialized the spinlock.
> +	msm_gpio.label = dev->name;
> +	ret = gpiochip_add(&msm_gpio);
> +
> +	return ret;
> +}
> +
> +static int __devexit msm_gpio_remove(struct platform_device *dev)
> +{
> +	int ret = gpiochip_remove(&msm_gpio);
> +
> +	if (ret < 0)
> +		return ret;
> +
> +	set_irq_handler(TLMM_SCSS_SUMMARY_IRQ, NULL);
> +
> +	return 0;
> +}
> +
> +static struct platform_driver msm_gpio_driver = {
> +	.probe = msm_gpio_probe,
> +	.remove = __devexit_p(msm_gpio_remove),
> +	.driver = {
> +		.name = "msmgpio",
> +		.owner = THIS_MODULE,
> +	},
> +};
> +
> +static struct platform_device msm_device_gpio = {
> +	.name = "msmgpio",
> +	.id   = 0,
> +};
id = -1 right?
> +
> +static int __init msm_gpio_init(void)
> +{
> +	int rc;
> +
> +	rc = platform_driver_register(&msm_gpio_driver);
> +	if (rc == 0)
> +		rc = platform_device_register(&msm_device_gpio);

Should not we unregister the platform driver in case the above call returns
failure?
> +
> +	return rc;
> +}
> +
-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.


      parent reply	other threads:[~2010-11-18 10:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 21:38 [PATCH v3 1/2] msm: gpio: Add v2 gpio support to MSM SoCs Gregory Bean
2010-11-16 21:38 ` [PATCH v3 2/2] msm: gpio: Add irq support to v2 gpiolib Gregory Bean
2010-11-18 11:15   ` Pavan Kondeti
2010-11-18 19:20     ` Gregory Bean
2010-11-18 10:52 ` Pavan Kondeti [this message]

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=20101118105257.GC11700@codeaurora.org \
    --to=pkondeti@codeaurora.org \
    --cc=baruch@tkos.co.il \
    --cc=dwalker@codeaurora.org \
    --cc=gbean@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).