aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/netlink.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-03-04 19:03:50 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-03-06 15:16:23 -0500
commit47807d3dbb62e93850cbcb797db1a9ee1806f986 (patch)
treef8e1970083547290e35830e5bedb4a4ce7237f97 /net/nfc/netlink.c
parent9dda50f4c98f84e32a5f6dc4d9dd7af6085add43 (diff)
NFC: Remove the rf mode parameter from the DEP link up routine
When calling nfc_dep_link_up, we implicitely are in initiator mode. Which means we also can provide the general bytes as a function argument, as all drivers will eventually request them. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc/netlink.c')
-rw-r--r--net/nfc/netlink.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index a1388e4efd6..fa620d03799 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -542,13 +542,12 @@ static int nfc_genl_dep_link_up(struct sk_buff *skb, struct genl_info *info)
542 struct nfc_dev *dev; 542 struct nfc_dev *dev;
543 int rc, tgt_idx; 543 int rc, tgt_idx;
544 u32 idx; 544 u32 idx;
545 u8 comm, rf; 545 u8 comm;
546 546
547 pr_debug("DEP link up\n"); 547 pr_debug("DEP link up\n");
548 548
549 if (!info->attrs[NFC_ATTR_DEVICE_INDEX] || 549 if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
550 !info->attrs[NFC_ATTR_COMM_MODE] || 550 !info->attrs[NFC_ATTR_COMM_MODE])
551 !info->attrs[NFC_ATTR_RF_MODE])
552 return -EINVAL; 551 return -EINVAL;
553 552
554 idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]); 553 idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]);
@@ -558,19 +557,15 @@ static int nfc_genl_dep_link_up(struct sk_buff *skb, struct genl_info *info)
558 tgt_idx = nla_get_u32(info->attrs[NFC_ATTR_TARGET_INDEX]); 557 tgt_idx = nla_get_u32(info->attrs[NFC_ATTR_TARGET_INDEX]);
559 558
560 comm = nla_get_u8(info->attrs[NFC_ATTR_COMM_MODE]); 559 comm = nla_get_u8(info->attrs[NFC_ATTR_COMM_MODE]);
561 rf = nla_get_u8(info->attrs[NFC_ATTR_RF_MODE]);
562 560
563 if (comm != NFC_COMM_ACTIVE && comm != NFC_COMM_PASSIVE) 561 if (comm != NFC_COMM_ACTIVE && comm != NFC_COMM_PASSIVE)
564 return -EINVAL; 562 return -EINVAL;
565 563
566 if (rf != NFC_RF_INITIATOR && comm != NFC_RF_TARGET)
567 return -EINVAL;
568
569 dev = nfc_get_device(idx); 564 dev = nfc_get_device(idx);
570 if (!dev) 565 if (!dev)
571 return -ENODEV; 566 return -ENODEV;
572 567
573 rc = nfc_dep_link_up(dev, tgt_idx, comm, rf); 568 rc = nfc_dep_link_up(dev, tgt_idx, comm);
574 569
575 nfc_put_device(dev); 570 nfc_put_device(dev);
576 571