Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3125927pxa; Tue, 25 Aug 2020 12:07:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBgdI/VAlQTB85RCDwVM09CIl/I/pnsBhDBG+Q1Xn9xY4f2xfVta38jkWc7bDZSlp9HRQF X-Received: by 2002:a17:906:2613:: with SMTP id h19mr11553021ejc.147.1598382449663; Tue, 25 Aug 2020 12:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598382449; cv=none; d=google.com; s=arc-20160816; b=LV+hTAY/J9NaeRTANqIm4YxBa1tLkF7QndkACoJG+wT6h8F8TJt+Ky/p6+sEX8900E kYwuQeIRfMLiH/rc1XRX5k0PXLXlFGmDEmXbBe6uZR4zccUwc2u33vmWZJaqVJart6L+ gPr3DtUUBAOeXFtWPKQWkRMWrUbnO6iTdUgKEImD7ODK3PE8kS+k3bAydBoNe+tODieF XBPTc94MWrmW7mrtqbxZpuW6e6rThYd42aM9CpQyO7ZHyLwwfx0XDU29L4vHNb56UoIK MFoxRkN2ebQuWB2ifS9pYvjpGJMm/T7k01sluXgglsGuzvnC+kQldfDxEFaxcrnU85IW hIng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=b+8mDkoVaf6A22DplOCz4orok5GLXYGLmyyXF7a5xaY=; b=a3NmAyaJrEjf1Cyz0bd5HX1f6rWioqKKVmlym1hbj92WkpBMpSVRaqLJunmWY7CgjN 0+pi6ty8kBn0DCVOIZwn7sBHbgbwiYWNzSQV1m+UxQ3X0hrARn/JF0avFLqaT0UTOo6o u3nxWNUdkjM+mHSD3yt2eHKRmBvQRgADLOSE2Hiheu1SGKrYBYSgX+komUpk1YgD1nuk /mURitppk4jia8l8wlU9LsUFUmfNyaeGKDegdEJRnhmGBeM+ySKlcbnsyKKP1YuxG4SV Y5hw0y3c0nm1Je0XkAT052fDwaK8NYepdquL5VkqC5F/39PS0ERmhmRsMXfy3rsvJCdo fVgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yUgoV8TE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o8si9124603edq.435.2020.08.25.12.07.05; Tue, 25 Aug 2020 12:07:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yUgoV8TE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726704AbgHYTGQ (ORCPT + 99 others); Tue, 25 Aug 2020 15:06:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:56692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726593AbgHYTGO (ORCPT ); Tue, 25 Aug 2020 15:06:14 -0400 Received: from [192.168.0.50] (89-70-52-201.dynamic.chello.pl [89.70.52.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 363762076C; Tue, 25 Aug 2020 19:06:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598382374; bh=nFY9Byoa7IafoHZHxTgBMjQ8dyHzdWFqPV0Bq/m9pIQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=yUgoV8TEt4ukVuYw7absvzUjk2l9zDyAF4VAnUWfsw//qHqZf73dyR7uYYmP61Uyz vYJPjzCOZxuEB0C177HjrTdx4TsfOu7aKZKomimGZogPJLauhar4wxmbVRzqET/uoB 3b1CiqptcnTX5cu3HiFpxpVmtOxKrzU5QXoXY2MA= Subject: Re: [PATCH v2 6/9] spi: spi-s3c64xx: Check return values To: =?UTF-8?Q?=c5=81ukasz_Stelmach?= Cc: 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, m.szyprowski@samsung.com, b.zolnierkie@samsung.com References: <20200821161401.11307-1-l.stelmach@samsung.com> <20200821161401.11307-7-l.stelmach@samsung.com> From: Sylwester Nawrocki Message-ID: Date: Tue, 25 Aug 2020 21:06:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200821161401.11307-7-l.stelmach@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/21/20 18:13, Łukasz Stelmach wrote: > Check return values in prepare_dma() and s3c64xx_spi_config() and > propagate errors upwards. > > Signed-off-by: Łukasz Stelmach > --- > drivers/spi/spi-s3c64xx.c | 47 ++++++++++++++++++++++++++++++++------- > 1 file changed, 39 insertions(+), 8 deletions(-) > @@ -298,12 +299,24 @@ 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 -ENOMEM; > + } > > 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, "DMA submission failed"); > + return -EIO; Just return the error value from dma_submit_error() here?