tpm/st33zp24: Switch to devm_acpi_dev_add_driver_gpios()
PATCH 1/1 tpm/st33zp24: Switch to devm_acpi_dev_add_driver_gpios()
Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify error path and fix potentially wrong assignment if ->probe() fails.
--- drivers/char/tpm/st33zp24/i2c.c | 3 +-- drivers/char/tpm/st33zp24/spi.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/char/tpm/st33zp24/i2c.c +1 -2
@@ -127,7 +127,7 @@ static int st33zp24_i2c_acpi_request_resources(struct i2c_client *client)struct device *dev = &client->dev;int ret; - ret =acpi_dev_add_driver_gpios (ACPI_COMPANION (dev), acpi_st33zp24_gpios); + ret =devm_acpi_dev_add_driver_gpios (dev, acpi_st33zp24_gpios);if (ret)return ret;
@@ -285,7 +285,6 @@ static int st33zp24_i2c_remove(struct i2c_client *client)if (ret)return ret; -acpi_dev_remove_driver_gpios (ACPI_COMPANION (&client->dev));return 0 ; }
drivers/char/tpm/st33zp24/spi.c +1 -2
@@ -246,7 +246,7 @@ static int st33zp24_spi_acpi_request_resources(struct spi_device *spi_dev)struct device *dev = &spi_dev->dev;int ret; - ret =acpi_dev_add_driver_gpios (ACPI_COMPANION (dev), acpi_st33zp24_gpios); + ret =devm_acpi_dev_add_driver_gpios (dev, acpi_st33zp24_gpios);if (ret)return ret;
@@ -402,7 +402,6 @@ static int st33zp24_spi_remove(struct spi_device *dev)if (ret)return ret; -acpi_dev_remove_driver_gpios (ACPI_COMPANION (&dev->dev));return 0 ; }
Signature · 6 lines
2.11.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
A message that is not in the archive (sent off-list or not yet received): 20170612154416.82847-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/[email protected]
Quoted 1 line · Andy Shevchenko
Switch to use managed variant of
acpi_dev_add_driver_gpios()to
simplify
Quoted 3 lines
error path and fix potentially wrong assignment if ->probe() fails.
Signed-off-by Andy Shevchenko <[email protected]>
(compilation)
/Jarkko
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel