]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
nfc: mei_phy: get phy from the driver data
authorTomas Winkler <tomas.winkler@intel.com>
Wed, 19 Oct 2016 13:33:30 +0000 (16:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Oct 2016 12:21:22 +0000 (08:21 -0400)
In order to remove rather redundant context from the callback
signature we the get nfc mei_phy from the driver's data.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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;