staging: bcm2835-audio: Register bcm2835-audio with vchiq_bus_type
[sfrench/cifs-2.6.git] / drivers / staging / vc04_services / interface / vchiq_arm / vchiq_arm.c
index 886025f0a4528fb92556ec021a04bf11bb00da81..eef9c8c06e66d763518e3f6116540519c6139a23 100644 (file)
@@ -67,12 +67,12 @@ int vchiq_susp_log_level = VCHIQ_LOG_ERROR;
 DEFINE_SPINLOCK(msg_queue_spinlock);
 struct vchiq_state g_state;
 
-static struct platform_device *bcm2835_audio;
 /*
  * The devices implemented in the VCHIQ firmware are not discoverable,
  * so we need to maintain a list of them in order to register them with
  * the interface.
  */
+static struct vchiq_device *bcm2835_audio;
 static struct vchiq_device *bcm2835_camera;
 
 struct vchiq_drvdata {
@@ -1776,28 +1776,6 @@ static const struct of_device_id vchiq_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, vchiq_of_match);
 
-static struct platform_device *
-vchiq_register_child(struct platform_device *pdev, const char *name)
-{
-       struct platform_device_info pdevinfo;
-       struct platform_device *child;
-
-       memset(&pdevinfo, 0, sizeof(pdevinfo));
-
-       pdevinfo.parent = &pdev->dev;
-       pdevinfo.name = name;
-       pdevinfo.id = PLATFORM_DEVID_NONE;
-       pdevinfo.dma_mask = DMA_BIT_MASK(32);
-
-       child = platform_device_register_full(&pdevinfo);
-       if (IS_ERR(child)) {
-               dev_warn(&pdev->dev, "%s not registered\n", name);
-               child = NULL;
-       }
-
-       return child;
-}
-
 static int vchiq_probe(struct platform_device *pdev)
 {
        struct device_node *fw_node;
@@ -1845,7 +1823,7 @@ static int vchiq_probe(struct platform_device *pdev)
                goto error_exit;
        }
 
-       bcm2835_audio = vchiq_register_child(pdev, "bcm2835_audio");
+       bcm2835_audio = vchiq_device_register(&pdev->dev, "bcm2835-audio");
        bcm2835_camera = vchiq_device_register(&pdev->dev, "bcm2835-camera");
 
        return 0;
@@ -1858,7 +1836,7 @@ error_exit:
 
 static void vchiq_remove(struct platform_device *pdev)
 {
-       platform_device_unregister(bcm2835_audio);
+       vchiq_device_unregister(bcm2835_audio);
        vchiq_device_unregister(bcm2835_camera);
        vchiq_debugfs_deinit();
        vchiq_deregister_chrdev();