From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Heiko Stübner" <heiko@sntech.de>
Cc: Shubhrajyoti Datta <omaplinuxkernel@gmail.com>,
linux-input@vger.kernel.org
Subject: Re: [PATCH v3] Add generic GPIO-tilt driver
Date: Tue, 29 Nov 2011 10:27:48 -0800 [thread overview]
Message-ID: <20111129182748.GG4241@core.coreip.homeip.net> (raw)
In-Reply-To: <201111291612.41069.heiko@sntech.de>
On Tue, Nov 29, 2011 at 04:12:40PM +0100, Heiko Stübner wrote:
> Hi Shubhrajyoti,
>
> Am Dienstag, 29. November 2011, 15:59:29 schrieb Shubhrajyoti Datta:
> > Hi Heiko,
> >
> > On Tue, Nov 29, 2011 at 5:54 PM, Heiko Stübner <heiko@sntech.de> wrote:
> > > +static void gpio_tilt_polled_poll(struct input_polled_dev *dev)
> > > +{
> > > + struct gpio_tilt_polled_dev *tdev = dev->private;
> > > + struct gpio_tilt_platform_data *pdata = tdev->pdata;
> > > + struct input_dev *input = dev->input;
> > > + struct gpio_tilt_state *tilt_state = NULL;
> > > + int state, i;
> > > +
> > > + if (tdev->count < tdev->threshold) {
> >
> > Nitpick : the braces are not necessary.
> hmm ... for me it's easier to read if the style of the braces does not change
> between if and else, i.e. both with or without braces.
> And the kernel CodingStyle-file seems also to be in my favor ;-)
> [starting from line 169].
Yep, when one branch requires braces it is preferred to have then on
all branches.
> > > +static int __devinit gpio_tilt_polled_probe(struct platform_device
> > > *pdev) +{
> > > + struct gpio_tilt_platform_data *pdata = pdev->dev.platform_data;
> > > + struct device *dev = &pdev->dev;
> > > + struct gpio_tilt_polled_dev *tdev;
> > > + struct input_polled_dev *poll_dev;
> > > + struct input_dev *input;
> > > + int error, i;
> > > +
> > > + if (!pdata || !pdata->poll_interval)
> > > + return -EINVAL;
> >
> > Could we have a default poll interval if passed 0 ?
> > Feel free to ignore if you feel otherwise.
> For me either way is fine but I'm not sure what would be a generic
> enough default value for most cases (500, 1000 ? ).
>
I'd rather error out then give default which we can't sanely select.
Then platform integrator will be alerted early and select appropriate
value.
Thanks.
--
Dmitry
--
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
next prev parent reply other threads:[~2011-11-29 18:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-29 12:24 [PATCH v3] Add generic GPIO-tilt driver Heiko Stübner
2011-11-29 14:59 ` Shubhrajyoti Datta
2011-11-29 15:12 ` Heiko Stübner
2011-11-29 15:28 ` Shubhrajyoti Datta
2011-11-29 18:27 ` Dmitry Torokhov [this message]
2011-11-29 18:23 ` Dmitry Torokhov
2011-11-29 18:42 ` Mark Brown
2011-11-29 18:56 ` Dmitry Torokhov
2011-11-29 19:06 ` Dmitry Torokhov
2011-11-29 21:16 ` Heiko Stübner
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=20111129182748.GG4241@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=heiko@sntech.de \
--cc=linux-input@vger.kernel.org \
--cc=omaplinuxkernel@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.