From patchwork Thu Sep 3 05:48:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 11752437 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 D247E1575 for ; Thu, 3 Sep 2020 05:50:27 +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 AB297204FD for ; Thu, 3 Sep 2020 05:50:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="c5VupymS"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="htj3lRqk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB297204FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org 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:MIME-Version: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:In-Reply-To:References:List-Owner; bh=ZjBjL0QwIP3M5/Ji5ZU5iEUCXz54SlwMdsX4nkWU1xU=; b=c5VupymSr/ERKPn0yL7Rgmr7Rq Bm8RoMyHSaL4ned7yydVqccfnwl9fv11vqUNeHhSkWSd/K3Uh/Y1+V/ParHphXmrZ6fmU9kyjR7pq F1oB47BMKnYOewptg7V+Y3OQj6iObBdRaT60PAh9A/TtShAK1fNjcgDcUXjCnE735AqLNO/C+uspr JQscGIgVvbntRkJ5hLT14Ap/3zoMX6PTf9gfosrMLE6DbOzSNn45Sybvuww6YOsPvvc0hBQmo1lIi Djab9ciHwibpxKjg9K72BBjYPRPJVTm/iKZF6ULSEldicLbfgrBBdYFlcy/+NYJN5k3ARhzDwFeq7 ZqDrkxag==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDi77-0002G8-3H; Thu, 03 Sep 2020 05:48:49 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDi75-0002FA-43 for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 05:48:48 +0000 Received: by mail-pg1-x544.google.com with SMTP id l191so1212487pgd.5 for ; Wed, 02 Sep 2020 22:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uxOUTu3Fn6s5agkJSuaeoytoVx0NNmaxRXLXydxOq+w=; b=htj3lRqkIgsh4c7IEbd0OmII1g4rHRRPYOwizSELlMizgLq1bPkB8rImlcFCoZKJVE 03NUrgzKBL4KZEocOdzwfK5zpgqAqBsBI2zDsMWwNcYGgiybhcIlQur0qV0U6/0z5Tc9 PJyJN3Ae9HfFWMc+5cOBsivktgGMh/wYlw2Ak= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uxOUTu3Fn6s5agkJSuaeoytoVx0NNmaxRXLXydxOq+w=; b=A9ZDP3zl+AjQvzvNskuI/4Ei57yRYK0Ux9qpR+HFOebBrZJF2aE3w7+AmKWQfeLzz7 xGKqjZ6rOTPECbNQacGbh4jwluJLbH1K72FZHUOlrTPMmp5Gix5/VW/zTWbtNpdyXKNP JrPvye0orf+7aQzvUAEtYrFZym81HqLe1WGPml1DM58E3kFSe37JVlO0ENwF8goAkZQo te2llp7zMzR28BpXGRWCWhamXWxEtYlUYK4vsCFiAeCGbreuGUADdPXE0lV6P2KuIzGn /z2IbS0fjJXmLCU0GhfZ16A6n7XC7DcY9aQO1pc0wZ5ZPA0FI/ySWgV5PN5XfTFe/pMF Ge0A== X-Gm-Message-State: AOAM532l4rGc3OUxbOMDgb8NPqip3BfgalOg63U4iwanORsQ/LYFVgJT SiMQguwBsXqB9ZPmp/7+xJi5ZA== X-Google-Smtp-Source: ABdhPJxnvTUo3AQzDD/vyNULzOUhHkXHWGLFFwWLxxcbIpy/btsmC/T3RiZIgNFj//B5dc6sqis6/A== X-Received: by 2002:a63:1052:: with SMTP id 18mr1525513pgq.311.1599112124849; Wed, 02 Sep 2020 22:48:44 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:1a60:24ff:fe89:3e93]) by smtp.gmail.com with ESMTPSA id r2sm1099218pga.94.2020.09.02.22.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 22:48:44 -0700 (PDT) From: Hsin-Yi Wang To: linux-media@vger.kernel.org Subject: [PATCH] media: mtk-vcodec: remove allocated dma_parms Date: Thu, 3 Sep 2020 13:48:33 +0800 Message-Id: <20200903054832.3743698-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.28.0.402.g5ffc5be6b7-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_014847_210019_C2DD5CD4 X-CRM114-Status: GOOD ( 12.94 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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: Andrew-CT Chen , Tiffany Lin , linux-kernel@vger.kernel.org, Hans Verkuil , linux-mediatek@lists.infradead.org, Hsin-Yi Wang , Matthias Brugger , Mauro Carvalho Chehab , Robin Murphy , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices") included dma_parms in platform_device. There's no need to allocate again. Fixes: 13483fc2f20f0e2db7ba9c39b095ac7ea46f8de8 ("media: mtk-vcodec: set dma max segment size") Suggested-by: Robin Murphy Signed-off-by: Hsin-Yi Wang --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 9 +-------- drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c index 3bbd0bac56d69..76ee0cb5a7094 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c @@ -242,14 +242,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev) mtk_v4l2_err("[VPU] vpu device in not ready"); return -EPROBE_DEFER; } - if (!pdev->dev.dma_parms) { - pdev->dev.dma_parms = devm_kzalloc(&pdev->dev, - sizeof(*pdev->dev.dma_parms), - GFP_KERNEL); - if (!pdev->dev.dma_parms) - return -ENOMEM; - } - dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); + dma_set_max_seg_size(&pdev->dev, UINT_MAX); vpu_wdt_reg_handler(dev->vpu_plat_dev, mtk_vcodec_dec_reset_handler, dev, VPU_RST_DEC); diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c index ff4a87485d690..c18e58c71d4a4 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c @@ -249,14 +249,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev) mtk_v4l2_err("[VPU] vpu device in not ready"); return -EPROBE_DEFER; } - if (!pdev->dev.dma_parms) { - pdev->dev.dma_parms = devm_kzalloc(&pdev->dev, - sizeof(*pdev->dev.dma_parms), - GFP_KERNEL); - if (!pdev->dev.dma_parms) - return -ENOMEM; - } - dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); + dma_set_max_seg_size(&pdev->dev, UINT_MAX); vpu_wdt_reg_handler(dev->vpu_plat_dev, mtk_vcodec_enc_reset_handler, dev, VPU_RST_ENC);