Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965058AbbBJOCn (ORCPT ); Tue, 10 Feb 2015 09:02:43 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:36999 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756229AbbBJN7P (ORCPT ); Tue, 10 Feb 2015 08:59:15 -0500 From: Peter Ujfalusi To: , CC: , Subject: [PATCH 3/7] ARM: davinci: devices-da8xx: Clean up and correct the McASP device creation Date: Tue, 10 Feb 2015 15:58:39 +0200 Message-ID: <1423576723-24375-4-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1423576723-24375-1-git-send-email-peter.ujfalusi@ti.com> References: <1423576723-24375-1-git-send-email-peter.ujfalusi@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1679 Lines: 53 Both DA830 and DA850 has McASP0 module, so do not restrict the use of McASP0 for da850 only. Signed-off-by: Peter Ujfalusi --- arch/arm/mach-davinci/devices-da8xx.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index e15e046c5438..fdc3219ba684 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -526,14 +526,25 @@ static struct platform_device da850_mcasp_device = { void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata) { - /* DA830/OMAP-L137 has 3 instances of McASP */ - if (cpu_is_davinci_da830() && id == 1) { - da830_mcasp1_device.dev.platform_data = pdata; - platform_device_register(&da830_mcasp1_device); - } else if (cpu_is_davinci_da850()) { - da850_mcasp_device.dev.platform_data = pdata; - platform_device_register(&da850_mcasp_device); + struct platform_device *pdev; + + switch (id) { + case 0: + /* Valid for DA830/OMAP-L137 or DA850/OMAP-L138 */ + pdev = &da850_mcasp_device; + break; + case 1: + /* Valid for DA830/OMAP-L137 only */ + if (!cpu_is_davinci_da830()) + return; + pdev = &da830_mcasp1_device; + break; + default: + return; } + + pdev->dev.platform_data = pdata; + platform_device_register(pdev); } static struct resource da8xx_pruss_resources[] = { -- 2.3.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/