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>
This commit is contained in:
Samuel Ortiz
2012-03-05 01:03:50 +01:00
committed by John W. Linville
parent 9dda50f4c9
commit 47807d3dbb
6 changed files with 24 additions and 42 deletions

View File

@@ -542,13 +542,12 @@ static int nfc_genl_dep_link_up(struct sk_buff *skb, struct genl_info *info)
struct nfc_dev *dev;
int rc, tgt_idx;
u32 idx;
u8 comm, rf;
u8 comm;
pr_debug("DEP link up\n");
if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
!info->attrs[NFC_ATTR_COMM_MODE] ||
!info->attrs[NFC_ATTR_RF_MODE])
!info->attrs[NFC_ATTR_COMM_MODE])
return -EINVAL;
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)
tgt_idx = nla_get_u32(info->attrs[NFC_ATTR_TARGET_INDEX]);
comm = nla_get_u8(info->attrs[NFC_ATTR_COMM_MODE]);
rf = nla_get_u8(info->attrs[NFC_ATTR_RF_MODE]);
if (comm != NFC_COMM_ACTIVE && comm != NFC_COMM_PASSIVE)
return -EINVAL;
if (rf != NFC_RF_INITIATOR && comm != NFC_RF_TARGET)
return -EINVAL;
dev = nfc_get_device(idx);
if (!dev)
return -ENODEV;
rc = nfc_dep_link_up(dev, tgt_idx, comm, rf);
rc = nfc_dep_link_up(dev, tgt_idx, comm);
nfc_put_device(dev);