diff options
Diffstat (limited to 'net/nfc/netlink.c')
| -rw-r--r-- | net/nfc/netlink.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index 84b7e3ea7b7a..a9b2342d5253 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c | |||
| @@ -30,8 +30,8 @@ | |||
| 30 | #include "nfc.h" | 30 | #include "nfc.h" |
| 31 | #include "llcp.h" | 31 | #include "llcp.h" |
| 32 | 32 | ||
| 33 | static struct genl_multicast_group nfc_genl_event_mcgrp = { | 33 | static const struct genl_multicast_group nfc_genl_mcgrps[] = { |
| 34 | .name = NFC_GENL_MCAST_EVENT_NAME, | 34 | { .name = NFC_GENL_MCAST_EVENT_NAME, }, |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | static struct genl_family nfc_genl_family = { | 37 | static struct genl_family nfc_genl_family = { |
| @@ -194,7 +194,7 @@ int nfc_genl_targets_found(struct nfc_dev *dev) | |||
| 194 | 194 | ||
| 195 | genlmsg_end(msg, hdr); | 195 | genlmsg_end(msg, hdr); |
| 196 | 196 | ||
| 197 | return genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_ATOMIC); | 197 | return genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); |
| 198 | 198 | ||
| 199 | nla_put_failure: | 199 | nla_put_failure: |
| 200 | genlmsg_cancel(msg, hdr); | 200 | genlmsg_cancel(msg, hdr); |
| @@ -223,7 +223,7 @@ int nfc_genl_target_lost(struct nfc_dev *dev, u32 target_idx) | |||
| 223 | 223 | ||
| 224 | genlmsg_end(msg, hdr); | 224 | genlmsg_end(msg, hdr); |
| 225 | 225 | ||
| 226 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL); | 226 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); |
| 227 | 227 | ||
| 228 | return 0; | 228 | return 0; |
| 229 | 229 | ||
| @@ -255,7 +255,7 @@ int nfc_genl_tm_activated(struct nfc_dev *dev, u32 protocol) | |||
| 255 | 255 | ||
| 256 | genlmsg_end(msg, hdr); | 256 | genlmsg_end(msg, hdr); |
| 257 | 257 | ||
| 258 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL); | 258 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); |
| 259 | 259 | ||
| 260 | return 0; | 260 | return 0; |
| 261 | 261 | ||
| @@ -285,7 +285,7 @@ int nfc_genl_tm_deactivated(struct nfc_dev *dev) | |||
| 285 | 285 | ||
| 286 | genlmsg_end(msg, hdr); | 286 | genlmsg_end(msg, hdr); |
| 287 | 287 | ||
| 288 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL); | 288 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); |
| 289 | 289 | ||
| 290 | return 0; | 290 | return 0; |
| 291 | 291 | ||
| @@ -318,7 +318,7 @@ int nfc_genl_device_added(struct nfc_dev *dev) | |||
| 318 | 318 | ||
| 319 | genlmsg_end(msg, hdr); | 319 | genlmsg_end(msg, hdr); |
| 320 | 320 | ||
| 321 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL); | 321 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); |
| 322 | 322 | ||
| 323 | return 0; | 323 | return 0; |
| 324 | 324 | ||
| @@ -348,7 +348,7 @@ int nfc_genl_device_removed(struct nfc_dev *dev) | |||
| 348 | 348 | ||
| 349 | genlmsg_end(msg, hdr); | 349 | genlmsg_end(msg, hdr); |
| 350 | 350 | ||
| 351 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL); | 351 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); |
| 352 | 352 | ||
| 353 | return 0; | 353 | return 0; |
| 354 | 354 | ||
| @@ -414,7 +414,7 @@ int nfc_genl_llc_send_sdres(struct nfc_dev *dev, struct hlist_head *sdres_list) | |||
| 414 | 414 | ||
| 415 | genlmsg_end(msg, hdr); | 415 | genlmsg_end(msg, hdr); |
| 416 | 416 | ||
| 417 | return genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_ATOMIC); | 417 | return genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); |
| 418 | 418 | ||
| 419 | nla_put_failure: | 419 | nla_put_failure: |
| 420 | genlmsg_cancel(msg, hdr); | 420 | genlmsg_cancel(msg, hdr); |
| @@ -448,7 +448,7 @@ int nfc_genl_se_added(struct nfc_dev *dev, u32 se_idx, u16 type) | |||
| 448 | 448 | ||
| 449 | genlmsg_end(msg, hdr); | 449 | genlmsg_end(msg, hdr); |
| 450 | 450 | ||
| 451 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL); | 451 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); |
| 452 | 452 | ||
| 453 | return 0; | 453 | return 0; |
| 454 | 454 | ||
| @@ -479,7 +479,7 @@ int nfc_genl_se_removed(struct nfc_dev *dev, u32 se_idx) | |||
| 479 | 479 | ||
| 480 | genlmsg_end(msg, hdr); | 480 | genlmsg_end(msg, hdr); |
| 481 | 481 | ||
| 482 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL); | 482 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); |
| 483 | 483 | ||
| 484 | return 0; | 484 | return 0; |
| 485 | 485 | ||
| @@ -600,7 +600,7 @@ int nfc_genl_dep_link_up_event(struct nfc_dev *dev, u32 target_idx, | |||
| 600 | 600 | ||
| 601 | dev->dep_link_up = true; | 601 | dev->dep_link_up = true; |
| 602 | 602 | ||
| 603 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_ATOMIC); | 603 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); |
| 604 | 604 | ||
| 605 | return 0; | 605 | return 0; |
| 606 | 606 | ||
| @@ -632,7 +632,7 @@ int nfc_genl_dep_link_down_event(struct nfc_dev *dev) | |||
| 632 | 632 | ||
| 633 | genlmsg_end(msg, hdr); | 633 | genlmsg_end(msg, hdr); |
| 634 | 634 | ||
| 635 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_ATOMIC); | 635 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); |
| 636 | 636 | ||
| 637 | return 0; | 637 | return 0; |
| 638 | 638 | ||
| @@ -1137,7 +1137,7 @@ int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name, | |||
| 1137 | 1137 | ||
| 1138 | genlmsg_end(msg, hdr); | 1138 | genlmsg_end(msg, hdr); |
| 1139 | 1139 | ||
| 1140 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL); | 1140 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); |
| 1141 | 1141 | ||
| 1142 | return 0; | 1142 | return 0; |
| 1143 | 1143 | ||
| @@ -1308,7 +1308,7 @@ static void se_io_cb(void *context, u8 *apdu, size_t apdu_len, int err) | |||
| 1308 | 1308 | ||
| 1309 | genlmsg_end(msg, hdr); | 1309 | genlmsg_end(msg, hdr); |
| 1310 | 1310 | ||
| 1311 | genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL); | 1311 | genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); |
| 1312 | 1312 | ||
| 1313 | kfree(ctx); | 1313 | kfree(ctx); |
| 1314 | 1314 | ||
| @@ -1364,7 +1364,7 @@ static int nfc_genl_se_io(struct sk_buff *skb, struct genl_info *info) | |||
| 1364 | return dev->ops->se_io(dev, se_idx, apdu, apdu_len, se_io_cb, ctx); | 1364 | return dev->ops->se_io(dev, se_idx, apdu, apdu_len, se_io_cb, ctx); |
| 1365 | } | 1365 | } |
| 1366 | 1366 | ||
| 1367 | static struct genl_ops nfc_genl_ops[] = { | 1367 | static const struct genl_ops nfc_genl_ops[] = { |
| 1368 | { | 1368 | { |
| 1369 | .cmd = NFC_CMD_GET_DEVICE, | 1369 | .cmd = NFC_CMD_GET_DEVICE, |
| 1370 | .doit = nfc_genl_get_device, | 1370 | .doit = nfc_genl_get_device, |
| @@ -1536,16 +1536,15 @@ int __init nfc_genl_init(void) | |||
| 1536 | { | 1536 | { |
| 1537 | int rc; | 1537 | int rc; |
| 1538 | 1538 | ||
| 1539 | rc = genl_register_family_with_ops(&nfc_genl_family, nfc_genl_ops, | 1539 | rc = genl_register_family_with_ops_groups(&nfc_genl_family, |
| 1540 | ARRAY_SIZE(nfc_genl_ops)); | 1540 | nfc_genl_ops, |
| 1541 | nfc_genl_mcgrps); | ||
| 1541 | if (rc) | 1542 | if (rc) |
| 1542 | return rc; | 1543 | return rc; |
| 1543 | 1544 | ||
| 1544 | rc = genl_register_mc_group(&nfc_genl_family, &nfc_genl_event_mcgrp); | ||
| 1545 | |||
| 1546 | netlink_register_notifier(&nl_notifier); | 1545 | netlink_register_notifier(&nl_notifier); |
| 1547 | 1546 | ||
| 1548 | return rc; | 1547 | return 0; |
| 1549 | } | 1548 | } |
| 1550 | 1549 | ||
| 1551 | /** | 1550 | /** |
