linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier.adi@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: uclinux-dist-devel@blackfin.uclinux.org,
	Michael Hennerich <michael.hennerich@analog.com>,
	linux-input@vger.kernel.org
Subject: Re: [Uclinux-dist-devel] [PATCH v3] Input: ad7879: support auxiliary GPIOs via gpiolib
Date: Mon, 18 Jan 2010 01:48:14 -0500	[thread overview]
Message-ID: <8bd0f97a1001172248n531973ai8be0bf48926724ad@mail.gmail.com> (raw)
In-Reply-To: <20100118063507.GA5012@core.coreip.homeip.net>

On Mon, Jan 18, 2010 at 01:35, Dmitry Torokhov wrote:
> On Sun, Jan 17, 2010 at 10:36:42AM -0500, Mike Frysinger wrote:
>> +#ifdef CONFIG_GPIOLIB
>> +int ad7879_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
>>  {
>
> Sparse recommends making this static and it seems like a good idea. The
> same goes for the 3 new fucntions below.

yep

>> +static inline int ad7879_gpio_add(struct device *dev)
>
> Why inline? Let's compiler decide, it's certainly not a hot path.

ad7879_gpio_remove needed to be inlined because it's called from both
the probe (__devinit) and the remove (__devexit) functions.  might
able to write a smaller version though for the probe function to avoid
this.

ad7879_gpio_add is fine to remove the "inline" as long as "__devinit" is added.

>> +{
>> +     struct ad7879 *ts = dev_get_drvdata(dev);
>> +     struct ad7879_platform_data *pdata = dev->platform_data;
>> +     int ret = 0;
>> +
>> +     if (pdata->gpio_export) {
>> +             ts->gc.direction_input = ad7879_gpio_direction_input;
>> +             ts->gc.direction_output = ad7879_gpio_direction_output;
>> +             ts->gc.get = ad7879_gpio_get_value;
>> +             ts->gc.set = ad7879_gpio_set_value;
>> +             ts->gc.can_sleep = 1;
>> +             ts->gc.base = pdata->gpio_base;
>> +             ts->gc.ngpio = 1;
>> +             ts->gc.label = "AD7879-GPIO";
>> +             ts->gc.owner = THIS_MODULE;
>> +             ts->gc.dev = dev;
>> +
>> +             ret = gpiochip_add(&ts->gc);
>> +             if (ret)
>> +                     dev_err(dev, "failed to register gpio %d\n",
>> +                             ts->gc.base);
>> +     }
>> +
>> +     return ret;
>> +}
>> +
>> +static int ad7879_gpio_remove(struct device *dev)
>
> There is no chance we can handle errors returned by this function so I'd
> make it 'void'.

right
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2010-01-18  6:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07  7:18 [PATCH] Input: ad7879: support auxiliary GPIOs via gpiolib Mike Frysinger
2010-01-07  7:31 ` Dmitry Torokhov
2010-01-07 16:16   ` [Uclinux-dist-devel] " Robin Getz
2010-01-07 16:46     ` Mike Frysinger
2010-01-07 17:07       ` Dmitry Torokhov
2010-01-07 17:43         ` Robin Getz
2010-01-10  7:48           ` Dmitry Torokhov
2010-01-12 13:57             ` Hennerich, Michael
2010-01-12 21:04   ` [PATCH v2] " Mike Frysinger
2010-01-13  2:54     ` Dmitry Torokhov
2010-01-13  9:46       ` Hennerich, Michael
     [not found]         ` <8A42379416420646B9BFAC9682273B6D0F0DF094-pcKY8lWzTjquVPpjEGsWsTcYPEmu4y7e@public.gmane.org>
2010-01-14  6:24           ` Dmitry Torokhov
2010-01-17 15:36       ` [PATCH v3] " Mike Frysinger
2010-01-18  6:35         ` Dmitry Torokhov
2010-01-18  6:48           ` Mike Frysinger [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=8bd0f97a1001172248n531973ai8be0bf48926724ad@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=uclinux-dist-devel@blackfin.uclinux.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).