aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@gnu.org>2010-09-29 21:53:35 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-10-13 10:49:23 -0400
commit6792cbbb254712a8c0fa8a4c97c8d521c7c41c28 (patch)
tree3ab25c521042133a27f9875ad1d366e4b44ad68f /drivers/input
parent7aed3fb73f4ac7912ce9e0c232a15ee012bf4be5 (diff)
Input: return -ENOMEM in select drivers when memory allocation fails
Instead of using -1 let's start using proper error codes. Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/powermate.c2
-rw-r--r--drivers/input/mouse/elantech.c2
-rw-r--r--drivers/input/mouse/synaptics.c2
-rw-r--r--drivers/input/mouse/trackpoint.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
index bf170f6b442..f45947190e4 100644
--- a/drivers/input/misc/powermate.c
+++ b/drivers/input/misc/powermate.c
@@ -280,7 +280,7 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev
280 280
281 pm->configcr = kmalloc(sizeof(*(pm->configcr)), GFP_KERNEL); 281 pm->configcr = kmalloc(sizeof(*(pm->configcr)), GFP_KERNEL);
282 if (!pm->configcr) 282 if (!pm->configcr)
283 return -1; 283 return -ENOMEM;
284 284
285 return 0; 285 return 0;
286} 286}
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 48311204ba5..04d9bf320a4 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -699,7 +699,7 @@ int elantech_init(struct psmouse *psmouse)
699 699
700 psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); 700 psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL);
701 if (!etd) 701 if (!etd)
702 return -1; 702 return -ENOMEM;
703 703
704 etd->parity[0] = 1; 704 etd->parity[0] = 1;
705 for (i = 1; i < 256; i++) 705 for (i = 1; i < 256; i++)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 96b70a43515..a79bc362dde 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -731,7 +731,7 @@ int synaptics_init(struct psmouse *psmouse)
731 731
732 psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL); 732 psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL);
733 if (!priv) 733 if (!priv)
734 return -1; 734 return -ENOMEM;
735 735
736 psmouse_reset(psmouse); 736 psmouse_reset(psmouse);
737 737
diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
index 0643e49ca60..54b2fa892e1 100644
--- a/drivers/input/mouse/trackpoint.c
+++ b/drivers/input/mouse/trackpoint.c
@@ -303,7 +303,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)
303 303
304 psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL); 304 psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);
305 if (!psmouse->private) 305 if (!psmouse->private)
306 return -1; 306 return -ENOMEM;
307 307
308 psmouse->vendor = "IBM"; 308 psmouse->vendor = "IBM";
309 psmouse->name = "TrackPoint"; 309 psmouse->name = "TrackPoint";