summaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-12-23 17:45:08 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2015-12-29 13:06:16 -0500
commit04e99b71fe6e96476884b0e6d50bfe421dee9960 (patch)
treee36f23ed92ffe2fe80f6a6fbb27bf2427cf242f3 /drivers/nfc
parent4c62c208ab777b03b7539f31adb2f2da3b3d0b31 (diff)
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>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/st21nfca/i2c.c7
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 @@
60 60
61#define ST21NFCA_HCI_I2C_DRIVER_NAME "st21nfca_hci_i2c" 61#define ST21NFCA_HCI_I2C_DRIVER_NAME "st21nfca_hci_i2c"
62 62
63#define ST21NFCA_GPIO_NAME_EN "clf_enable"
64
63struct st21nfca_i2c_phy { 65struct st21nfca_i2c_phy {
64 struct i2c_client *i2c_dev; 66 struct i2c_client *i2c_dev;
65 struct nfc_hci_dev *hdev; 67 struct nfc_hci_dev *hdev;
@@ -522,7 +524,7 @@ static int st21nfca_hci_i2c_of_request_resources(struct i2c_client *client)
522 524
523 /* GPIO request and configuration */ 525 /* GPIO request and configuration */
524 r = devm_gpio_request_one(&client->dev, gpio, GPIOF_OUT_INIT_HIGH, 526 r = devm_gpio_request_one(&client->dev, gpio, GPIOF_OUT_INIT_HIGH,
525 "clf_enable"); 527 ST21NFCA_GPIO_NAME_EN);
526 if (r) { 528 if (r) {
527 nfc_err(&client->dev, "Failed to request enable pin\n"); 529 nfc_err(&client->dev, "Failed to request enable pin\n");
528 return r; 530 return r;
@@ -558,7 +560,8 @@ static int st21nfca_hci_i2c_request_resources(struct i2c_client *client)
558 560
559 if (phy->gpio_ena > 0) { 561 if (phy->gpio_ena > 0) {
560 r = devm_gpio_request_one(&client->dev, phy->gpio_ena, 562 r = devm_gpio_request_one(&client->dev, phy->gpio_ena,
561 GPIOF_OUT_INIT_HIGH, "clf_enable"); 563 GPIOF_OUT_INIT_HIGH,
564 ST21NFCA_GPIO_NAME_EN);
562 if (r) { 565 if (r) {
563 pr_err("%s : ena gpio_request failed\n", __FILE__); 566 pr_err("%s : ena gpio_request failed\n", __FILE__);
564 return r; 567 return r;