aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2007-09-26 01:57:31 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:52:39 -0400
commit53465eb4ab16660eab0a7be168a087a97172e650 (patch)
tree4449d8f837fa9a17ab158957628538b7d47bb203 /net
parent912d8f0b1f17b7e851ebbfeb17a16de9f9c7cb88 (diff)
[BLUETOOTH]: Make hidp_setup_input() return int
This patch: - makes hidp_setup_input() return int to indicate errors; - checks its return value to handle errors. And this time it is against -rc7-mm1 tree. Thanks to roel and Marcel Holtmann for comments. Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hidp/core.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 64d89ca28847..ff5784b440d7 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -625,7 +625,7 @@ static struct device *hidp_get_device(struct hidp_session *session)
625 return conn ? &conn->dev : NULL; 625 return conn ? &conn->dev : NULL;
626} 626}
627 627
628static inline void hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req) 628static inline int hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req)
629{ 629{
630 struct input_dev *input = session->input; 630 struct input_dev *input = session->input;
631 int i; 631 int i;
@@ -667,7 +667,7 @@ static inline void hidp_setup_input(struct hidp_session *session, struct hidp_co
667 667
668 input->event = hidp_input_event; 668 input->event = hidp_input_event;
669 669
670 input_register_device(input); 670 return input_register_device(input);
671} 671}
672 672
673static int hidp_open(struct hid_device *hid) 673static int hidp_open(struct hid_device *hid)
@@ -820,8 +820,11 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
820 session->flags = req->flags & (1 << HIDP_BLUETOOTH_VENDOR_ID); 820 session->flags = req->flags & (1 << HIDP_BLUETOOTH_VENDOR_ID);
821 session->idle_to = req->idle_to; 821 session->idle_to = req->idle_to;
822 822
823 if (session->input) 823 if (session->input) {
824 hidp_setup_input(session, req); 824 err = hidp_setup_input(session, req);
825 if (err < 0)
826 goto failed;
827 }
825 828
826 if (session->hid) 829 if (session->hid)
827 hidp_setup_hid(session, req); 830 hidp_setup_hid(session, req);