From: Magnus Damm <magnus.damm@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, rjw@sisk.pl,
linus.walleij@stericsson.com, arnd@arndb.de,
linux-sh@vger.kernel.org, horms@verge.net.au,
grant.likely@secretlab.ca, lethal@linux-sh.org, olof@lixom.net
Subject: Re: [PATCH] gpio: Emma Mobile GPIO driver V2
Date: Thu, 17 May 2012 06:20:39 +0000 [thread overview]
Message-ID: <CANqRtoRW4xtRkCYvDs89XD82R8ac_kAFdLp3tSfUv8HufTS1cQ@mail.gmail.com> (raw)
In-Reply-To: <1337099546.7050.9.camel@joe2Laptop>
Hi Joe,
On Wed, May 16, 2012 at 1:32 AM, Joe Perches <joe@perches.com> wrote:
> On Wed, 2012-05-16 at 00:43 +0900, Magnus Damm wrote:
>> This patch is V2 of the Emma Mobile GPIO driver.
>
> Just some trivial comments
Nice with feedback, thank you!
>> +++ work/drivers/gpio/gpio-em.c 2012-05-16 00:07:20.000000000 +0900
> []
>
> Adding pr_fmt before any #include prefixes all pr_<level> messages.
>
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Ok, good idea, will add.
>> +#include <linux/init.h>
>> +#include <linux/platform_device.h>
> []
>> +static int em_gio_irq_set_type(struct irq_data *d, unsigned int type)
>> +{
> []
>> + pr_debug("gio: sense irq = %d, mode = %d\n", offset, value);
>
> pr_debug("sense irq = %d, mode = %d\n", offset, value);
Right, with the above pr_fmt() line.
> []
>> +static void __em_gio_set(struct gpio_chip *chip, unsigned int reg,
>> + unsigned shift, int value)
>> +{
>> + /* upper 16 bits contains mask and lower 16 actual value */
>> + em_gio_write(gpio_to_priv(chip), reg,
>> + (1 << (shift + 16)) | (value << shift));
>> +}
>
> comment doesn't seem to match code unless
> value is a single bit, then value should
> probably be renamed.
Perhaps a bit odd, but the argument variable names match the GPIO API:
[include/linux/gpio.h]
..
static inline void gpio_set_value(unsigned int gpio, int value)
So I prefer to keep them as-is.
>> +static int em_gio_irq_domain_map(struct irq_domain *h, unsigned int virq,
>> + irq_hw_number_t hw)
>> +{
>> + struct em_gio_priv *p = h->host_data;
>> +
>> + pr_debug("gio: map hw irq = %d, virq = %d\n", (int)hw, virq);
>
> pr_debug("map hw irq = %d, virq = %d\n", (int)hw, virq)
>
>> +static struct irq_domain_ops em_gio_irq_domain_ops = {
>
> const?
Sure, why not?
>> +static int __devinit em_gio_probe(struct platform_device *pdev)
> []
>> + p = kzalloc(sizeof(*p), GFP_KERNEL);
>> + if (!p) {
>> + dev_err(&pdev->dev, "failed to allocate driver data\n");
>
> OOM messages aren't necessary as k.alloc failures
> produce a dump_stack.
Ok!
Thanks for your feedback, I will address them in a separate
incremental feature patch.
/ magnus
next prev parent reply other threads:[~2012-05-17 6:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 15:43 [PATCH] gpio: Emma Mobile GPIO driver V2 Magnus Damm
2012-05-15 16:32 ` Joe Perches
2012-05-17 6:20 ` Magnus Damm [this message]
2012-05-16 7:11 ` Linus Walleij
2012-05-16 10:15 ` Magnus Damm
2012-05-16 11:25 ` Linus Walleij
2012-05-16 20:05 ` Rafael J. Wysocki
2012-05-16 22:22 ` Olof Johansson
2012-05-16 22:37 ` Rafael J. Wysocki
2012-05-16 22:54 ` Olof Johansson
2012-05-18 22:56 ` Grant Likely
2012-05-19 1:18 ` Olof Johansson
2012-05-19 1:44 ` Grant Likely
2012-05-19 2:27 ` Olof Johansson
2012-05-19 12:06 ` Rafael J. Wysocki
2012-05-16 7:29 ` Paul Mundt
2012-05-16 10:09 ` Magnus Damm
2012-05-16 12:09 ` Arnd Bergmann
2012-05-16 15:47 ` Magnus Damm
2012-05-17 0:41 ` Paul Mundt
2012-05-18 23:25 ` Grant Likely
2012-05-19 6:46 ` Paul Mundt
2012-05-19 20:05 ` Grant Likely
2012-05-18 22:57 ` Grant Likely
2012-05-19 2:13 ` Paul Mundt
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=CANqRtoRW4xtRkCYvDs89XD82R8ac_kAFdLp3tSfUv8HufTS1cQ@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=arnd@arndb.de \
--cc=grant.likely@secretlab.ca \
--cc=horms@verge.net.au \
--cc=joe@perches.com \
--cc=lethal@linux-sh.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=olof@lixom.net \
--cc=rjw@sisk.pl \
/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).