From patchwork Tue Dec 17 12:53:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Vaussard X-Patchwork-Id: 3361411 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 84536C0D4A for ; Tue, 17 Dec 2013 12:54:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBFEE20257 for ; Tue, 17 Dec 2013 12:54:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5158720213 for ; Tue, 17 Dec 2013 12:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752777Ab3LQMyY (ORCPT ); Tue, 17 Dec 2013 07:54:24 -0500 Received: from smtp5.epfl.ch ([128.178.224.8]:36760 "EHLO smtp5.epfl.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753185Ab3LQMyO (ORCPT ); Tue, 17 Dec 2013 07:54:14 -0500 Received: (qmail 14792 invoked by uid 107); 17 Dec 2013 12:54:12 -0000 X-Virus-Scanned: ClamAV Received: from lsro1pc340.epfl.ch (HELO lsro1pc340.epfl.ch) (128.178.145.154) (authenticated) by smtp5.epfl.ch (AngelmatoPhylax SMTP proxy) with ESMTPSA; Tue, 17 Dec 2013 13:54:12 +0100 From: Florian Vaussard To: Joerg Roedel , Tony Lindgren , =?UTF-8?q?Beno=C3=AEt=20Cousson?= Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Rob Landley , Grant Likely , Hiroshi Doyu , Florian Vaussard , iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/7] iommu/omap: Allow enable/disable even without pdata Date: Tue, 17 Dec 2013 13:53:35 +0100 Message-Id: <1387284818-28739-5-git-send-email-florian.vaussard@epfl.ch> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1387284818-28739-1-git-send-email-florian.vaussard@epfl.ch> References: <1387284818-28739-1-git-send-email-florian.vaussard@epfl.ch> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When booting with a devietree, no platform data is provided. Do not prematurely exit iommu_enable() and iommu_disable() in such a case. Signed-off-by: Florian Vaussard --- drivers/iommu/omap-iommu.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 51efcc4..0a9854d 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -149,13 +149,10 @@ static int iommu_enable(struct omap_iommu *obj) struct platform_device *pdev = to_platform_device(obj->dev); struct iommu_platform_data *pdata = pdev->dev.platform_data; - if (!pdata) - return -EINVAL; - if (!arch_iommu) return -ENODEV; - if (pdata->deassert_reset) { + if (pdata && pdata->deassert_reset) { err = pdata->deassert_reset(pdev, pdata->reset_name); if (err) { dev_err(obj->dev, "deassert_reset failed: %d\n", err); @@ -175,14 +172,11 @@ static void iommu_disable(struct omap_iommu *obj) struct platform_device *pdev = to_platform_device(obj->dev); struct iommu_platform_data *pdata = pdev->dev.platform_data; - if (!pdata) - return; - arch_iommu->disable(obj); pm_runtime_put_sync(obj->dev); - if (pdata->assert_reset) + if (pdata && pdata->assert_reset) pdata->assert_reset(pdev, pdata->reset_name); }