Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
Staging: ti-st: remove st_get_plat_device

+24 -10
-1
drivers/staging/ti-st/st.h
··· 80 80 extern long st_register(struct st_proto_s *); 81 81 extern long st_unregister(enum proto_type); 82 82 83 - extern struct platform_device *st_get_plat_device(void); 84 83 #endif /* ST_H */
+4 -5
drivers/staging/ti-st/st_core.c
··· 38 38 #include "st_ll.h" 39 39 #include "st.h" 40 40 41 - #define VERBOSE 42 41 /* strings to be used for rfkill entries and by 43 42 * ST Core to be used for sysfs debug entry 44 43 */ ··· 580 581 long err = 0; 581 582 unsigned long flags = 0; 582 583 583 - st_kim_ref(&st_gdata); 584 + st_kim_ref(&st_gdata, 0); 584 585 pr_info("%s(%d) ", __func__, new_proto->type); 585 586 if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL 586 587 || new_proto->reg_complete_cb == NULL) { ··· 712 713 713 714 pr_debug("%s: %d ", __func__, type); 714 715 715 - st_kim_ref(&st_gdata); 716 + st_kim_ref(&st_gdata, 0); 716 717 if (type < ST_BT || type >= ST_MAX) { 717 718 pr_err(" protocol %d not supported", type); 718 719 return -EPROTONOSUPPORT; ··· 766 767 #endif 767 768 long len; 768 769 769 - st_kim_ref(&st_gdata); 770 + st_kim_ref(&st_gdata, 0); 770 771 if (unlikely(skb == NULL || st_gdata == NULL 771 772 || st_gdata->tty == NULL)) { 772 773 pr_err("data/tty unavailable to perform write"); ··· 817 818 struct st_data_s *st_gdata; 818 819 pr_info("%s ", __func__); 819 820 820 - st_kim_ref(&st_gdata); 821 + st_kim_ref(&st_gdata, 0); 821 822 st_gdata->tty = tty; 822 823 tty->disc_data = st_gdata; 823 824
+1 -1
drivers/staging/ti-st/st_core.h
··· 117 117 void st_core_exit(struct st_data_s *); 118 118 119 119 /* ask for reference from KIM */ 120 - void st_kim_ref(struct st_data_s **); 120 + void st_kim_ref(struct st_data_s **, int); 121 121 122 122 #define GPS_STUB_TEST 123 123 #ifdef GPS_STUB_TEST
+19 -3
drivers/staging/ti-st/st_kim.c
··· 72 72 PROTO_ENTRY(ST_GPS, "GPS"), 73 73 }; 74 74 75 + #define MAX_ST_DEVICES 3 /* Imagine 1 on each UART for now */ 76 + struct platform_device *st_kim_devices[MAX_ST_DEVICES]; 75 77 76 78 /**********************************************************************/ 77 79 /* internal functions */ 80 + 81 + /** 82 + * st_get_plat_device - 83 + * function which returns the reference to the platform device 84 + * requested by id. As of now only 1 such device exists (id=0) 85 + * the context requesting for reference can get the id to be 86 + * requested by a. The protocol driver which is registering or 87 + * b. the tty device which is opened. 88 + */ 89 + static struct platform_device *st_get_plat_device(int id) 90 + { 91 + return st_kim_devices[id]; 92 + } 78 93 79 94 /** 80 95 * validate_firmware_response - ··· 368 353 struct kim_data_s *kim_gdata; 369 354 pr_info(" %s ", __func__); 370 355 371 - kim_pdev = st_get_plat_device(); 356 + kim_pdev = st_get_plat_device(0); 372 357 kim_gdata = dev_get_drvdata(&kim_pdev->dev); 373 358 374 359 if (kim_gdata->gpios[type] == -1) { ··· 589 574 * This would enable multiple such platform devices to exist 590 575 * on a given platform 591 576 */ 592 - void st_kim_ref(struct st_data_s **core_data) 577 + void st_kim_ref(struct st_data_s **core_data, int id) 593 578 { 594 579 struct platform_device *pdev; 595 580 struct kim_data_s *kim_gdata; 596 581 /* get kim_gdata reference from platform device */ 597 - pdev = st_get_plat_device(); 582 + pdev = st_get_plat_device(id); 598 583 kim_gdata = dev_get_drvdata(&pdev->dev); 599 584 *core_data = kim_gdata->core_data; 600 585 } ··· 638 623 long *gpios = pdev->dev.platform_data; 639 624 struct kim_data_s *kim_gdata; 640 625 626 + st_kim_devices[pdev->id] = pdev; 641 627 kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC); 642 628 if (!kim_gdata) { 643 629 pr_err("no mem to allocate");