diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2016-03-23 03:55:32 -0400 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2016-06-25 10:26:35 -0400 |
commit | 32da5633dcb9115d477f1ce8893ac4da087f56da (patch) | |
tree | a911c3c19768a12e1ffe0c3cb2d7f9da795cd16c | |
parent | 14ddfbf488a0223b19abf7e4634e6e676a91a12d (diff) |
tpm/st33zp24/i2c: Drop two useless checks in ACPI probe path
When st33zp24_i2c_acpi_request_resources() gets called we
already know that the entries in ->acpi_match_table have matched ACPI ID
of the device.
In addition I2C client pointer cannot be NULL in any case (otherwise I2C
core would not call ->probe() for the driver in the first place).
Drop the two useless checks from the driver.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
-rw-r--r-- | drivers/char/tpm/st33zp24/i2c.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c index f179aadd287e..f8e8123ca61d 100644 --- a/drivers/char/tpm/st33zp24/i2c.c +++ b/drivers/char/tpm/st33zp24/i2c.c | |||
@@ -113,19 +113,8 @@ static const struct st33zp24_phy_ops i2c_phy_ops = { | |||
113 | static int st33zp24_i2c_acpi_request_resources(struct i2c_client *client) | 113 | static int st33zp24_i2c_acpi_request_resources(struct i2c_client *client) |
114 | { | 114 | { |
115 | struct st33zp24_i2c_phy *phy = i2c_get_clientdata(client); | 115 | struct st33zp24_i2c_phy *phy = i2c_get_clientdata(client); |
116 | const struct acpi_device_id *id; | ||
117 | struct gpio_desc *gpiod_lpcpd; | 116 | struct gpio_desc *gpiod_lpcpd; |
118 | struct device *dev; | 117 | struct device *dev = &client->dev; |
119 | |||
120 | if (!client) | ||
121 | return -EINVAL; | ||
122 | |||
123 | dev = &client->dev; | ||
124 | |||
125 | /* Match the struct device against a given list of ACPI IDs */ | ||
126 | id = acpi_match_device(dev->driver->acpi_match_table, dev); | ||
127 | if (!id) | ||
128 | return -ENODEV; | ||
129 | 118 | ||
130 | /* Get LPCPD GPIO from ACPI */ | 119 | /* Get LPCPD GPIO from ACPI */ |
131 | gpiod_lpcpd = devm_gpiod_get_index(dev, "TPM IO LPCPD", 1, | 120 | gpiod_lpcpd = devm_gpiod_get_index(dev, "TPM IO LPCPD", 1, |