aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavan Savoy <pavan_savoy@ti.com>2010-07-14 09:21:12 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-22 15:06:14 -0400
commit320920cba355146258da7de80bed0069c1dff24a (patch)
tree4ffadaed6ef34aedfb4dda178b0a8d2f32dc2898
parent771dafdc38c9158c2b9d2b05f6ddda0d08c33a17 (diff)
Staging: ti-st: make use of linux err codes
remove custom error code definitions from the header and make use of the agreed upon linux error codes. Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/ti-st/bt_drv.c6
-rw-r--r--drivers/staging/ti-st/st.h9
-rw-r--r--drivers/staging/ti-st/st_core.c38
-rw-r--r--drivers/staging/ti-st/st_kim.c46
-rw-r--r--drivers/staging/ti-st/st_ll.c4
5 files changed, 47 insertions, 56 deletions
diff --git a/drivers/staging/ti-st/bt_drv.c b/drivers/staging/ti-st/bt_drv.c
index d8420b5c91f..d70aea16891 100644
--- a/drivers/staging/ti-st/bt_drv.c
+++ b/drivers/staging/ti-st/bt_drv.c
@@ -191,7 +191,7 @@ static int hci_st_open(struct hci_dev *hdev)
191 191
192 /* Register with ST layer */ 192 /* Register with ST layer */
193 err = st_register(&hci_st_proto); 193 err = st_register(&hci_st_proto);
194 if (err == ST_ERR_PENDING) { 194 if (err == -EINPROGRESS) {
195 /* Prepare wait-for-completion handler data structures. 195 /* Prepare wait-for-completion handler data structures.
196 * Needed to syncronize this and st_registration_completion_cb() 196 * Needed to syncronize this and st_registration_completion_cb()
197 * functions. 197 * functions.
@@ -232,7 +232,7 @@ static int hci_st_open(struct hci_dev *hdev)
232 return -EAGAIN; 232 return -EAGAIN;
233 } 233 }
234 err = 0; 234 err = 0;
235 } else if (err == ST_ERR_FAILURE) { 235 } else if (err == -1) {
236 BT_DRV_ERR("st_register failed %d", err); 236 BT_DRV_ERR("st_register failed %d", err);
237 BTDRV_API_EXIT(-EAGAIN); 237 BTDRV_API_EXIT(-EAGAIN);
238 return -EAGAIN; 238 return -EAGAIN;
@@ -280,7 +280,7 @@ static int hci_st_close(struct hci_dev *hdev)
280 /* Unregister from ST layer */ 280 /* Unregister from ST layer */
281 if (test_and_clear_bit(BT_ST_REGISTERED, &hst->flags)) { 281 if (test_and_clear_bit(BT_ST_REGISTERED, &hst->flags)) {
282 err = st_unregister(ST_BT); 282 err = st_unregister(ST_BT);
283 if (err != ST_SUCCESS) { 283 if (err != 0) {
284 BT_DRV_ERR("st_unregister failed %d", err); 284 BT_DRV_ERR("st_unregister failed %d", err);
285 BTDRV_API_EXIT(-EBUSY); 285 BTDRV_API_EXIT(-EBUSY);
286 return -EBUSY; 286 return -EBUSY;
diff --git a/drivers/staging/ti-st/st.h b/drivers/staging/ti-st/st.h
index e6a8ffde30a..c4288aa8d2b 100644
--- a/drivers/staging/ti-st/st.h
+++ b/drivers/staging/ti-st/st.h
@@ -50,15 +50,6 @@ enum proto_type {
50 ST_MAX, 50 ST_MAX,
51}; 51};
52 52
53enum {
54 ST_ERR_FAILURE = -1, /* check struct */
55 ST_SUCCESS,
56 ST_ERR_PENDING = -5, /* to call reg_complete_cb */
57 ST_ERR_ALREADY, /* already registered */
58 ST_ERR_INPROGRESS,
59 ST_ERR_NOPROTO, /* protocol not supported */
60};
61
62/* per protocol structure 53/* per protocol structure
63 * for BT/FM and GPS 54 * for BT/FM and GPS
64 */ 55 */
diff --git a/drivers/staging/ti-st/st_core.c b/drivers/staging/ti-st/st_core.c
index bf5049c1d12..0ad8cecd5e4 100644
--- a/drivers/staging/ti-st/st_core.c
+++ b/drivers/staging/ti-st/st_core.c
@@ -87,7 +87,7 @@ int st_int_write(struct st_data_s *st_gdata,
87 struct tty_struct *tty; 87 struct tty_struct *tty;
88 if (unlikely(st_gdata == NULL || st_gdata->tty == NULL)) { 88 if (unlikely(st_gdata == NULL || st_gdata->tty == NULL)) {
89 pr_err("tty unavailable to perform write"); 89 pr_err("tty unavailable to perform write");
90 return ST_ERR_FAILURE; 90 return -1;
91 } 91 }
92 tty = st_gdata->tty; 92 tty = st_gdata->tty;
93#ifdef VERBOSE 93#ifdef VERBOSE
@@ -123,7 +123,7 @@ void st_send_frame(enum proto_type protoid, struct st_data_s *st_gdata)
123 */ 123 */
124 if (likely(st_gdata->list[protoid]->recv != NULL)) { 124 if (likely(st_gdata->list[protoid]->recv != NULL)) {
125 if (unlikely(st_gdata->list[protoid]->recv(st_gdata->rx_skb) 125 if (unlikely(st_gdata->list[protoid]->recv(st_gdata->rx_skb)
126 != ST_SUCCESS)) { 126 != 0)) {
127 pr_err(" proto stack %d's ->recv failed", protoid); 127 pr_err(" proto stack %d's ->recv failed", protoid);
128 kfree_skb(st_gdata->rx_skb); 128 kfree_skb(st_gdata->rx_skb);
129 return; 129 return;
@@ -601,7 +601,7 @@ void kim_st_list_protocols(struct st_data_s *st_gdata, char *buf)
601long st_register(struct st_proto_s *new_proto) 601long st_register(struct st_proto_s *new_proto)
602{ 602{
603 struct st_data_s *st_gdata; 603 struct st_data_s *st_gdata;
604 long err = ST_SUCCESS; 604 long err = 0;
605 unsigned long flags = 0; 605 unsigned long flags = 0;
606 606
607 st_kim_ref(&st_gdata); 607 st_kim_ref(&st_gdata);
@@ -609,17 +609,17 @@ long st_register(struct st_proto_s *new_proto)
609 if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL 609 if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL
610 || new_proto->reg_complete_cb == NULL) { 610 || new_proto->reg_complete_cb == NULL) {
611 pr_err("gdata/new_proto/recv or reg_complete_cb not ready"); 611 pr_err("gdata/new_proto/recv or reg_complete_cb not ready");
612 return ST_ERR_FAILURE; 612 return -1;
613 } 613 }
614 614
615 if (new_proto->type < ST_BT || new_proto->type >= ST_MAX) { 615 if (new_proto->type < ST_BT || new_proto->type >= ST_MAX) {
616 pr_err("protocol %d not supported", new_proto->type); 616 pr_err("protocol %d not supported", new_proto->type);
617 return ST_ERR_NOPROTO; 617 return -EPROTONOSUPPORT;
618 } 618 }
619 619
620 if (st_gdata->list[new_proto->type] != NULL) { 620 if (st_gdata->list[new_proto->type] != NULL) {
621 pr_err("protocol %d already registered", new_proto->type); 621 pr_err("protocol %d already registered", new_proto->type);
622 return ST_ERR_ALREADY; 622 return -EALREADY;
623 } 623 }
624 624
625 /* can be from process context only */ 625 /* can be from process context only */
@@ -636,7 +636,7 @@ long st_register(struct st_proto_s *new_proto)
636 636
637 set_bit(ST_REG_PENDING, &st_gdata->st_state); 637 set_bit(ST_REG_PENDING, &st_gdata->st_state);
638 spin_unlock_irqrestore(&st_gdata->lock, flags); 638 spin_unlock_irqrestore(&st_gdata->lock, flags);
639 return ST_ERR_PENDING; 639 return -EINPROGRESS;
640 } else if (st_gdata->protos_registered == ST_EMPTY) { 640 } else if (st_gdata->protos_registered == ST_EMPTY) {
641 pr_info(" protocol list empty :%d ", new_proto->type); 641 pr_info(" protocol list empty :%d ", new_proto->type);
642 set_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state); 642 set_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state);
@@ -651,15 +651,15 @@ long st_register(struct st_proto_s *new_proto)
651 * since it involves BT fw download 651 * since it involves BT fw download
652 */ 652 */
653 err = st_kim_start(st_gdata->kim_data); 653 err = st_kim_start(st_gdata->kim_data);
654 if (err != ST_SUCCESS) { 654 if (err != 0) {
655 clear_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state); 655 clear_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state);
656 if ((st_gdata->protos_registered != ST_EMPTY) && 656 if ((st_gdata->protos_registered != ST_EMPTY) &&
657 (test_bit(ST_REG_PENDING, &st_gdata->st_state))) { 657 (test_bit(ST_REG_PENDING, &st_gdata->st_state))) {
658 pr_err(" KIM failure complete callback "); 658 pr_err(" KIM failure complete callback ");
659 st_reg_complete(st_gdata, ST_ERR_FAILURE); 659 st_reg_complete(st_gdata, -1);
660 } 660 }
661 661
662 return ST_ERR_FAILURE; 662 return -1;
663 } 663 }
664 664
665 /* the protocol might require other gpios to be toggled 665 /* the protocol might require other gpios to be toggled
@@ -675,7 +675,7 @@ long st_register(struct st_proto_s *new_proto)
675 if ((st_gdata->protos_registered != ST_EMPTY) && 675 if ((st_gdata->protos_registered != ST_EMPTY) &&
676 (test_bit(ST_REG_PENDING, &st_gdata->st_state))) { 676 (test_bit(ST_REG_PENDING, &st_gdata->st_state))) {
677 pr_info(" call reg complete callback "); 677 pr_info(" call reg complete callback ");
678 st_reg_complete(st_gdata, ST_SUCCESS); 678 st_reg_complete(st_gdata, 0);
679 } 679 }
680 clear_bit(ST_REG_PENDING, &st_gdata->st_state); 680 clear_bit(ST_REG_PENDING, &st_gdata->st_state);
681 681
@@ -685,7 +685,7 @@ long st_register(struct st_proto_s *new_proto)
685 if (st_gdata->list[new_proto->type] != NULL) { 685 if (st_gdata->list[new_proto->type] != NULL) {
686 pr_err(" proto %d already registered ", 686 pr_err(" proto %d already registered ",
687 new_proto->type); 687 new_proto->type);
688 return ST_ERR_ALREADY; 688 return -EALREADY;
689 } 689 }
690 690
691 spin_lock_irqsave(&st_gdata->lock, flags); 691 spin_lock_irqsave(&st_gdata->lock, flags);
@@ -709,7 +709,7 @@ long st_register(struct st_proto_s *new_proto)
709 default: 709 default:
710 pr_err("%d protocol not supported", 710 pr_err("%d protocol not supported",
711 new_proto->type); 711 new_proto->type);
712 err = ST_ERR_NOPROTO; 712 err = -EPROTONOSUPPORT;
713 /* something wrong */ 713 /* something wrong */
714 break; 714 break;
715 } 715 }
@@ -730,7 +730,7 @@ EXPORT_SYMBOL_GPL(st_register);
730 */ 730 */
731long st_unregister(enum proto_type type) 731long st_unregister(enum proto_type type)
732{ 732{
733 long err = ST_SUCCESS; 733 long err = 0;
734 unsigned long flags = 0; 734 unsigned long flags = 0;
735 struct st_data_s *st_gdata; 735 struct st_data_s *st_gdata;
736 736
@@ -739,7 +739,7 @@ long st_unregister(enum proto_type type)
739 st_kim_ref(&st_gdata); 739 st_kim_ref(&st_gdata);
740 if (type < ST_BT || type >= ST_MAX) { 740 if (type < ST_BT || type >= ST_MAX) {
741 pr_err(" protocol %d not supported", type); 741 pr_err(" protocol %d not supported", type);
742 return ST_ERR_NOPROTO; 742 return -EPROTONOSUPPORT;
743 } 743 }
744 744
745 spin_lock_irqsave(&st_gdata->lock, flags); 745 spin_lock_irqsave(&st_gdata->lock, flags);
@@ -747,7 +747,7 @@ long st_unregister(enum proto_type type)
747 if (st_gdata->list[type] == NULL) { 747 if (st_gdata->list[type] == NULL) {
748 pr_err(" protocol %d not registered", type); 748 pr_err(" protocol %d not registered", type);
749 spin_unlock_irqrestore(&st_gdata->lock, flags); 749 spin_unlock_irqrestore(&st_gdata->lock, flags);
750 return ST_ERR_NOPROTO; 750 return -EPROTONOSUPPORT;
751 } 751 }
752 752
753 st_gdata->protos_registered--; 753 st_gdata->protos_registered--;
@@ -794,7 +794,7 @@ long st_write(struct sk_buff *skb)
794 if (unlikely(skb == NULL || st_gdata == NULL 794 if (unlikely(skb == NULL || st_gdata == NULL
795 || st_gdata->tty == NULL)) { 795 || st_gdata->tty == NULL)) {
796 pr_err("data/tty unavailable to perform write"); 796 pr_err("data/tty unavailable to perform write");
797 return ST_ERR_FAILURE; 797 return -1;
798 } 798 }
799#ifdef DEBUG /* open-up skb to read the 1st byte */ 799#ifdef DEBUG /* open-up skb to read the 1st byte */
800 switch (skb->data[0]) { 800 switch (skb->data[0]) {
@@ -813,7 +813,7 @@ long st_write(struct sk_buff *skb)
813 if (unlikely(st_gdata->list[protoid] == NULL)) { 813 if (unlikely(st_gdata->list[protoid] == NULL)) {
814 pr_err(" protocol %d not registered, and writing? ", 814 pr_err(" protocol %d not registered, and writing? ",
815 protoid); 815 protoid);
816 return ST_ERR_FAILURE; 816 return -1;
817 } 817 }
818#endif 818#endif
819 pr_info("%d to be written", skb->len); 819 pr_info("%d to be written", skb->len);
@@ -837,7 +837,7 @@ EXPORT_SYMBOL_GPL(st_unregister);
837 */ 837 */
838static int st_tty_open(struct tty_struct *tty) 838static int st_tty_open(struct tty_struct *tty)
839{ 839{
840 int err = ST_SUCCESS; 840 int err = 0;
841 struct st_data_s *st_gdata; 841 struct st_data_s *st_gdata;
842 pr_info("%s ", __func__); 842 pr_info("%s ", __func__);
843 843
diff --git a/drivers/staging/ti-st/st_kim.c b/drivers/staging/ti-st/st_kim.c
index d4fd2c28b82..33fc4d0a2ed 100644
--- a/drivers/staging/ti-st/st_kim.c
+++ b/drivers/staging/ti-st/st_kim.c
@@ -247,13 +247,13 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
247 INIT_COMPLETION(kim_gdata->kim_rcvd); 247 INIT_COMPLETION(kim_gdata->kim_rcvd);
248 if (4 != st_int_write(kim_gdata->core_data, read_ver_cmd, 4)) { 248 if (4 != st_int_write(kim_gdata->core_data, read_ver_cmd, 4)) {
249 pr_err("kim: couldn't write 4 bytes"); 249 pr_err("kim: couldn't write 4 bytes");
250 return ST_ERR_FAILURE; 250 return -1;
251 } 251 }
252 252
253 if (!wait_for_completion_timeout 253 if (!wait_for_completion_timeout
254 (&kim_gdata->kim_rcvd, msecs_to_jiffies(CMD_RESP_TIME))) { 254 (&kim_gdata->kim_rcvd, msecs_to_jiffies(CMD_RESP_TIME))) {
255 pr_err(" waiting for ver info- timed out "); 255 pr_err(" waiting for ver info- timed out ");
256 return ST_ERR_FAILURE; 256 return -1;
257 } 257 }
258 258
259 version = 259 version =
@@ -275,7 +275,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
275 kim_gdata->version.min_ver = min_ver; 275 kim_gdata->version.min_ver = min_ver;
276 276
277 pr_info("%s", bts_scr_name); 277 pr_info("%s", bts_scr_name);
278 return ST_SUCCESS; 278 return 0;
279} 279}
280 280
281/* internal function which parses through the .bts firmware script file 281/* internal function which parses through the .bts firmware script file
@@ -283,7 +283,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
283 */ 283 */
284static long download_firmware(struct kim_data_s *kim_gdata) 284static long download_firmware(struct kim_data_s *kim_gdata)
285{ 285{
286 long err = ST_SUCCESS; 286 long err = 0;
287 long len = 0; 287 long len = 0;
288 register unsigned char *ptr = NULL; 288 register unsigned char *ptr = NULL;
289 register unsigned char *action_ptr = NULL; 289 register unsigned char *action_ptr = NULL;
@@ -292,7 +292,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
292 pr_info("%s", __func__); 292 pr_info("%s", __func__);
293 293
294 err = read_local_version(kim_gdata, bts_scr_name); 294 err = read_local_version(kim_gdata, bts_scr_name);
295 if (err != ST_SUCCESS) { 295 if (err != 0) {
296 pr_err("kim: failed to read local ver"); 296 pr_err("kim: failed to read local ver");
297 return err; 297 return err;
298 } 298 }
@@ -303,7 +303,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
303 (kim_gdata->fw_entry->size == 0))) { 303 (kim_gdata->fw_entry->size == 0))) {
304 pr_err(" request_firmware failed(errno %ld) for %s", err, 304 pr_err(" request_firmware failed(errno %ld) for %s", err,
305 bts_scr_name); 305 bts_scr_name);
306 return ST_ERR_FAILURE; 306 return -1;
307 } 307 }
308 ptr = (void *)kim_gdata->fw_entry->data; 308 ptr = (void *)kim_gdata->fw_entry->data;
309 len = kim_gdata->fw_entry->size; 309 len = kim_gdata->fw_entry->size;
@@ -338,7 +338,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
338 ((struct bts_action *)ptr)->size); 338 ((struct bts_action *)ptr)->size);
339 if (unlikely(err < 0)) { 339 if (unlikely(err < 0)) {
340 release_firmware(kim_gdata->fw_entry); 340 release_firmware(kim_gdata->fw_entry);
341 return ST_ERR_FAILURE; 341 return -1;
342 } 342 }
343 if (!wait_for_completion_timeout 343 if (!wait_for_completion_timeout
344 (&kim_gdata->kim_rcvd, 344 (&kim_gdata->kim_rcvd,
@@ -347,7 +347,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
347 (" response timeout during fw download "); 347 (" response timeout during fw download ");
348 /* timed out */ 348 /* timed out */
349 release_firmware(kim_gdata->fw_entry); 349 release_firmware(kim_gdata->fw_entry);
350 return ST_ERR_FAILURE; 350 return -1;
351 } 351 }
352 break; 352 break;
353 case ACTION_DELAY: /* sleep */ 353 case ACTION_DELAY: /* sleep */
@@ -365,7 +365,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
365 } 365 }
366 /* fw download complete */ 366 /* fw download complete */
367 release_firmware(kim_gdata->fw_entry); 367 release_firmware(kim_gdata->fw_entry);
368 return ST_SUCCESS; 368 return 0;
369} 369}
370 370
371/**********************************************************************/ 371/**********************************************************************/
@@ -451,7 +451,7 @@ void st_kim_complete(void *kim_data)
451*/ 451*/
452long st_kim_start(void *kim_data) 452long st_kim_start(void *kim_data)
453{ 453{
454 long err = ST_SUCCESS; 454 long err = 0;
455 long retry = POR_RETRY_COUNT; 455 long retry = POR_RETRY_COUNT;
456 struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; 456 struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data;
457 457
@@ -475,7 +475,7 @@ long st_kim_start(void *kim_data)
475 err = kill_pid(find_get_pid(kim_gdata->uim_pid), SIGUSR2, 0); 475 err = kill_pid(find_get_pid(kim_gdata->uim_pid), SIGUSR2, 0);
476 if (err != 0) { 476 if (err != 0) {
477 pr_info(" sending SIGUSR2 to uim failed %ld", err); 477 pr_info(" sending SIGUSR2 to uim failed %ld", err);
478 err = ST_ERR_FAILURE; 478 err = -1;
479 continue; 479 continue;
480 } 480 }
481#endif 481#endif
@@ -486,13 +486,13 @@ long st_kim_start(void *kim_data)
486 msecs_to_jiffies(LDISC_TIME)); 486 msecs_to_jiffies(LDISC_TIME));
487 if (!err) { /* timeout */ 487 if (!err) { /* timeout */
488 pr_err("line disc installation timed out "); 488 pr_err("line disc installation timed out ");
489 err = ST_ERR_FAILURE; 489 err = -1;
490 continue; 490 continue;
491 } else { 491 } else {
492 /* ldisc installed now */ 492 /* ldisc installed now */
493 pr_info(" line discipline installed "); 493 pr_info(" line discipline installed ");
494 err = download_firmware(kim_gdata); 494 err = download_firmware(kim_gdata);
495 if (err != ST_SUCCESS) { 495 if (err != 0) {
496 pr_err("download firmware failed"); 496 pr_err("download firmware failed");
497 continue; 497 continue;
498 } else { /* on success don't retry */ 498 } else { /* on success don't retry */
@@ -507,7 +507,7 @@ long st_kim_start(void *kim_data)
507*/ 507*/
508long st_kim_stop(void *kim_data) 508long st_kim_stop(void *kim_data)
509{ 509{
510 long err = ST_SUCCESS; 510 long err = 0;
511 struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data; 511 struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data;
512 512
513 INIT_COMPLETION(kim_gdata->ldisc_installed); 513 INIT_COMPLETION(kim_gdata->ldisc_installed);
@@ -516,7 +516,7 @@ long st_kim_stop(void *kim_data)
516 err = kill_pid(find_get_pid(kim_gdata->uim_pid), SIGUSR2, 1); 516 err = kill_pid(find_get_pid(kim_gdata->uim_pid), SIGUSR2, 1);
517 if (err != 0) { 517 if (err != 0) {
518 pr_err("sending SIGUSR2 to uim failed %ld", err); 518 pr_err("sending SIGUSR2 to uim failed %ld", err);
519 return ST_ERR_FAILURE; 519 return -1;
520 } 520 }
521#endif 521#endif
522 /* set BT rfkill to be blocked */ 522 /* set BT rfkill to be blocked */
@@ -527,7 +527,7 @@ long st_kim_stop(void *kim_data)
527 msecs_to_jiffies(LDISC_TIME)); 527 msecs_to_jiffies(LDISC_TIME));
528 if (!err) { /* timeout */ 528 if (!err) { /* timeout */
529 pr_err(" timed out waiting for ldisc to be un-installed"); 529 pr_err(" timed out waiting for ldisc to be un-installed");
530 return ST_ERR_FAILURE; 530 return -1;
531 } 531 }
532 532
533 /* By default configure BT nShutdown to LOW state */ 533 /* By default configure BT nShutdown to LOW state */
@@ -607,7 +607,7 @@ static int kim_toggle_radio(void *data, bool blocked)
607 pr_err(" wrong proto type "); 607 pr_err(" wrong proto type ");
608 break; 608 break;
609 } 609 }
610 return ST_SUCCESS; 610 return 0;
611} 611}
612 612
613void st_kim_ref(struct st_data_s **core_data) 613void st_kim_ref(struct st_data_s **core_data)
@@ -643,7 +643,7 @@ static int kim_probe(struct platform_device *pdev)
643 status = st_core_init(&kim_gdata->core_data); 643 status = st_core_init(&kim_gdata->core_data);
644 if (status != 0) { 644 if (status != 0) {
645 pr_err(" ST core init failed"); 645 pr_err(" ST core init failed");
646 return ST_ERR_FAILURE; 646 return -1;
647 } 647 }
648 /* refer to itself */ 648 /* refer to itself */
649 kim_gdata->core_data->kim_data = kim_gdata; 649 kim_gdata->core_data->kim_data = kim_gdata;
@@ -716,7 +716,7 @@ static int kim_probe(struct platform_device *pdev)
716 return -1; 716 return -1;
717 } 717 }
718 pr_info(" sysfs entries created "); 718 pr_info(" sysfs entries created ");
719 return ST_SUCCESS; 719 return 0;
720} 720}
721 721
722static int kim_remove(struct platform_device *pdev) 722static int kim_remove(struct platform_device *pdev)
@@ -745,7 +745,7 @@ static int kim_remove(struct platform_device *pdev)
745 745
746 kfree(kim_gdata); 746 kfree(kim_gdata);
747 kim_gdata = NULL; 747 kim_gdata = NULL;
748 return ST_SUCCESS; 748 return 0;
749} 749}
750 750
751/**********************************************************************/ 751/**********************************************************************/
@@ -753,13 +753,13 @@ static int kim_remove(struct platform_device *pdev)
753 753
754static int __init st_kim_init(void) 754static int __init st_kim_init(void)
755{ 755{
756 long ret = ST_SUCCESS; 756 long ret = 0;
757 ret = platform_driver_register(&kim_platform_driver); 757 ret = platform_driver_register(&kim_platform_driver);
758 if (ret != 0) { 758 if (ret != 0) {
759 pr_err("platform drv registration failed"); 759 pr_err("platform drv registration failed");
760 return ST_ERR_FAILURE; 760 return -1;
761 } 761 }
762 return ST_SUCCESS; 762 return 0;
763} 763}
764 764
765static void __exit st_kim_deinit(void) 765static void __exit st_kim_deinit(void)
diff --git a/drivers/staging/ti-st/st_ll.c b/drivers/staging/ti-st/st_ll.c
index 0685a100db6..6bc0759729f 100644
--- a/drivers/staging/ti-st/st_ll.c
+++ b/drivers/staging/ti-st/st_ll.c
@@ -127,9 +127,9 @@ unsigned long st_ll_sleep_state(struct st_data_s *st_data,
127 break; 127 break;
128 default: 128 default:
129 pr_err(" unknown input/state "); 129 pr_err(" unknown input/state ");
130 return ST_ERR_FAILURE; 130 return -1;
131 } 131 }
132 return ST_SUCCESS; 132 return 0;
133} 133}
134 134
135/* Called from ST CORE to initialize ST LL */ 135/* Called from ST CORE to initialize ST LL */