]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/nfc/mei_phy.c
nfc: mei_phy: get phy from the driver data
[karo-tx-linux.git] / drivers / nfc / mei_phy.c
index 83deda4bb4d6d52d4b529b71712f71114aac1445..66dfd81ffb1800dc973235a4a71b8ec5f573cdde 100644 (file)
@@ -300,7 +300,10 @@ static int mei_nfc_recv(struct nfc_mei_phy *phy, u8 *buf, size_t length)
 static void nfc_mei_event_cb(struct mei_cl_device *cldev, u32 events,
                             void *context)
 {
-       struct nfc_mei_phy *phy = context;
+       struct nfc_mei_phy *phy = mei_cldev_get_drvdata(cldev);
+
+       if (!phy)
+               return;
 
        if (phy->hard_fault != 0)
                return;