NFC: st21nfcb: Move powered flag from phy to ndlc layer
The powered flag can be set from the ndlc_open and ndlc_close layer.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
diff --git a/drivers/nfc/st21nfcb/i2c.c b/drivers/nfc/st21nfcb/i2c.c
index c44f8cf..41b5bdb 100644
--- a/drivers/nfc/st21nfcb/i2c.c
+++ b/drivers/nfc/st21nfcb/i2c.c
@@ -52,8 +52,6 @@
unsigned int gpio_reset;
unsigned int irq_polarity;
-
- int powered;
};
#define I2C_DUMP_SKB(info, skb) \
@@ -70,7 +68,6 @@
gpio_set_value(phy->gpio_reset, 0);
usleep_range(10000, 15000);
gpio_set_value(phy->gpio_reset, 1);
- phy->powered = 1;
usleep_range(80000, 85000);
return 0;
@@ -80,7 +77,6 @@
{
struct st21nfcb_i2c_phy *phy = phy_id;
- phy->powered = 0;
/* reset chip in order to flush clf */
gpio_set_value(phy->gpio_reset, 0);
usleep_range(10000, 15000);
@@ -203,7 +199,7 @@
if (phy->ndlc->hard_fault)
return IRQ_HANDLED;
- if (!phy->powered) {
+ if (!phy->ndlc->powered) {
st21nfcb_nci_i2c_disable(phy);
return IRQ_HANDLED;
}