NFC: Switch to Initiator mode when getting NFC_ATTR_PROTOCOLS
authorSamuel Ortiz <sameo@linux.intel.com>
Thu, 31 May 2012 09:48:58 +0000 (11:48 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 4 Jun 2012 19:34:33 +0000 (21:34 +0200)
That is needed for keeping backward compatibility with apps using the old
netlink polling API (NFC_ATTR_PROTOCOLS instead of NFC_ATTR_IM_PROTOCOLS).

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/netlink.c

index 21eaa9b5c6bfae470d3b9dadd8e645735947e781..03c31db38f1284dbceed6cb57a97ab8ec0bd13ab 100644 (file)
@@ -597,11 +597,11 @@ static int nfc_genl_start_poll(struct sk_buff *skb, struct genl_info *info)
 
        if (info->attrs[NFC_ATTR_TM_PROTOCOLS])
                tm_protocols = nla_get_u32(info->attrs[NFC_ATTR_TM_PROTOCOLS]);
-       else if (info->attrs[NFC_ATTR_PROTOCOLS])
-               tm_protocols = nla_get_u32(info->attrs[NFC_ATTR_PROTOCOLS]);
 
        if (info->attrs[NFC_ATTR_IM_PROTOCOLS])
                im_protocols = nla_get_u32(info->attrs[NFC_ATTR_IM_PROTOCOLS]);
+       else if (info->attrs[NFC_ATTR_PROTOCOLS])
+               im_protocols = nla_get_u32(info->attrs[NFC_ATTR_PROTOCOLS]);
 
        dev = nfc_get_device(idx);
        if (!dev)
This page took 0.025574 seconds and 5 git commands to generate.