Skip to content

Commit 3240740

Browse files
cricard13Jarkko Sakkinen
authored andcommitted
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>
1 parent 3f94407 commit 3240740

File tree

1 file changed

+1
-12
lines changed
  • drivers/char/tpm/st33zp24

1 file changed

+1
-12
lines changed

drivers/char/tpm/st33zp24/i2c.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,8 @@ static const struct st33zp24_phy_ops i2c_phy_ops = {
113113
static int st33zp24_i2c_acpi_request_resources(struct i2c_client *client)
114114
{
115115
struct st33zp24_i2c_phy *phy = i2c_get_clientdata(client);
116-
const struct acpi_device_id *id;
117116
struct gpio_desc *gpiod_lpcpd;
118-
struct device *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;
117+
struct device *dev = &client->dev;
129118

130119
/* Get LPCPD GPIO from ACPI */
131120
gpiod_lpcpd = devm_gpiod_get_index(dev, "TPM IO LPCPD", 1,

0 commit comments

Comments
 (0)