From patchwork Fri Mar 25 15:13:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 6205 Return-path: Envelope-to: mchehab@pedra Delivery-date: Fri, 25 Mar 2011 12:14:00 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1Q38i7-0004Ik-VW for mchehab@pedra; Fri, 25 Mar 2011 12:14:00 -0300 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Fri, 25 Mar 2011 12:13:59 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Q38hz-0006sZ-77; Fri, 25 Mar 2011 15:13:51 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751999Ab1CYPNs (ORCPT + 1 other); Fri, 25 Mar 2011 11:13:48 -0400 Received: from smtp.nokia.com ([147.243.1.47]:64259 "EHLO mgw-sa01.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840Ab1CYPNq (ORCPT ); Fri, 25 Mar 2011 11:13:46 -0400 Received: from nokia.com (localhost [127.0.0.1]) by mgw-sa01.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id p2PFDikT008035; Fri, 25 Mar 2011 17:13:44 +0200 Received: from maxwell.research.nokia.com ([maxwell.research.nokia.com [172.21.50.162]]) by mgw-sa01.nokia.com with ESMTP id p2PFDP0F007808 ; Fri, 25 Mar 2011 17:13:26 +0200 Received: from kaali.localdomain (kaali.localdomain [192.168.239.7]) by maxwell.research.nokia.com (Postfix) with ESMTPS id 753A437FCDA; Fri, 25 Mar 2011 17:13:25 +0200 (EET) Received: from sailus by kaali.localdomain with local (Exim 4.72) (envelope-from ) id 1Q38hZ-00023r-Ad; Fri, 25 Mar 2011 17:13:25 +0200 From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, david.cohen@nokia.com, hiroshi.doyu@nokia.com Subject: [PATCH 1/4] omap iommu: Check existence of arch_iommu Date: Fri, 25 Mar 2011 17:13:22 +0200 Message-Id: <1301066005-7882-1-git-send-email-sakari.ailus@maxwell.research.nokia.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <4D8CB106.7030608@maxwell.research.nokia.com> References: <4D8CB106.7030608@maxwell.research.nokia.com> X-Nokia-AV: Clean Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Check that the arch_iommu has been installed before trying to use it. This will lead to kernel oops if the arch_iommu isn't there. Signed-off-by: Sakari Ailus --- arch/arm/plat-omap/iommu.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index b1107c0..f0fea0b 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c @@ -104,6 +104,9 @@ static int iommu_enable(struct iommu *obj) if (!obj) return -EINVAL; + if (!arch_iommu) + return -ENOENT; + clk_enable(obj->clk); err = arch_iommu->enable(obj);