Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3185565ybi; Sun, 2 Jun 2019 09:00:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCq6NeHi/hf49N1sTePMtAZlJE4bmjRfvzPs1IBBQkMoSqPXLrK1lqG8RxFQqkxG+aaoEY X-Received: by 2002:a65:6559:: with SMTP id a25mr22796444pgw.33.1559491247792; Sun, 02 Jun 2019 09:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559491247; cv=none; d=google.com; s=arc-20160816; b=zPsQ46YYHNCP+K06TCJP7l1ypWdN68/IgM++eVmp0+sRIakdlXZ2IttyaI78yeKzzy IliTeSz2whMpz6da3svmXRA42+1s19wZga3KqLsSZrXs6gPR2u6M94SzBhojuQtlLzsa h3/p2annnhSjmWAe4Nrk7mQVopr4CWT4FmoEKe7ayZ669cF1qmnsWgdR2Ir5wabPZt86 258PA1q3LiUw2/73jQSxJRKfbM18seonKq1ttHux/AUfd7yxwU3iuiWspXOD4lk9fJ5b KxczFc92PMiNQbVwbEu7wwbXQ0NBCe7UjZJtq93lfiqpHU3sXmpcOKm01VAixXi8VMQc cHYA== 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 :dkim-signature; bh=KoiwGzojzqWS04G3Vtf6A7KlpS48j88h/ZjvUsdgYpw=; b=ATi0vEtgVQDQgKLs7UXH/yJWewwuldcJZye/ZhjGLChAdE3fwVaowHvn5OP6BRa/I0 5rskJE7LXU2yuCzZ1ZP+pxxdjBKrE3tpzIsTV83b4lPdTnzk0m9o5azhe8HNeJezr/zz Kkez4vPRD/ixhL0piJDDUNrCdQeMssEHHDRZGEhfPXskPAO7gDaod2Wu1iE0NpZ1+VzJ rDy4QhuFL8w/dgndcGNQXWoroymGTGKCqK5VxPddtXISAyCtVTfScNh4n7HHuaapirwF 8RTivUbJODomJgN5s7ErvztsjO2SSqQgby+EBTXE5JUXSde9LcJ3SVAPBmioCG/Rmm2Z H7sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tR9j48sC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15si17293611pfa.85.2019.06.02.09.00.31; Sun, 02 Jun 2019 09:00:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tR9j48sC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbfFBP7X (ORCPT + 99 others); Sun, 2 Jun 2019 11:59:23 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:39551 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbfFBP7V (ORCPT ); Sun, 2 Jun 2019 11:59:21 -0400 Received: by mail-qt1-f196.google.com with SMTP id i34so6816994qta.6 for ; Sun, 02 Jun 2019 08:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KoiwGzojzqWS04G3Vtf6A7KlpS48j88h/ZjvUsdgYpw=; b=tR9j48sCzJxSI0PhXjlAQsYW+PvL/Rc1czHdQ6+7kWZVEpCAQfCujqP1Hdi1ibUKK7 cyj2Hbc5Wia9wlPPdqlFNARCcRuoDM6wF5JoMM8nZjjhS5+0nv1MBUxXqTvibDs5Sg/X GxrF/9DLeRU/NJcoT8w/lYv4hnLAWCko9005beumexent1mM/ZjPHWaIonvWfULVVaLw gkCZJPk++9V/AFD40d9JNbwLh97gJhKcRIxWQ9XZQXa5qfErF9gawbxCRfNB/S59Q8V/ xu10VXl30gsuboKcd26fPC5gw1BhhlbBQe+Lr16iAASQRT2OMobjTgiaDby/izR6mThC iKog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KoiwGzojzqWS04G3Vtf6A7KlpS48j88h/ZjvUsdgYpw=; b=bqIT7rkbSuIfgT5+Yedzg1X6xB9KgJ3YKlqRCpZ7dVZKaStKsSZkiO8aUF9qi7zVKP SaSuMWb7THYIjSMTYG0zQdmj0mKe+DSlmn3/Rqi24CYp3lJRkoZlv0TuFLkiKxBXPKUc 4RqxlEuw7XXbwbJZDllucAlbGhG6rjolXf+Lzw2IMZIFX3MZFY6tdQm2PynYVurZabeq SFUU5aHzt0Pxo2jUHnnTji9YJMwQW/ELDj7jC7Tx4+tJzAGf7VCuAbYDC3X3O39NKDwt ML0LhQX+rCzE6ooX+tPP5rtGadt0JcWGoEOXtkcFDB9WikDHQ2lXRhay7sg0b1wcbZ4p FCng== X-Gm-Message-State: APjAAAUL6JnXgDcIMOcQJSsehOgg+bXIwWHUpYSUBGCgrlwyaXjijrkY S5qyPV2PicT/OC+6nfirSgw= X-Received: by 2002:aed:38a1:: with SMTP id k30mr19835361qte.159.1559491160182; Sun, 02 Jun 2019 08:59:20 -0700 (PDT) Received: from arch-01.home (c-73-132-202-198.hsd1.md.comcast.net. [73.132.202.198]) by smtp.gmail.com with ESMTPSA id n7sm7378589qkd.53.2019.06.02.08.59.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Jun 2019 08:59:19 -0700 (PDT) From: Geordan Neukum To: Greg Kroah-Hartman Cc: Jeremy Sowden , Mao Wenan , YueHaibing , Nathan Chancellor , Geordan Neukum , Dan Carpenter , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] staging: kpc2000: kpc_spi: use devm_* API to manage mapped I/O space Date: Sun, 2 Jun 2019 15:58:37 +0000 Message-Id: X-Mailer: git-send-email 2.21.0 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 The kpc_spi driver does not unmap its I/O space upon error cases in the probe() function or upon remove(). Make the driver clean up after itself more maintainably by migrating to using the managed resource API. Signed-off-by: Geordan Neukum --- drivers/staging/kpc2000/kpc2000_spi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index b513432a26ed..32d3ec532e26 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -471,7 +471,8 @@ kp_spi_probe(struct platform_device *pldev) goto free_master; } - kpspi->phys = (unsigned long)ioremap_nocache(r->start, resource_size(r)); + kpspi->phys = (unsigned long)devm_ioremap_nocache(&pldev->dev, r->start, + resource_size(r)); kpspi->base = (u64 __iomem *)kpspi->phys; status = spi_register_master(master); -- 2.21.0