summaryrefslogtreecommitdiffstats
path: root/drivers/nfc/st-nci/spi.c
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-12-23 23:45:07 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2015-12-29 19:06:15 +0100
commit4c62c208ab777b03b7539f31adb2f2da3b3d0b31 (patch)
treee16b4c01b77f8d664f43d0b7782e3d6eedfecf0d /drivers/nfc/st-nci/spi.c
parent39db2d214898baa55db39a54f8644ffc0535fe4a (diff)
downloadop-kernel-dev-4c62c208ab777b03b7539f31adb2f2da3b3d0b31.zip
op-kernel-dev-4c62c208ab777b03b7539f31adb2f2da3b3d0b31.tar.gz
nfc: st-nci: 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/st-nci/spi.c')
-rw-r--r--drivers/nfc/st-nci/spi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c
index c378dd0..7c3684b 100644
--- a/drivers/nfc/st-nci/spi.c
+++ b/drivers/nfc/st-nci/spi.c
@@ -41,6 +41,8 @@
#define ST_NCI_SPI_DRIVER_NAME "st_nci_spi"
+#define ST_NCI_GPIO_NAME_RESET "clf_reset"
+
struct st_nci_spi_phy {
struct spi_device *spi_dev;
struct llt_ndlc *ndlc;
@@ -240,7 +242,7 @@ static int st_nci_spi_of_request_resources(struct spi_device *dev)
/* GPIO request and configuration */
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) {
nfc_err(&dev->dev, "Failed to request reset pin\n");
return r;
@@ -274,7 +276,8 @@ static int st_nci_spi_request_resources(struct spi_device *dev)
phy->irq_polarity = pdata->irq_polarity;
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) {
pr_err("%s : reset gpio_request failed\n", __FILE__);
return r;
OpenPOWER on IntegriCloud