diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-19 21:24:11 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-19 21:24:11 -0400 |
| commit | 39ab05c8e0b519ff0a04a869f065746e6e8c3d95 (patch) | |
| tree | e73f0ba74c4ea7a80dff9b2dd9445a3a74190e28 /drivers/misc/ti-st/st_core.c | |
| parent | 1477fcc290b3d5c2614bde98bf3b1154c538860d (diff) | |
| parent | c42d2237143fcf35cff642cefe2bcf7786aae312 (diff) | |
Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (44 commits)
debugfs: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warning
sysfs: remove "last sysfs file:" line from the oops messages
drivers/base/memory.c: fix warning due to "memory hotplug: Speed up add/remove when blocks are larger than PAGES_PER_SECTION"
memory hotplug: Speed up add/remove when blocks are larger than PAGES_PER_SECTION
SYSFS: Fix erroneous comments for sysfs_update_group().
driver core: remove the driver-model structures from the documentation
driver core: Add the device driver-model structures to kerneldoc
Translated Documentation/email-clients.txt
RAW driver: Remove call to kobject_put().
reboot: disable usermodehelper to prevent fs access
efivars: prevent oops on unload when efi is not enabled
Allow setting of number of raw devices as a module parameter
Introduce CONFIG_GOOGLE_FIRMWARE
driver: Google Memory Console
driver: Google EFI SMI
x86: Better comments for get_bios_ebda()
x86: get_bios_ebda_length()
misc: fix ti-st build issues
params.c: Use new strtobool function to process boolean inputs
debugfs: move to new strtobool
...
Fix up trivial conflicts in fs/debugfs/file.c due to the same patch
being applied twice, and an unrelated cleanup nearby.
Diffstat (limited to 'drivers/misc/ti-st/st_core.c')
| -rw-r--r-- | drivers/misc/ti-st/st_core.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index 486117f72c9f..f91f82eabda7 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c | |||
| @@ -43,13 +43,15 @@ static void add_channel_to_table(struct st_data_s *st_gdata, | |||
| 43 | pr_info("%s: id %d\n", __func__, new_proto->chnl_id); | 43 | pr_info("%s: id %d\n", __func__, new_proto->chnl_id); |
| 44 | /* list now has the channel id as index itself */ | 44 | /* list now has the channel id as index itself */ |
| 45 | st_gdata->list[new_proto->chnl_id] = new_proto; | 45 | st_gdata->list[new_proto->chnl_id] = new_proto; |
| 46 | st_gdata->is_registered[new_proto->chnl_id] = true; | ||
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | static void remove_channel_from_table(struct st_data_s *st_gdata, | 49 | static void remove_channel_from_table(struct st_data_s *st_gdata, |
| 49 | struct st_proto_s *proto) | 50 | struct st_proto_s *proto) |
| 50 | { | 51 | { |
| 51 | pr_info("%s: id %d\n", __func__, proto->chnl_id); | 52 | pr_info("%s: id %d\n", __func__, proto->chnl_id); |
| 52 | st_gdata->list[proto->chnl_id] = NULL; | 53 | /* st_gdata->list[proto->chnl_id] = NULL; */ |
| 54 | st_gdata->is_registered[proto->chnl_id] = false; | ||
| 53 | } | 55 | } |
| 54 | 56 | ||
| 55 | /* | 57 | /* |
| @@ -104,7 +106,7 @@ void st_send_frame(unsigned char chnl_id, struct st_data_s *st_gdata) | |||
| 104 | 106 | ||
| 105 | if (unlikely | 107 | if (unlikely |
| 106 | (st_gdata == NULL || st_gdata->rx_skb == NULL | 108 | (st_gdata == NULL || st_gdata->rx_skb == NULL |
| 107 | || st_gdata->list[chnl_id] == NULL)) { | 109 | || st_gdata->is_registered[chnl_id] == false)) { |
| 108 | pr_err("chnl_id %d not registered, no data to send?", | 110 | pr_err("chnl_id %d not registered, no data to send?", |
| 109 | chnl_id); | 111 | chnl_id); |
| 110 | kfree_skb(st_gdata->rx_skb); | 112 | kfree_skb(st_gdata->rx_skb); |
| @@ -141,14 +143,15 @@ void st_reg_complete(struct st_data_s *st_gdata, char err) | |||
| 141 | unsigned char i = 0; | 143 | unsigned char i = 0; |
| 142 | pr_info(" %s ", __func__); | 144 | pr_info(" %s ", __func__); |
| 143 | for (i = 0; i < ST_MAX_CHANNELS; i++) { | 145 | for (i = 0; i < ST_MAX_CHANNELS; i++) { |
| 144 | if (likely(st_gdata != NULL && st_gdata->list[i] != NULL && | 146 | if (likely(st_gdata != NULL && |
| 145 | st_gdata->list[i]->reg_complete_cb != NULL)) { | 147 | st_gdata->is_registered[i] == true && |
| 148 | st_gdata->list[i]->reg_complete_cb != NULL)) { | ||
| 146 | st_gdata->list[i]->reg_complete_cb | 149 | st_gdata->list[i]->reg_complete_cb |
| 147 | (st_gdata->list[i]->priv_data, err); | 150 | (st_gdata->list[i]->priv_data, err); |
| 148 | pr_info("protocol %d's cb sent %d\n", i, err); | 151 | pr_info("protocol %d's cb sent %d\n", i, err); |
| 149 | if (err) { /* cleanup registered protocol */ | 152 | if (err) { /* cleanup registered protocol */ |
| 150 | st_gdata->protos_registered--; | 153 | st_gdata->protos_registered--; |
| 151 | st_gdata->list[i] = NULL; | 154 | st_gdata->is_registered[i] = false; |
| 152 | } | 155 | } |
| 153 | } | 156 | } |
| 154 | } | 157 | } |
| @@ -475,9 +478,9 @@ void kim_st_list_protocols(struct st_data_s *st_gdata, void *buf) | |||
| 475 | { | 478 | { |
| 476 | seq_printf(buf, "[%d]\nBT=%c\nFM=%c\nGPS=%c\n", | 479 | seq_printf(buf, "[%d]\nBT=%c\nFM=%c\nGPS=%c\n", |
| 477 | st_gdata->protos_registered, | 480 | st_gdata->protos_registered, |
| 478 | st_gdata->list[0x04] != NULL ? 'R' : 'U', | 481 | st_gdata->is_registered[0x04] == true ? 'R' : 'U', |
| 479 | st_gdata->list[0x08] != NULL ? 'R' : 'U', | 482 | st_gdata->is_registered[0x08] == true ? 'R' : 'U', |
| 480 | st_gdata->list[0x09] != NULL ? 'R' : 'U'); | 483 | st_gdata->is_registered[0x09] == true ? 'R' : 'U'); |
| 481 | } | 484 | } |
| 482 | 485 | ||
| 483 | /********************************************************************/ | 486 | /********************************************************************/ |
| @@ -504,7 +507,7 @@ long st_register(struct st_proto_s *new_proto) | |||
| 504 | return -EPROTONOSUPPORT; | 507 | return -EPROTONOSUPPORT; |
| 505 | } | 508 | } |
| 506 | 509 | ||
| 507 | if (st_gdata->list[new_proto->chnl_id] != NULL) { | 510 | if (st_gdata->is_registered[new_proto->chnl_id] == true) { |
| 508 | pr_err("chnl_id %d already registered", new_proto->chnl_id); | 511 | pr_err("chnl_id %d already registered", new_proto->chnl_id); |
| 509 | return -EALREADY; | 512 | return -EALREADY; |
| 510 | } | 513 | } |
| @@ -563,7 +566,7 @@ long st_register(struct st_proto_s *new_proto) | |||
| 563 | /* check for already registered once more, | 566 | /* check for already registered once more, |
| 564 | * since the above check is old | 567 | * since the above check is old |
| 565 | */ | 568 | */ |
| 566 | if (st_gdata->list[new_proto->chnl_id] != NULL) { | 569 | if (st_gdata->is_registered[new_proto->chnl_id] == true) { |
| 567 | pr_err(" proto %d already registered ", | 570 | pr_err(" proto %d already registered ", |
| 568 | new_proto->chnl_id); | 571 | new_proto->chnl_id); |
| 569 | return -EALREADY; | 572 | return -EALREADY; |
