From: Arron Wang Date: Thu, 14 Nov 2013 09:03:41 +0000 (+0800) Subject: NFC: Fix target mode p2p link establishment X-Git-Tag: v4.9.8~7170^2~4^2^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d31652a26bc9e752a99b6ac3b61353129934e451;p=platform%2Fkernel%2Flinux-rpi3.git NFC: Fix target mode p2p link establishment With commit e29a9e2ae165620d, we set the active_target pointer from nfc_dep_link_is_up() in order to support the case where the target detection and the DEP link setting are done atomically by the driver. That can only happen in initiator mode, so we need to check for that otherwise we fail to bring a p2p link in target mode. Signed-off-by: Arron Wang Signed-off-by: Samuel Ortiz --- diff --git a/net/nfc/core.c b/net/nfc/core.c index 8725291..83b9927 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c @@ -384,7 +384,7 @@ int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, { dev->dep_link_up = true; - if (!dev->active_target) { + if (!dev->active_target && rf_mode == NFC_RF_INITIATOR) { struct nfc_target *target; target = nfc_find_target(dev, target_idx);