Thread (2 messages) 2 messages, 2 authors, 2008-12-29

Re: [RFC][patch] sh: maple: Dreamcast mouse driver

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2008-12-29 00:28:45
Also in: linux-sh

Hi Adrian,

On Sunday 28 December 2008 15:49:57 Adrian McMenamin wrote:
quoted hunk ↗ jump to hunk
+
+	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.
quoted hunk ↗ jump to hunk
+
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help