aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hidp
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-10-06 20:17:32 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-10-06 22:15:05 -0400
commit3415a5fdde715062aa18bd6361f8e75cfbb31208 (patch)
tree137eb2d7a7433abb8a4f0cee388b19f8d76ee0d4 /net/bluetooth/hidp
parent679344e44e09c74848535a28948df7c3b3c1a071 (diff)
Bluetooth: Fix input device registration
This is a regression fix. It made impossible use input device when hid fails. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/hidp')
-rw-r--r--net/bluetooth/hidp/core.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 6cb1d9e8eac5..8d99a17c478c 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -812,7 +812,7 @@ static int hidp_setup_input(struct hidp_session *session,
812 struct hidp_connadd_req *req) 812 struct hidp_connadd_req *req)
813{ 813{
814 struct input_dev *input; 814 struct input_dev *input;
815 int err, i; 815 int i;
816 816
817 input = input_allocate_device(); 817 input = input_allocate_device();
818 if (!input) 818 if (!input)
@@ -859,13 +859,6 @@ static int hidp_setup_input(struct hidp_session *session,
859 859
860 input->event = hidp_input_event; 860 input->event = hidp_input_event;
861 861
862 err = input_register_device(input);
863 if (err < 0) {
864 input_free_device(input);
865 session->input = NULL;
866 return err;
867 }
868
869 return 0; 862 return 0;
870} 863}
871 864
@@ -1067,7 +1060,11 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
1067 !session->waiting_for_startup); 1060 !session->waiting_for_startup);
1068 } 1061 }
1069 1062
1070 err = hid_add_device(session->hid); 1063 if (session->hid)
1064 err = hid_add_device(session->hid);
1065 else
1066 err = input_register_device(session->input);
1067
1071 if (err < 0) { 1068 if (err < 0) {
1072 atomic_inc(&session->terminate); 1069 atomic_inc(&session->terminate);
1073 wake_up_process(session->task); 1070 wake_up_process(session->task);