From patchwork Tue Oct 25 09:02:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10632 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp892816wru; Tue, 25 Oct 2022 02:10:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7MYGOLhyIPcjp2ec8OZKW2pRNY4rCeAU60Sww1mIgui0TGnNFQAcS9SxtYaz5fEAaiLphm X-Received: by 2002:a17:90b:38c4:b0:20d:9dfa:4339 with SMTP id nn4-20020a17090b38c400b0020d9dfa4339mr76201167pjb.74.1666689016392; Tue, 25 Oct 2022 02:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666689016; cv=none; d=google.com; s=arc-20160816; b=wgutH614saXlbzrBRCeP5ciqnxAEKP3RxsesOyTFz3dU75n0EDUi/9yBru7iRbh2PS UweFSjjTSJ6nX5dxCJWPfIVL4ISYqTEgHzcgEDJ57jRiod73BEG5teKdgw8n94rILFBO IJFmRpLCvFJdxDrc56kBOj8BPylmfybOK1KDNjXr97nyxB43+imJDQveBLXUpDVkUMjw undLmWb5QIPeAyNifVRrnHgIdch1fi7yQugFx75ZNfmtIExxkQ9XxfpH25gvYYLg5RQ/ PkOSINH/ElU/LzFIV9NPw3/A4LOnOp1eHBcPvwF5H/uSsn9MalWHWGOiiY4o+OYjVwun wyaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uUtJPYeX+zfrKvn22cdfTLqyjI0AKofDDxo+q6w5uWY=; b=hYh5HhBi+vMKq4Fc7wjxhlCbaCKvz+z5bupYvOOGUC+bgpWahwvb8gVT+js5Gf3er3 8pKggw9SQSWrIeQkZA2SHNKpsmv0s6Nif27xtCa6k/LdrjRWS23NTJjxo1LH5hDA6IL7 qN79rYt/2hRYmKPmsCIBko8Io1RCtERwFZ6z+FgvnLUcoUpt/LGW4xwuoL7vf+tdCDsV ErDyACG1ts5nGbm8l75Q4oKb+21dm7/NopCsbodXkqOOYOiLxQ6uN8yTG3iIEPpbOZGD PUovHwgT8ksp2yTN4L6ypL4++EIHK5OD/KknKD4xzB/RrOPTbGT2w02expda5PNNJ9d+ zSBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Vw5PZh5n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg15-20020a17090326cf00b00172696f35e1si1977189plb.482.2022.10.25.02.10.03; Tue, 25 Oct 2022 02:10:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Vw5PZh5n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232299AbiJYJGi (ORCPT + 99 others); Tue, 25 Oct 2022 05:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232244AbiJYJFI (ORCPT ); Tue, 25 Oct 2022 05:05:08 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DFAF15A956; Tue, 25 Oct 2022 02:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1666688646; x=1698224646; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DsvW/rKm/Jcsqloupeh0C4YEYWkE77L/ilnhpT2+emo=; b=Vw5PZh5nirrRBSshYfWOdkdxr9451VCKffQqlyua/MVTH72/8GBg/TuF ehL41j3sKVgFOYYZ1OLtiV+i5PJBctuwUJZMf4QrzEUKP9z+3IjpWSax0 3ibsEO+jyQMijTiowZAOZa4AJqMDK4i/pWlEzYI4sbVlRKeWOko675zvR mq1aBXNQGGoo4wXtdMOr2g/JuUmFsBKUVbyL76Z/QAWlBdzmZcn1KWTrn PtnnrRVt8zzw/IrbwyLsjpGFw6YJF0SuqscOpSYRdAbnfht6oK5I7Jy64 Vx7hxXUPqArQEfrZZ5qbGTjJC1U4kQyk/AeNzrsPW5nvfdE+ie9GaCOeL A==; X-IronPort-AV: E=Sophos;i="5.95,211,1661842800"; d="scan'208";a="120221326" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Oct 2022 02:04:04 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Tue, 25 Oct 2022 02:04:03 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Tue, 25 Oct 2022 02:04:01 -0700 From: Tudor Ambarus To: , , CC: , , , , , , , "Tudor Ambarus" Subject: [PATCH v2 17/32] dmaengine: at_hdmac: Return dma_cookie_status()'s ret code when txstate is NULL Date: Tue, 25 Oct 2022 12:02:51 +0300 Message-ID: <20221025090306.297886-18-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221025090306.297886-1-tudor.ambarus@microchip.com> References: <20221025090306.297886-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747650102487860958?= X-GMAIL-MSGID: =?utf-8?q?1747650102487860958?= txstate is an optional parameter used to get a struct with auxilary transfer status information. When not provided the call to device_tx_status() should return the status of the dma cookie. Return the status of dma cookie when the txstate optional parameter is not provided. Signed-off-by: Tudor Ambarus --- drivers/dma/at_hdmac.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index f365ac4d87ff..10b6b0435d52 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1461,14 +1461,8 @@ atc_tx_status(struct dma_chan *chan, int bytes = 0; ret = dma_cookie_status(chan, cookie, txstate); - if (ret == DMA_COMPLETE) + if (ret == DMA_COMPLETE || !txstate) return ret; - /* - * There's no point calculating the residue if there's - * no txstate to store the value. - */ - if (!txstate) - return DMA_ERROR; spin_lock_irqsave(&atchan->lock, flags);