public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: linuxsh-dev@lists.sourceforge.net
Cc: "Adrian McMenamin" <lkmladrian@gmail.com>,
	dmitry.torokhov@gmail.com, Paul Mundt <lethal@linux-sh.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add support for keyboard on SEGA Dreamcast
Date: Wed, 5 Sep 2007 00:34:55 -0400	[thread overview]
Message-ID: <200709050034.57010.vapier@gentoo.org> (raw)
In-Reply-To: <8b67d60709041634l198d29f0ja049989acdb30b67@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]

On Tuesday 04 September 2007, Adrian McMenamin wrote:
> --- a/drivers/input/keyboard/Kconfig
> +++ b/drivers/input/keyboard/Kconfig
> +	  Say Y here if you have a DreamCast console running Linux and have

funny caps in Dreamcast

> --- /dev/null
> +++ b/drivers/input/keyboard/maple_keyb.c
> +static void dc_scan_kbd(struct dc_kbd *kbd)

still some funny wrappings in this func ...

> +				printk
> +				    ("Unknown key (scancode %#x) released.",
> +				     kbd->old[i]);
> ...
> +				printk
> +				    ("Unknown key (scancode %#x) pressed.",
> +				     kbd->new[i]);

missing KERN log levels in those printk's

> +static int dc_kbd_connect(struct maple_device *dev)
> +{
> ...
> +	struct dc_kbd *kbd;
> ...
> +	kbd = kzalloc(sizeof(struct dc_kbd), GFP_KERNEL);

i find this more readable/managable myself:
kbd = kzalloc(*kbd, GFP_KERNEL);

> +	kbd->dev = input_allocate_device();
> ...
> +	retval = input_register_device(kbd->dev);
> +	if (unlikely(retval))
> +		goto cleanup;
> ...
> +      cleanup:
> +	kfree(kbd);
> +	return -EINVAL;

i'm not familiar with the input layer, but do you need to deallocate that 
input device if the register fails ?  if so, i guess dc_kbd_disconnect() 
would need tweaking too ...
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

  parent reply	other threads:[~2007-09-05  4:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-04 23:34 [PATCH] Add support for keyboard on SEGA Dreamcast Adrian McMenamin
2007-09-05  3:04 ` Dmitry Torokhov
2007-09-07 22:01   ` Adrian McMenamin
2007-09-05  4:34 ` Mike Frysinger [this message]
2007-09-05  4:50   ` Dmitry Torokhov

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=200709050034.57010.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxsh-dev@lists.sourceforge.net \
    --cc=lkmladrian@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox