Commit 4c62c208 authored by Christophe Ricard's avatar Christophe Ricard Committed by Samuel Ortiz

nfc: st-nci: Add macro for gpio name

Add macro definition for each gpio string for an easier code
maintenance.
Signed-off-by: default avatarChristophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 39db2d21
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#define ST_NCI_I2C_DRIVER_NAME "st_nci_i2c" #define ST_NCI_I2C_DRIVER_NAME "st_nci_i2c"
#define ST_NCI_GPIO_NAME_RESET "clf_reset"
struct st_nci_i2c_phy { struct st_nci_i2c_phy {
struct i2c_client *i2c_dev; struct i2c_client *i2c_dev;
...@@ -226,7 +227,7 @@ static int st_nci_i2c_of_request_resources(struct i2c_client *client) ...@@ -226,7 +227,7 @@ static int st_nci_i2c_of_request_resources(struct i2c_client *client)
/* GPIO request and configuration */ /* GPIO request and configuration */
r = devm_gpio_request_one(&client->dev, gpio, r = devm_gpio_request_one(&client->dev, gpio,
GPIOF_OUT_INIT_HIGH, "clf_reset"); GPIOF_OUT_INIT_HIGH, ST_NCI_GPIO_NAME_RESET);
if (r) { if (r) {
nfc_err(&client->dev, "Failed to request reset pin\n"); nfc_err(&client->dev, "Failed to request reset pin\n");
return r; return r;
...@@ -260,7 +261,8 @@ static int st_nci_i2c_request_resources(struct i2c_client *client) ...@@ -260,7 +261,8 @@ static int st_nci_i2c_request_resources(struct i2c_client *client)
phy->irq_polarity = pdata->irq_polarity; phy->irq_polarity = pdata->irq_polarity;
r = devm_gpio_request_one(&client->dev, r = devm_gpio_request_one(&client->dev,
phy->gpio_reset, GPIOF_OUT_INIT_HIGH, "clf_reset"); phy->gpio_reset, GPIOF_OUT_INIT_HIGH,
ST_NCI_GPIO_NAME_RESET);
if (r) { if (r) {
pr_err("%s : reset gpio_request failed\n", __FILE__); pr_err("%s : reset gpio_request failed\n", __FILE__);
return r; return r;
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#define ST_NCI_SPI_DRIVER_NAME "st_nci_spi" #define ST_NCI_SPI_DRIVER_NAME "st_nci_spi"
#define ST_NCI_GPIO_NAME_RESET "clf_reset"
struct st_nci_spi_phy { struct st_nci_spi_phy {
struct spi_device *spi_dev; struct spi_device *spi_dev;
struct llt_ndlc *ndlc; struct llt_ndlc *ndlc;
...@@ -240,7 +242,7 @@ static int st_nci_spi_of_request_resources(struct spi_device *dev) ...@@ -240,7 +242,7 @@ static int st_nci_spi_of_request_resources(struct spi_device *dev)
/* GPIO request and configuration */ /* GPIO request and configuration */
r = devm_gpio_request_one(&dev->dev, gpio, r = devm_gpio_request_one(&dev->dev, gpio,
GPIOF_OUT_INIT_HIGH, "clf_reset"); GPIOF_OUT_INIT_HIGH, ST_NCI_GPIO_NAME_RESET);
if (r) { if (r) {
nfc_err(&dev->dev, "Failed to request reset pin\n"); nfc_err(&dev->dev, "Failed to request reset pin\n");
return r; return r;
...@@ -274,7 +276,8 @@ static int st_nci_spi_request_resources(struct spi_device *dev) ...@@ -274,7 +276,8 @@ static int st_nci_spi_request_resources(struct spi_device *dev)
phy->irq_polarity = pdata->irq_polarity; phy->irq_polarity = pdata->irq_polarity;
r = devm_gpio_request_one(&dev->dev, r = devm_gpio_request_one(&dev->dev,
phy->gpio_reset, GPIOF_OUT_INIT_HIGH, "clf_reset"); phy->gpio_reset, GPIOF_OUT_INIT_HIGH,
ST_NCI_GPIO_NAME_RESET);
if (r) { if (r) {
pr_err("%s : reset gpio_request failed\n", __FILE__); pr_err("%s : reset gpio_request failed\n", __FILE__);
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment