static int __init omap3beagle_soc_init(void) { int ret; if (!(machine_is_omap3_beagle() || machine_is_devkit8000())) return -ENODEV; pr_info("OMAP3 Beagle/Devkit8000 SoC init\n"); omap3beagle_snd_device = platform_device_alloc("soc-audio", -1); if (!omap3beagle_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } platform_set_drvdata(omap3beagle_snd_device, &snd_soc_omap3beagle); ret = platform_device_add(omap3beagle_snd_device); if (ret) goto err1; return 0; err1: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(omap3beagle_snd_device); return ret; }
static int __init omap3beagle_soc_init(void) { int ret; if (!(machine_is_omap3_beagle() || machine_is_devkit8000())) { pr_debug("Not OMAP3 Beagle or Devkit8000!\n"); return -ENODEV; } pr_info("OMAP3 Beagle/Devkit8000 SoC init\n"); omap3beagle_snd_device = platform_device_alloc("soc-audio", -1); if (!omap3beagle_snd_device) { printk(KERN_ERR "Platform device allocation failed\n"); return -ENOMEM; } platform_set_drvdata(omap3beagle_snd_device, &omap3beagle_snd_devdata); omap3beagle_snd_devdata.dev = &omap3beagle_snd_device->dev; *(unsigned int *)omap3beagle_dai.cpu_dai->private_data = 1; /* McBSP2 */ ret = platform_device_add(omap3beagle_snd_device); if (ret) goto err1; return 0; err1: printk(KERN_ERR "Unable to add platform device\n"); platform_device_put(omap3beagle_snd_device); return ret; }