From patchwork Tue Apr 2 11:23:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 2377201 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 06659DF2A1 for ; Tue, 2 Apr 2013 11:31:44 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UMzOz-0004Ko-LS; Tue, 02 Apr 2013 11:29:21 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UMzIg-0008Io-UP for linux-arm-kernel@lists.infradead.org; Tue, 02 Apr 2013 11:22:51 +0000 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MKM00KXVKXV17M0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 02 Apr 2013 20:22:46 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 99.14.02019.68FBA515; Tue, 02 Apr 2013 20:22:46 +0900 (KST) X-AuditID: cbfee690-b7f656d0000007e3-6c-515abf86ed7e Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id F7.10.13494.68FBA515; Tue, 02 Apr 2013 20:22:46 +0900 (KST) Received: from padma-linuxpc.sisodomain.com ([107.108.83.35]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MKM00C73KXQH650@mmp1.samsung.com>; Tue, 02 Apr 2013 20:22:46 +0900 (KST) From: Padmavathi Venna To: linux-samsung-soc@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, padma.v@samsung.com, padma.kvr@gmail.com Subject: [PATCH 2/2] ASoC: Samsung: set drvdata before adding secondary device Date: Tue, 02 Apr 2013 16:53:02 +0530 Message-id: <1364901782-16619-2-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1364901782-16619-1-git-send-email-padma.v@samsung.com> References: <1364901782-16619-1-git-send-email-padma.v@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplkeLIzCtJLcpLzFFi42JZI2JSo9u2PyrQ4MhzYYsrFw8xWfybfYrN onfBVTaLTY+vsVrMOL+PyaJ92RxWi983v7NZXFixkd3i4oovTA6cHhs+N7F57Jx1l91j85J6 j5cTf7N59G1ZxejxeZNcAFsUl01Kak5mWWqRvl0CV8b8/0tYC54KVBxeO5WtgfEPbxcjJ4eE gInEiovdbBC2mMSFe+uBbC4OIYGljBJ996+ywBT171nHBJFYxCix+VUnI4TTwyTxcf5t9i5G Dg42AR2JlrMuIHERgSmMEv/6lrCDdDML1Egcm7mLFcQWFvCTOHz3OVicRUBVomnuVLDVvALO EncOz2CH2KYgcWzqV7B6TgEXifdzjzKB2EJANa/3/mcGWSAhsI1douf5RqhBAhLfJh9iATlC QkBWYtMBZog5khIHV9xgmcAovICRYRWjaGpBckFxUnqRiV5xYm5xaV66XnJ+7iZGYBSc/vds wg7GewesDzEmA42byCwlmpwPjKK8knhDYzMjC1MTU2Mjc0sz0oSVxHnVW6wDhQTSE0tSs1NT C1KL4otKc1KLDzEycXBKNTD2fN34XawjmNexes6y+cc+LVTZWflqSUWV1Ebr3RkOvx/Z/Ht/ hmPKQ9afW7e8OK629Ktc4qbFN0y0dtrkzD1lf6on1LcjvMvrufudB9eKridMnLt6od5SMT4t 6akvWvsqLHfslPF/qFw7r6KCMWZuVcNpgyDFd2mLv/EVpHM85U5eyv4zSvqoEktxRqKhFnNR cSIAeWnfEpgCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEIsWRmVeSWpSXmKPExsVy+t9jAd22/VGBBlMncVtcuXiIyeLf7FNs Fr0LrrJZbHp8jdVixvl9TBbty+awWvy++Z3N4sKKjewWF1d8YXLg9NjwuYnNY+esu+wem5fU e7yc+JvNo2/LKkaPz5vkAtiiGhhtMlITU1KLFFLzkvNTMvPSbZW8g+Od403NDAx1DS0tzJUU 8hJzU22VXHwCdN0yc4CuUlIoS8wpBQoFJBYXK+nbYZoQGuKmawHTGKHrGxIE12NkgAYS1jBm zP+/hLXgqUDF4bVT2RoY//B2MXJySAiYSPTvWccEYYtJXLi3nq2LkYtDSGARo8TmV52MEE4P k8TH+bfZuxg5ONgEdCRazrqAxEUEpjBK/Otbwg7SzSxQI3Fs5i5WEFtYwE/i8N3nYHEWAVWJ prlT2UBsXgFniTuHZ7BDbFOQODb1K1g9p4CLxPu5R8GuEAKqeb33P/MERt4FjAyrGEVTC5IL ipPSc430ihNzi0vz0vWS83M3MYJj7Jn0DsZVDRaHGAU4GJV4eB3mRAYKsSaWFVfmHmKU4GBW EuGN2xkVKMSbklhZlVqUH19UmpNafIgxGeiqicxSosn5wPjPK4k3NDYxNzU2tTSxMDGzJE1Y SZz3YKt1oJBAemJJanZqakFqEcwWJg5OqQbG+ft2rS48cWyPWKDZvVbph+ZLWZYe7pmya++l Dcdm7eMJFd0z305mo7OF87LwnUw6frxRGSZGainxL1kWLCsMt30nf//cG67p/xXaJa7dCZ6g o7RES13mbb7t36fZ8314HuqnpCRxHEsW6k5SeSzY8aZ38c1It79cHhtvP9h3wbqpwtlfeskE JZbijERDLeai4kQA8hyZz/UCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130402_072251_214344_5D9257CE X-CRM114-Status: GOOD ( 13.67 ) X-Spam-Score: -9.2 (---------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-9.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.33 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -2.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: sbkim73@samsung.com, kgene.kim@samsung.com, broonie@opensource.wolfsonmicro.com, Prathyush K X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Prathyush K Currently, a new platform device is created for secondary device by calling platform_device_register_resndata and then the drvdata is set for this device. The following patch has been added to driver core: "driver core: fix possible missing of device probe". This results in the added device getting probed immediately but the drvdata for the secondary device is not yet set. This patch removes the platform_device_register_resndata call and instead calls platform_device_alloc, platform_set_drvdata and platform_device_add which fixes the above issue. Signed-off-by: Prathyush K Signed-off-by: Padmavathi Venna --- Based on Kukjin for-next branch sound/soc/samsung/i2s.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index f1fc064..6bbeb0b 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -972,6 +972,7 @@ static const struct snd_soc_dai_ops samsung_i2s_dai_ops = { static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) { struct i2s_dai *i2s; + int ret; i2s = devm_kzalloc(&pdev->dev, sizeof(struct i2s_dai), GFP_KERNEL); if (i2s == NULL) @@ -996,15 +997,17 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) i2s->i2s_dai_drv.capture.channels_max = 2; i2s->i2s_dai_drv.capture.rates = SAMSUNG_I2S_RATES; i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS; + dev_set_drvdata(&i2s->pdev->dev, i2s); } else { /* Create a new platform_device for Secondary */ - i2s->pdev = platform_device_register_resndata(NULL, - "samsung-i2s-sec", -1, NULL, 0, NULL, 0); + i2s->pdev = platform_device_alloc("samsung-i2s-sec", -1); if (IS_ERR(i2s->pdev)) return NULL; - } - /* Pre-assign snd_soc_dai_set_drvdata */ - dev_set_drvdata(&i2s->pdev->dev, i2s); + platform_set_drvdata(i2s->pdev, i2s); + ret = platform_device_add(i2s->pdev); + if (ret < 0) + return NULL; + } return i2s; }