From patchwork Wed Aug 19 12:32:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lukasz Stelmach X-Patchwork-Id: 11723905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7CC7138C for ; Wed, 19 Aug 2020 12:34:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B0372206FA for ; Wed, 19 Aug 2020 12:34:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ILdxMiok"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="NuaimugX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B0372206FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:MIME-Version:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ElxB1yivhP8E69EwVNG/Rxk358y/Ea7iBGveIZP5COs=; b=ILdxMiok1cX4icGfZdGKO0IHL FZOSenARXs6P27b+IS0Kf0+iR8ADGKO50IRVq7tgbIoISxcb+QpWttRzG5sYoPJ9uueMLl8nM0PD8 wwjnO2s7naz1Jab5cPGVdgqMtv2Zz08S4h1V2ahJBwGFwoIjthW6uPlcVNrZSJFbmz5keO6s/Ekjm Nx9C9IqhbDJH92/uVnEmumitvfZtNKKiTbTAA81T2ufSaWY2dJf+vDjP3XPZNEgKhv5zHSyh75qgO 9fNAEhR2YYB40AnMmZdrbT8qIETgGhqf205TxyCzxrnlcOOycRGeulX6AuYfWnc8AgRGty3azW05l QMaHBxdvw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8NGq-0006tN-34; Wed, 19 Aug 2020 12:32:48 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8NGX-0006m3-Gj for linux-arm-kernel@lists.infradead.org; Wed, 19 Aug 2020 12:32:32 +0000 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200819123228euoutp0142ae61479000621139eafd8ceee4ffff~sq1TWa3a-3048130481euoutp01C for ; Wed, 19 Aug 2020 12:32:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200819123228euoutp0142ae61479000621139eafd8ceee4ffff~sq1TWa3a-3048130481euoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597840348; bh=dodgnAl4aQ9JHWLPjyth7Ek4AxDLNCjB7Q2ZDPyW0+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NuaimugXLZRMElQAh0R57Va8jTcXjQ+CLPfqgkupGN/YUmXwiQdOXpF+umTE7fwMw Pkko905kbX9EUpjKaLzBpO+rjiby1HTK8Wy7rwobXdjhLBYsmxBRblnaRVoWmi0kC5 fxIBFtf78UYCoykM1gs6gDgDbGiYe/JZ4G49cBGA= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200819123228eucas1p28ecf3a4492d5091978a0d8f59aa69301~sq1TERT9k2958529585eucas1p2U; Wed, 19 Aug 2020 12:32:28 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 58.3B.06456.CDB1D3F5; Wed, 19 Aug 2020 13:32:28 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200819123227eucas1p11ec027714c16d5a66c89c6ef1f7b3604~sq1Sp-jTa0820708207eucas1p1J; Wed, 19 Aug 2020 12:32:27 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200819123227eusmtrp2101a6bb48ffcd56dc7f5fbb9180c5bb3~sq1SpYy982883128831eusmtrp2j; Wed, 19 Aug 2020 12:32:27 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-b2-5f3d1bdcc277 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 34.DF.06314.BDB1D3F5; Wed, 19 Aug 2020 13:32:27 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200819123227eusmtip28a317d3b9767d8c4e833ddbc2aa0ead6~sq1SgmJje0116101161eusmtip2W; Wed, 19 Aug 2020 12:32:27 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] spi: spi-s3c64xx: Check return values Date: Wed, 19 Aug 2020 14:32:06 +0200 Message-Id: <20200819123208.12337-7-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200819123208.12337-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIKsWRmVeSWpSXmKPExsWy7djP87p3pG3jDZ7fELZY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yO3B7XF/y idlj06pONo/NS+o9+rasYvT4vEkugDWKyyYlNSezLLVI3y6BK6N/8gKWgpucFf/W/GVsYGzg 6GLk5JAQMJGYt/wNUxcjF4eQwApGiTmLdzNCOF8YJV5vn88C4XxmlFh5ZDkLTMvsri1QieWM Er0nZkE5zxklfu1/xAZSxSbgKNG/9AQrSEJEYAKTxMNzb8ASzAKlEj07D4HZwgJWEqtmHwUb yyKgKvG0r5ERxOYVsJY4sWEiE8Q6eYn25dvB6jkFbCQe/prCBlEjKHFy5hOwXn4BLYk1TddZ IObLSzRvnc0MslhC4By7xPsJ54CGcgA5LhKnLwlCzBSWeHV8CzuELSPxf+d8JoiSeonJk8wg WnsYJbbN+QH1srXEnXO/2EBqmAU0Jdbv0ocIO0ps/LoUqpVP4sZbQYgL+CQmbZvODBHmleho E4KoVpFY178HaqCURO+rFYwTGJVmIfllFpL7ZyHsWsDIvIpRPLW0ODc9tdgwL7Vcrzgxt7g0 L10vOT93EyMwIZ3+d/zTDsavl5IOMQpwMCrx8Facs44XYk0sK67MPcQowcGsJMLrdPZ0nBBv SmJlVWpRfnxRaU5q8SFGaQ4WJXFe40UvY4UE0hNLUrNTUwtSi2CyTBycUg2Mm/63/1wkWeYZ kBg4Qbqm0nWZtu6P+Ocb1mdtPXV8EcO8pfd+GWW0RD+Zpv7ib9/F7hctFZEcB9cszDhUJlMo NkP1ifC1Nd9yNN5bGKbV2r+VdE5fbHBg77pJYVLex2I1fQSq1+d9eujWuPD75F8cv/a+3/Rq tu300qo7rwPdP966uee85EQ5cSWW4oxEQy3mouJEAIyZrshEAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIIsWRmVeSWpSXmKPExsVy+t/xe7q3pW3jDXoumlks/vGcyWLjjPWs FlMfPmGz6H/8mtni/PkN7BY3D61gtNj0+BqrxeVdc9gsZpzfx2TR+PEmu8XaI3fZHbg9ri/5 xOyxaVUnm8fmJfUefVtWMXp83iQXwBqlZ1OUX1qSqpCRX1xiqxRtaGGkZ2hpoWdkYqlnaGwe a2VkqqRvZ5OSmpNZllqkb5egl9E/eQFLwU3Oin9r/jI2MDZwdDFyckgImEjM7trC0sXIxSEk sJRRouvdfSCHAyghJbFybjpEjbDEn2tdbCC2kMBTRok5SwRBbDYBR4n+pSdYQXpFBGYwSTy5 MZkVJMEsUC5xadZzdhBbWMBKYtXsoywgNouAqsTTvkZGEJtXwFrixIaJTBAL5CXal28HW8Ap YCPx8NcUqGXWEl2LFzJB1AtKnJz5BOw2ZgF1ifXzhEDC/AJaEmuarrNArJWXaN46m3kCo9As JB2zEDpmIalawMi8ilEktbQ4Nz232FCvODG3uDQvXS85P3cTIzD6th37uXkH46WNwYcYBTgY lXh4K85ZxwuxJpYVV+YeYpTgYFYS4XU6ezpOiDclsbIqtSg/vqg0J7X4EKMp0JsTmaVEk/OB iSGvJN7Q1NDcwtLQ3Njc2MxCSZy3Q+BgjJBAemJJanZqakFqEUwfEwenFDBWJknrZdtM7N+x f8vnx2ZfX6Qo/uyTq7n4ajf3t1r/iMAHeWc0l4nEqd46t8Lu/u/ZGtn3uTzPnPG7Nmd2TG/M niX/ZHYY1KWaKKuo36jcebXiYn+a+I+AlztPr93qzcASYSp+8Y79+pPak53jnp//zXz5Tud+ 4z3pevH+Zv+XyOeW3Lx6JVJUiaU4I9FQi7moOBEA3rAYbtQCAAA= X-CMS-MailID: 20200819123227eucas1p11ec027714c16d5a66c89c6ef1f7b3604 X-Msg-Generator: CA X-RootMTR: 20200819123227eucas1p11ec027714c16d5a66c89c6ef1f7b3604 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200819123227eucas1p11ec027714c16d5a66c89c6ef1f7b3604 References: <20200819123208.12337-1-l.stelmach@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200819_083229_910202_FFC9AFE2 X-CRM114-Status: GOOD ( 13.54 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.11 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [210.118.77.11 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: b.zolnierkie@samsung.com, =?utf-8?q?=C5=81ukasz_Stelmach?= , m.szyprowski@samsung.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Ɓukasz Stelmach --- drivers/spi/spi-s3c64xx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 505789f91fdf..27d77600a820 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -273,6 +273,7 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma, struct s3c64xx_spi_driver_data *sdd; struct dma_slave_config config; struct dma_async_tx_descriptor *desc; + int ret; memset(&config, 0, sizeof(config)); @@ -296,11 +297,22 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma, desc = dmaengine_prep_slave_sg(dma->ch, sgt->sgl, sgt->nents, dma->direction, DMA_PREP_INTERRUPT); + if (!desc) { + dev_err(&sdd->pdev->dev, "unable to prepare %s scatterlist", + dma->direction == DMA_DEV_TO_MEM ? "rx" : "tx"); + return; + } desc->callback = s3c64xx_spi_dmacb; desc->callback_param = dma; dma->cookie = dmaengine_submit(desc); + ret = dma_submit_error(dma->cookie); + if (ret) { + dev_err(&sdd->pdev->dev, "dmaengine_submit() failed %d", ret); + return; + } + dma_async_issue_pending(dma->ch); }