From patchwork Tue May 8 09:45:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 8453 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id DB07B23E20 for ; Tue, 8 May 2012 09:46:02 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 8A5ACA187D2 for ; Tue, 8 May 2012 09:46:02 +0000 (UTC) Received: by gglu1 with SMTP id u1so1778681ggl.11 for ; Tue, 08 May 2012 02:46:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=HMEZokViSOiTroMirXhU2SI43/hYn49zgdNB7hX8Hk4=; b=Dg+oUqIFieYlkGvgjXcK6okC1rnwqDF0vopMZ+0GJPC/kblaFZCAfTiqUpVJP8jEfJ o5ohhLBZEkc7SrpX6Uy6tfQ+sbAwNU6jB4/eBqPcWJniBNsmvuOCqceXL86xSAMD3+1I oE5UY7g6biZsv+GaVMBHx5j6HBi3s8X8J8PovpXctJ426XjG3XZHZW7Od/MnO2yPjgXD G3W673xq9RwVVJxAsp4ahxAXOQE3jmqzlXG7c3cJM38bOw4ahLQcabc/19nOAR40zK0d YJyIYxEoGIGns1jWF9gAS82VROTPDm14TD8+Hop+xgaP49TPrk+TyLm4VwJbz56SnnyH KIQw== Received: by 10.50.89.168 with SMTP id bp8mr751182igb.3.1336470361883; Tue, 08 May 2012 02:46:01 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.73.147 with SMTP id q19csp187547ibj; Tue, 8 May 2012 02:46:00 -0700 (PDT) Received: by 10.14.119.74 with SMTP id m50mr697855eeh.83.1336470359860; Tue, 08 May 2012 02:45:59 -0700 (PDT) Received: from eu1sys200aog109.obsmtp.com (eu1sys200aog109.obsmtp.com. [207.126.144.127]) by mx.google.com with SMTP id y12si5980353eea.56.2012.05.08.02.45.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 May 2012 02:45:59 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.127 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.127; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.127 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob109.postini.com ([207.126.147.11]) with SMTP ID DSNKT6jrS3o5637VMr4g7GK45uZqOanVsQOo@postini.com; Tue, 08 May 2012 09:45:58 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 1465DED; Tue, 8 May 2012 09:37:23 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id BBCF623B; Tue, 8 May 2012 09:45:43 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 7F73324C2E7; Tue, 8 May 2012 11:45:37 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 8 May 2012 11:45:42 +0200 From: Linus Walleij To: , Cc: Stephen Warren , Shawn Guo , Thomas Abraham , Dong Aisheng , Rajendra Nayak , Haojian Zhuang , Linus Walleij , Ola Lilja Subject: [PATCH 11/12] ARM: ux500: alter MSP registration to return a device pointer Date: Tue, 8 May 2012 11:45:39 +0200 Message-ID: <1336470339-23851-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.9.2 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkq0YtxleFwZs938vMX7jiYd5ceqR+/9ihOvphs3bcOzpFyCjk/+gNTjMP4UHKi9pQW4hug From: Linus Walleij Alter the db8500_add_msp_i2s() calls to return a struct platform_device * pointer, not an integer. We nee the pointer to obtain a pinctrl handle. Cc: Ola Lilja Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/board-mop500-msp.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500-msp.c b/arch/arm/mach-ux500/board-mop500-msp.c index c8f6300..aacaf80 100644 --- a/arch/arm/mach-ux500/board-mop500-msp.c +++ b/arch/arm/mach-ux500/board-mop500-msp.c @@ -170,7 +170,8 @@ static struct stedma40_chan_cfg msp2_dma_tx = { /* data_width is set during configuration */ }; -static int db8500_add_msp_i2s(struct device *parent, int id, +static struct platform_device *db8500_add_msp_i2s(struct device *parent, + int id, resource_size_t base, int irq, struct msp_i2s_platform_data *pdata) { @@ -188,10 +189,10 @@ static int db8500_add_msp_i2s(struct device *parent, int id, if (!pdev) { pr_err("Failed to register platform-device 'ux500-msp-i2s.%d'!\n", id); - return -EIO; + return NULL; } - return 0; + return pdev; } /* Platform device for ASoC U8500 machine */ @@ -228,23 +229,21 @@ static struct msp_i2s_platform_data msp3_platform_data = { int mop500_msp_init(struct device *parent) { - int ret; - pr_info("%s: Register platform-device 'snd-soc-u8500'.\n", __func__); platform_device_register(&snd_soc_u8500); pr_info("Initialize MSP I2S-devices.\n"); - ret = db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0, - &msp0_platform_data); - ret |= db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, - &msp1_platform_data); - ret |= db8500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2, - &msp2_platform_data); - ret |= db8500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1, - &msp3_platform_data); + db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0, + &msp0_platform_data); + db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1, + &msp1_platform_data); + db8500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2, + &msp2_platform_data); + db8500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1, + &msp3_platform_data); pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__); platform_device_register(&ux500_pcm); - return ret; + return 0; }