Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: pn544: Drop two useless checks in ACPI probe path

When pn544_hci_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: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Mika Westerberg and committed by
Samuel Ortiz
dd215430 03c05355

+1 -13
+1 -13
drivers/nfc/pn544/i2c.c
··· 877 877 static int pn544_hci_i2c_acpi_request_resources(struct i2c_client *client) 878 878 { 879 879 struct pn544_i2c_phy *phy = i2c_get_clientdata(client); 880 - const struct acpi_device_id *id; 881 880 struct gpio_desc *gpiod_en, *gpiod_fw; 882 - struct device *dev; 883 - 884 - if (!client) 885 - return -EINVAL; 886 - 887 - dev = &client->dev; 888 - 889 - /* Match the struct device against a given list of ACPI IDs */ 890 - id = acpi_match_device(dev->driver->acpi_match_table, dev); 891 - 892 - if (!id) 893 - return -ENODEV; 881 + struct device *dev = &client->dev; 894 882 895 883 /* Get EN GPIO from ACPI */ 896 884 gpiod_en = devm_gpiod_get_index(dev, PN544_GPIO_NAME_EN, 1,