Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp294161ybz; Tue, 28 Apr 2020 23:54:47 -0700 (PDT) X-Google-Smtp-Source: APiQypJ3M+a/rPaA0fi9R8pxyrmTKZSrzdFqoO/7ASutQVJpiBLzxknnY+AoAzHXtT8b41ojGNHQ X-Received: by 2002:a17:907:435d:: with SMTP id oc21mr1301213ejb.100.1588143287449; Tue, 28 Apr 2020 23:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588143287; cv=none; d=google.com; s=arc-20160816; b=ZGKQovOJiIhb0ZFNX1jy5FpZIiryj8wvMu5jNiKN/jHdvcMsTY8b9fQTsH3pJAjVbZ BtJxGcLs9Chu6DyG93eWPexaSfcflYKO1wxQ1Bn35r2i88qAvDXjMMPLcnvOuf++s1Yw ayu3wDA2L8B8FVF9phQSXqtgbRUo7t6kGmDXS+1+xAeAVhKahJHpqYw14PiwI/9Vbnug DQUcYvE8p4S4fzPyC1zR/rn3d4rs6M2s3vrfGrIyLHSH1zSscXL3iS5o8/zyljILrTwZ DFZ2uvddOpcfCi6wVay0+9MHgasdoN440EWAc0zbFRgLiQfjchSaIYoP+QkrncH2EjPe ijmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=uTi4WNMFcaQ/lEDIB8H4xDsK4MQ5e5nZ4WNaw6uF15M=; b=ftn5eTY6ZFPQ1whZ0XqtTqckkjzXv7n2twmLw70AQCPcEeVeq7aSFAsxE1k4B2Oztd 3A32MFrq7Iee5gu5d0q5XTnF2zNSTiqCshjsb1CW50BJ2f/G/b1hn+loibcNdp/dCy3S 86l0TEb6WLFbhjbPG18dLpTgdgD7BYUUQwMGq2qQtivp62WLZSpoU5i6hvPfeDer/MGD Z8yFb79Z3E68FtgBNifKdu0hCNM1oI+4YTNrJkclOf3CN5dhbKyGeBIu848TKF/biGuE lOroFxhSQB/Mo+4tkMQJVSalgxc/HlFA0tc072BG7GQJbn6cWASja+XX/JKpFfn/F6w2 5Wvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si2766348edb.262.2020.04.28.23.54.24; Tue, 28 Apr 2020 23:54:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726746AbgD2Gws (ORCPT + 99 others); Wed, 29 Apr 2020 02:52:48 -0400 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:29059 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbgD2Gws (ORCPT ); Wed, 29 Apr 2020 02:52:48 -0400 Received: from localhost.localdomain ([92.148.159.11]) by mwinf5d18 with ME id YWsl2201j0F2omL03WsmNo; Wed, 29 Apr 2020 08:52:46 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 29 Apr 2020 08:52:46 +0200 X-ME-IP: 92.148.159.11 From: Christophe JAILLET To: richard.gong@linux.intel.com, gregkh@linuxfoundation.org, atull@kernel.org Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/4 v2] firmware: stratix10-svc: Unmap some previously memremap'ed memory Date: Wed, 29 Apr 2020 08:52:43 +0200 Message-Id: <43505dc3a4b405d1c7d4a0fa74c67eda3e8bdb75.1588142343.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In 'svc_create_memory_pool()' we memremap some memory. This has to be undone in case of error and if the driver is removed. The easiest way to do it is to use 'devm_memremap()'. Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver") Signed-off-by: Christophe JAILLET --- drivers/firmware/stratix10-svc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c index 3a176e62754a..de5870f76c5e 100644 --- a/drivers/firmware/stratix10-svc.c +++ b/drivers/firmware/stratix10-svc.c @@ -631,7 +631,7 @@ svc_create_memory_pool(struct platform_device *pdev, end = rounddown(sh_memory->addr + sh_memory->size, PAGE_SIZE); paddr = begin; size = end - begin; - va = memremap(paddr, size, MEMREMAP_WC); + va = devm_memremap(dev, paddr, size, MEMREMAP_WC); if (!va) { dev_err(dev, "fail to remap shared memory\n"); return ERR_PTR(-EINVAL); -- 2.25.1