From patchwork Sun Mar 27 04:31:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 666321 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2R4VukG030190 for ; Sun, 27 Mar 2011 04:31:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750750Ab1C0Ebw (ORCPT ); Sun, 27 Mar 2011 00:31:52 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:32825 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750816Ab1C0Ebv (ORCPT ); Sun, 27 Mar 2011 00:31:51 -0400 Received: by iwn34 with SMTP id 34so2464973iwn.19 for ; Sat, 26 Mar 2011 21:31:51 -0700 (PDT) Received: by 10.42.72.195 with SMTP id p3mr4379435icj.224.1301200311445; Sat, 26 Mar 2011 21:31:51 -0700 (PDT) Received: from chimagu (w142187.ppp.asahi-net.or.jp [121.1.142.187]) by mx.google.com with ESMTPS id g16sm1906414ibb.20.2011.03.26.21.31.49 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 Mar 2011 21:31:50 -0700 (PDT) Received: from iwamatsu by chimagu with local (Exim 4.74) (envelope-from ) id 1Q3hdk-0001OS-P6; Sun, 27 Mar 2011 13:31:48 +0900 From: Nobuhiro Iwamatsu To: linux-sh@vger.kernel.org Cc: Nobuhiro Iwamatsu Subject: [PATCH 2/2] sh: Add sh_io_port_base check in __ioport_map function Date: Sun, 27 Mar 2011 13:31:47 +0900 Message-Id: <1301200307-5321-2-git-send-email-iwamatsu@nigauri.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1301200307-5321-1-git-send-email-iwamatsu@nigauri.org> References: <1301200307-5321-1-git-send-email-iwamatsu@nigauri.org> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 27 Mar 2011 04:31:56 +0000 (UTC) diff --git a/arch/sh/kernel/ioport.c b/arch/sh/kernel/ioport.c index e3ad610..30937e9 100644 --- a/arch/sh/kernel/ioport.c +++ b/arch/sh/kernel/ioport.c @@ -19,6 +19,10 @@ void __iomem *__ioport_map(unsigned long addr, unsigned int size) if (sh_mv.mv_ioport_map) return sh_mv.mv_ioport_map(addr, size); + /* Don't use sh_io_port_base */ + if (sh_io_port_base == -1) + return (void __iomem *)addr; + return (void __iomem *)(addr + sh_io_port_base); } EXPORT_SYMBOL(__ioport_map);