Skip to content

Commit d2333d1

Browse files
cricard13Jarkko Sakkinen
authored andcommitted
tpm/st33zp24/spi: Drop two useless checks in ACPI probe path
When st33zp24_spi_acpi_request_resources() gets called we already know that the entries in ->acpi_match_table have matched ACPI ID of the device. In addition spi_device 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 3240740 commit d2333d1

File tree

1 file changed

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

1 file changed

+1
-12
lines changed

drivers/char/tpm/st33zp24/spi.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,8 @@ static const struct st33zp24_phy_ops spi_phy_ops = {
232232
static int st33zp24_spi_acpi_request_resources(struct spi_device *spi_dev)
233233
{
234234
struct st33zp24_spi_phy *phy = spi_get_drvdata(spi_dev);
235-
const struct acpi_device_id *id;
236235
struct gpio_desc *gpiod_lpcpd;
237-
struct device *dev;
238-
239-
if (!spi_dev)
240-
return -EINVAL;
241-
242-
dev = &spi_dev->dev;
243-
244-
/* Match the struct device against a given list of ACPI IDs */
245-
id = acpi_match_device(dev->driver->acpi_match_table, dev);
246-
if (!id)
247-
return -ENODEV;
236+
struct device *dev = &spi_dev->dev;
248237

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

0 commit comments

Comments
 (0)