diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-12-23 23:45:08 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-12-29 19:06:16 +0100 |
commit | 04e99b71fe6e96476884b0e6d50bfe421dee9960 (patch) | |
tree | e36f23ed92ffe2fe80f6a6fbb27bf2427cf242f3 | |
parent | 4c62c208ab777b03b7539f31adb2f2da3b3d0b31 (diff) | |
download | linux-04e99b71fe6e96476884b0e6d50bfe421dee9960.tar.bz2 |
nfc: st21nfca: Add macro for gpio name
Add macro definition for each gpio string for an easier code
maintenance.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/nfc/st21nfca/i2c.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index 0e6f6a87718c..831e20d4da65 100644 --- a/drivers/nfc/st21nfca/i2c.c +++ b/drivers/nfc/st21nfca/i2c.c @@ -60,6 +60,8 @@ #define ST21NFCA_HCI_I2C_DRIVER_NAME "st21nfca_hci_i2c" +#define ST21NFCA_GPIO_NAME_EN "clf_enable" + struct st21nfca_i2c_phy { struct i2c_client *i2c_dev; struct nfc_hci_dev *hdev; @@ -522,7 +524,7 @@ static int st21nfca_hci_i2c_of_request_resources(struct i2c_client *client) /* GPIO request and configuration */ r = devm_gpio_request_one(&client->dev, gpio, GPIOF_OUT_INIT_HIGH, - "clf_enable"); + ST21NFCA_GPIO_NAME_EN); if (r) { nfc_err(&client->dev, "Failed to request enable pin\n"); return r; @@ -558,7 +560,8 @@ static int st21nfca_hci_i2c_request_resources(struct i2c_client *client) if (phy->gpio_ena > 0) { r = devm_gpio_request_one(&client->dev, phy->gpio_ena, - GPIOF_OUT_INIT_HIGH, "clf_enable"); + GPIOF_OUT_INIT_HIGH, + ST21NFCA_GPIO_NAME_EN); if (r) { pr_err("%s : ena gpio_request failed\n", __FILE__); return r; |