diff options
Diffstat (limited to 'drivers/misc/mic/scif/scif_api.c')
-rw-r--r-- | drivers/misc/mic/scif/scif_api.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/misc/mic/scif/scif_api.c b/drivers/misc/mic/scif/scif_api.c index bf2d70fcd055..b47d56d5d93c 100644 --- a/drivers/misc/mic/scif/scif_api.c +++ b/drivers/misc/mic/scif/scif_api.c | |||
@@ -1430,3 +1430,46 @@ int scif_get_node_ids(u16 *nodes, int len, u16 *self) | |||
1430 | return online; | 1430 | return online; |
1431 | } | 1431 | } |
1432 | EXPORT_SYMBOL_GPL(scif_get_node_ids); | 1432 | EXPORT_SYMBOL_GPL(scif_get_node_ids); |
1433 | |||
1434 | static int scif_add_client_dev(struct device *dev, struct subsys_interface *si) | ||
1435 | { | ||
1436 | struct scif_client *client = | ||
1437 | container_of(si, struct scif_client, si); | ||
1438 | struct scif_peer_dev *spdev = | ||
1439 | container_of(dev, struct scif_peer_dev, dev); | ||
1440 | |||
1441 | if (client->probe) | ||
1442 | client->probe(spdev); | ||
1443 | return 0; | ||
1444 | } | ||
1445 | |||
1446 | static void scif_remove_client_dev(struct device *dev, | ||
1447 | struct subsys_interface *si) | ||
1448 | { | ||
1449 | struct scif_client *client = | ||
1450 | container_of(si, struct scif_client, si); | ||
1451 | struct scif_peer_dev *spdev = | ||
1452 | container_of(dev, struct scif_peer_dev, dev); | ||
1453 | |||
1454 | if (client->remove) | ||
1455 | client->remove(spdev); | ||
1456 | } | ||
1457 | |||
1458 | void scif_client_unregister(struct scif_client *client) | ||
1459 | { | ||
1460 | subsys_interface_unregister(&client->si); | ||
1461 | } | ||
1462 | EXPORT_SYMBOL_GPL(scif_client_unregister); | ||
1463 | |||
1464 | int scif_client_register(struct scif_client *client) | ||
1465 | { | ||
1466 | struct subsys_interface *si = &client->si; | ||
1467 | |||
1468 | si->name = client->name; | ||
1469 | si->subsys = &scif_peer_bus; | ||
1470 | si->add_dev = scif_add_client_dev; | ||
1471 | si->remove_dev = scif_remove_client_dev; | ||
1472 | |||
1473 | return subsys_interface_register(&client->si); | ||
1474 | } | ||
1475 | EXPORT_SYMBOL_GPL(scif_client_register); | ||