linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: linux-input <linux-input@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	linux-sh <linux-sh@vger.kernel.org>
Subject: Re: [RFC][patch] sh: maple: Dreamcast mouse driver
Date: Sun, 28 Dec 2008 16:28:15 -0800	[thread overview]
Message-ID: <200812281628.15790.dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <1230508197.7574.4.camel@localhost.localdomain>

Hi Adrian,

On Sunday 28 December 2008 15:49:57 Adrian McMenamin wrote:
> +
> +	mdev = to_maple_dev(dev);
> +	mdrv = to_maple_driver(dev->driver);
> +	if (!mdrv||!mdev) {
> +		error = EINVAL;
> +		goto fail;
> +	}

This still does not make sense, mdev and mdrv will never be NULL.

> +fail:
> +	return -error;

You just negated the error returned by input_register_device() and the module 
loading code will think that probe succeeded.

> +
> +static int remove_maple_mouse(struct device *dev)
> +{
> +	struct maple_device *mdev = to_maple_dev(dev);
> +	struct dc_mouse *mse = maple_get_drvdata(mdev);
> +
> +	mdev->callback = NULL;

I am uneasy about just whacking a NULL there. The other driver you sent 
implemented open and close methods and used maple_getcond_callback to 
manipulate callbacks which I assume is safer than just resetting the pointer.

-- 
Dmitry

      reply	other threads:[~2008-12-29  0:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-28 23:49 [RFC][patch] sh: maple: Dreamcast mouse driver Adrian McMenamin
2008-12-29  0:28 ` Dmitry Torokhov [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=200812281628.15790.dmitry.torokhov@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=adrian@newgolddream.dyndns.info \
    --cc=akpm@osdl.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-sh@vger.kernel.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).