linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Bean <gbean@codeaurora.org>
To: Daniel Walker <dwalker@codeaurora.org>
Cc: akpm@linux-foundation.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, David Brown <davidb@codeaurora.org>,
	Bryan Huntsman <bryanh@codeaurora.org>
Subject: Re: [PATCH 2/2] gpio: msm7200a: Add irq support to msm-gpiolib.
Date: Fri, 11 Jun 2010 16:23:19 -0700	[thread overview]
Message-ID: <4C12C567.3060704@codeaurora.org> (raw)
In-Reply-To: <1276297949.4134.3.camel@m0nster>

>> +	/*
>> +	 * Under no circumstances should a line be held on a gpiochip
>> +	 * which hasn't finished probing.
>> +	 */
>> +	BUG_ON(gpiochip_remove(&msm_gpio->gpio_chip)<  0);
>> +err_post_malloc:
>
> It looks like some of this should go in the prior patch. Like this
> BUG_ON() above.

I would argue against that.  If you look at the previous patch, you'll 
see that the last thing that probe() does is gpiochip_add, which means 
it never has a need to call gpiochip_remove(), and thus no need to 
complain if gpiochip_remove behaves unexpectedly.

>> @@ -160,12 +360,16 @@ err:
>>   static int msm_gpio_remove(struct platform_device *dev)
>>   {
>>   	struct msm_gpio_dev *msm_gpio = platform_get_drvdata(dev);
>> -	int ret = gpiochip_remove(&msm_gpio->gpio_chip);
>> +	int ret;
>>
>> -	if (ret == 0)
>> -		kfree(msm_gpio);
>> +	ret = gpiochip_remove(&msm_gpio->gpio_chip);
>> +	if (ret<  0)
>> +		return ret;
>>
>> -	return ret;
>> +	free_irq(msm_gpio->irq_summary, msm_gpio);
>> +	kfree(msm_gpio);
>> +
>> +	return 0;
>>   }
>
> Also some of the code here (msm_gpio_remove) seems like it's cleaning up
> the prior patch to some degree. So it should potentially get moved into
> that patch.

Point taken.  There is definitely some stuff in here that is just 
"housecleaning" - I will sort that out.

---
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2010-06-11 23:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-11 19:58 [PATCH 0/2] Add gpiolib support for MSM chips Gregory Bean
2010-06-11 19:58 ` [PATCH 1/2] gpio: msm7200a: " Gregory Bean
2010-06-12  2:12   ` Ben Dooks
2010-06-12  2:34     ` Bryan Huntsman
2010-06-12  5:37     ` Gregory Bean
2010-06-13  5:30       ` Ben Dooks
2010-06-11 19:58 ` [PATCH 2/2] gpio: msm7200a: Add irq support to msm-gpiolib Gregory Bean
2010-06-11 23:12   ` Daniel Walker
2010-06-11 23:23     ` Greg Bean [this message]
2010-06-12  2:24   ` Ben Dooks

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=4C12C567.3060704@codeaurora.org \
    --to=gbean@codeaurora.org \
    --cc=akpm@linux-foundation.org \
    --cc=bryanh@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=dwalker@codeaurora.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).