Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352862
b: refs/heads/master
c: 1fbc5e9
h: refs/heads/master
v: v3
  • Loading branch information
Kent Yoder committed Feb 5, 2013
1 parent 7821af2 commit 67b2fd2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d459335381eca1cb91fefb87021d3d172342e55a
refs/heads/master: 1fbc5e95356a4600fab3a04a82dc8bb49591aedd
16 changes: 11 additions & 5 deletions trunk/drivers/char/tpm/tpm_i2c_stm_st33.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,8 @@ tpm_st33_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
err = 0;

if (client == NULL) {
dev_info(&client->dev, "client is NULL. exiting.\n");
pr_info("%s: i2c client is NULL. Device not accessible.\n",
__func__);
err = -ENODEV;
goto end;
}
Expand All @@ -677,6 +678,13 @@ tpm_st33_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
}

platform_data = client->dev.platform_data;

if (!platform_data) {
dev_info(&client->dev, "chip not available\n");
err = -ENODEV;
goto _tpm_clean_answer;
}

platform_data->tpm_i2c_buffer[0] =
kmalloc(TPM_BUFSIZE * sizeof(u8), GFP_KERNEL);
if (platform_data->tpm_i2c_buffer[0] == NULL) {
Expand Down Expand Up @@ -759,7 +767,6 @@ tpm_st33_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
tpm_get_timeouts(chip);

i2c_set_clientdata(client, chip);
platform_data->bChipF = false;

dev_info(chip->dev, "TPM I2C Initialized\n");
return 0;
Expand All @@ -779,7 +786,6 @@ tpm_st33_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
platform_data->tpm_i2c_buffer[0] = NULL;
_tpm_clean_answer:
tpm_remove_hardware(chip->dev);
platform_data->bChipF = true;
end:
pr_info("TPM I2C initialisation fail\n");
return err;
Expand All @@ -803,8 +809,8 @@ static __devexit int tpm_st33_i2c_remove(struct i2c_client *client)
gpio_free(pin_infos->io_serirq);
gpio_free(pin_infos->io_lpcpd);

if (pin_infos->bChipF != true)
tpm_remove_hardware(chip->dev);
tpm_remove_hardware(chip->dev);

if (pin_infos->tpm_i2c_buffer[1] != NULL) {
kzfree(pin_infos->tpm_i2c_buffer[1]);
pin_infos->tpm_i2c_buffer[1] = NULL;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/char/tpm/tpm_i2c_stm_st33.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ struct st33zp24_platform_data {
int io_serirq;
int io_lpcpd;
struct i2c_client *client;
bool bChipF;
u8 *tpm_i2c_buffer[2]; /* 0 Request 1 Response */
struct completion irq_detection;
struct mutex lock;
Expand Down

0 comments on commit 67b2fd2

Please sign in to comment.