From patchwork Thu Aug 30 00:24:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guzman Lugo, Fernando" X-Patchwork-Id: 1386311 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DF9053FDF6 for ; Thu, 30 Aug 2012 00:26:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753438Ab2H3AZE (ORCPT ); Wed, 29 Aug 2012 20:25:04 -0400 Received: from na3sys009aog111.obsmtp.com ([74.125.149.205]:39528 "EHLO na3sys009aog111.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752737Ab2H3AZC (ORCPT ); Wed, 29 Aug 2012 20:25:02 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKUD6y3eZPHEAUAaDbzPkTEDjvGCNXFoTm@postini.com; Wed, 29 Aug 2012 17:25:02 PDT Received: by obbuo13 with SMTP id uo13so2265469obb.19 for ; Wed, 29 Aug 2012 17:25:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=W7MwEkojRhr265wEZLZOi9w6xOxYdYNd9v3P3mofUl4=; b=SFQAiPzcHXOdG9vqMosTL0dLxXfdVFtfu6+j9Q0AMOgcdAg+GyU1J77PI15pHc2EBO SbFFgSw/ubBosyp4BREseK6dAnf1/qGaYUIvCatPrZwf/C8qaCP1X2NTbqVeV0dcO/JP GbTqnSy5t/rkyNb+cERrU4mc/a49Km3NXHJNXXT4HeVJauwnx2EQg3nOh4OzqgCl7lUy I9m4ZTl1fq7pX/zvJ6v4nAOGwJhKd6wZosHhvMACEHg0mw0ZoO9L4MyXIPDb51U11YO7 Y6qR97Jp+gBf4ZI9WVhBwwXNib/9a5K5UE7KpP8+Y8TZrhFBo+ThBoEQ+0aOhTn+QN8s Ftjw== Received: by 10.60.22.104 with SMTP id c8mr2855181oef.2.1346286300767; Wed, 29 Aug 2012 17:25:00 -0700 (PDT) Received: from localhost.localdomain (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id r1sm94473oea.4.2012.08.29.17.24.59 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Aug 2012 17:25:00 -0700 (PDT) From: Fernando Guzman Lugo To: , , , Cc: Fernando Guzman Lugo Subject: [PATCH] rpmsg: use right device paramter when calling dma_free_coherent function Date: Wed, 29 Aug 2012 19:24:52 -0500 Message-Id: <1346286292-21773-1-git-send-email-fernando.lugo@ti.com> X-Mailer: git-send-email 1.7.1 X-Gm-Message-State: ALoCoQn0rprOmCgemzcxY369ck+uFKqeMPhLv1ykmA7TzUJ01C7MPCAOrPT0AbkZ17qB9jtIP+R9 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org dma_alloc/free_coherent APIs requires the platform specific remoteproc device as the device parameter. We are passing vdev->dev.parent to the dma_free_coherent function which is the generic rproc device and it is wrong, it has to be vdev->dev.parent->parent instead, same as when we call dma_alloc_coherent function. Signed-off-by: Fernando Guzman Lugo --- drivers/rpmsg/virtio_rpmsg_bus.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 590cfaf..1859f71 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -1008,8 +1008,8 @@ static int rpmsg_probe(struct virtio_device *vdev) return 0; free_coherent: - dma_free_coherent(vdev->dev.parent, RPMSG_TOTAL_BUF_SPACE, bufs_va, - vrp->bufs_dma); + dma_free_coherent(vdev->dev.parent->parent, RPMSG_TOTAL_BUF_SPACE, + bufs_va, vrp->bufs_dma); vqs_del: vdev->config->del_vqs(vrp->vdev); free_vrp: @@ -1043,7 +1043,7 @@ static void __devexit rpmsg_remove(struct virtio_device *vdev) vdev->config->del_vqs(vrp->vdev); - dma_free_coherent(vdev->dev.parent, RPMSG_TOTAL_BUF_SPACE, + dma_free_coherent(vdev->dev.parent->parent, RPMSG_TOTAL_BUF_SPACE, vrp->rbufs, vrp->bufs_dma); kfree(vrp);