From: Tomas Winkler Date: Wed, 19 Oct 2016 13:33:30 +0000 (+0300) Subject: nfc: mei_phy: get phy from the driver data X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=972cedf6e39a49a79a66cd7f46132d21369d0083;p=linux-beck.git nfc: mei_phy: get phy from the driver data 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c index 83deda4bb4d6..66dfd81ffb18 100644 --- a/drivers/nfc/mei_phy.c +++ b/drivers/nfc/mei_phy.c @@ -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;