lkml.org 
[lkml]   [2010]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/2] msm: gpio: Add v2 gpio support to MSM SoCs.
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.



\
 
 \ /
  Last update: 2010-11-18 11:55    [W:0.092 / U:0.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site