public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: "Syed Mohammed, Khasim" <x0khasim@ti.com>
Cc: linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH] Resubmitting TWL4030 GPIO driver
Date: Tue, 8 May 2007 15:37:00 -0700	[thread overview]
Message-ID: <20070508223659.GQ32547@atomide.com> (raw)
In-Reply-To: <20070508222012.GP32547@atomide.com>

* Tony Lindgren <tony@atomide.com> [070508 15:25]:
> Hi,
> 
> * Syed Mohammed, Khasim <x0khasim@ti.com> [070508 12:29]:
> > After Incorporating Review comments.
> > 
> > This adds TWL4030 GPIO driver support. Required for TWL4030 Keypad and other
> > TWL4030 GPIO dependent modules.
> 
> ...
> 
> > +/*
> > + * twl4030 GPIO request function
> > + */
> > +int twl4030_request_gpio(int gpio)
> > +{
> > +	int ret = 0;
> > +
> > +	if (unlikely(gpio >= TWL4030_GPIO_MAX)) {
> > +		return -EPERM;
> > +	}
> > +
> > +	down(&gpio_sem);
> > +	if (gpio_usage_count & (0x1 << gpio)) {
> > +		ret = -EBUSY;
> > +	} else {
> > +		u8 clear_pull[6] = { 0, 0, 0, 0, 0, 0 };
> > +		/* First time usage? - switch on GPIO module */
> > +		if (!gpio_usage_count) {
> > +			ret =
> > +			gpio_twl4030_write(REG_GPIO_CTRL,
> > +					MASK_GPIO_CTRL_GPIO_ON);
> > +			ret = gpio_twl4030_write(REG_GPIO_SIH_CTRL, 0x00);
> > +		}
> > +		if (!ret) {
> > +			gpio_usage_count |= (0x1 << gpio);
> > +		}
> > +		ret =
> > +		twl4030_i2c_write(TWL4030_MODULE_GPIO, clear_pull,
> > +				REG_GPIOPUPDCTR1, 5);
> > +	}
> > +	up(&gpio_sem);
> > +	return ret;
> > +}
> 
> Can you please remove the unnecessary braces used for one liners
> throughout the code?

To clarify, I meant the { } braces for if statements with just one
line.

> This is something that will cause comments when trying to send this
> to I2C list. Ideally all the new patches we integrate will be ready
> be sent upstream also :)

Tony

  reply	other threads:[~2007-05-08 22:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08 19:24 [PATCH] Resubmitting TWL4030 GPIO driver Syed Mohammed, Khasim
2007-05-08 22:20 ` Tony Lindgren
2007-05-08 22:37   ` Tony Lindgren [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-04-27  0:40 Syed Mohammed, Khasim
2007-04-27  6:46 ` Budhee Jamaich
2007-04-27 22:56   ` Syed Mohammed, Khasim
2007-05-01  9:19 ` Trilok Soni
2007-05-01 11:19   ` Syed Mohammed, Khasim

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=20070508223659.GQ32547@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-omap-open-source@linux.omap.com \
    --cc=x0khasim@ti.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