From patchwork Tue Jul 21 14:16:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael J. Ruhl" X-Patchwork-Id: 11675733 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 121F4618 for ; Tue, 21 Jul 2020 14:17:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 EEC6C2068F for ; Tue, 21 Jul 2020 14:17:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EEC6C2068F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C2EFC6E4E6; Tue, 21 Jul 2020 14:17:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 647906E4F9 for ; Tue, 21 Jul 2020 14:17:12 +0000 (UTC) IronPort-SDR: e8lFxL/xYAo6qTguCIpLh0PG33nfKeXAYWFr2nCIksMhx4nSHfI3BHl8MhuS/qqwOPeKdhsOQL 5TcYCkwqlDTg== X-IronPort-AV: E=McAfee;i="6000,8403,9688"; a="148066431" X-IronPort-AV: E=Sophos;i="5.75,379,1589266800"; d="scan'208";a="148066431" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2020 07:17:05 -0700 IronPort-SDR: kUGuur520vYHG+MsEvUzPNTsy0P8FILd150pEgw4W2aUP/1TtgNEEq2xqkMVXbXHtjI4yDZJ/f VnIqoj7BHqUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,379,1589266800"; d="scan'208";a="432011539" Received: from awvttdev-05.aw.intel.com ([10.228.212.156]) by orsmga004.jf.intel.com with ESMTP; 21 Jul 2020 07:17:03 -0700 From: "Michael J. Ruhl" To: dri-devel@lists.freedesktop.org Subject: [PATCH] io-mapping: Indicate mapping failure Date: Tue, 21 Jul 2020 10:16:41 -0400 Message-Id: <20200721141641.81112-2-michael.j.ruhl@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200721141641.81112-1-michael.j.ruhl@intel.com> References: <20200721141641.81112-1-michael.j.ruhl@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Rapoport , stable@vger.kernel.org, Chris Wilson , "Michael J. Ruhl" , Andrew Morton , Andy Shevchenko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Sometimes it is good to know when your mapping failed. Fixes: cafaf14a5d8f ("io-mapping: Always create a struct to hold metadata about the io-mapping" Cc: Andrew Morton Cc: Mike Rapoport Cc: Andy Shevchenko Cc: Chris Wilson Cc: stable@vger.kernel.org Signed-off-by: Michael J. Ruhl --- include/linux/io-mapping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 0beaa3eba155..5641e06cbcf7 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h @@ -118,7 +118,7 @@ io_mapping_init_wc(struct io_mapping *iomap, iomap->prot = pgprot_noncached(PAGE_KERNEL); #endif - return iomap; + return iomap->iomem ? iomap : NULL; } static inline void