Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3858865ybl; Mon, 9 Dec 2019 01:02:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxaXDL5QHjeHP9fuQjl0y354/N+E4UQsRZvAoYuRvEoHxddCmqnaKziYsnTY4vrRmgN4RLP X-Received: by 2002:a9d:7c91:: with SMTP id q17mr19538474otn.70.1575882162122; Mon, 09 Dec 2019 01:02:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575882162; cv=none; d=google.com; s=arc-20160816; b=pGG26S15nC9qSSz92B53QePcovbqbzr3f24lM/VaWWMxkeJZT0Ok8wa5VkwX6LZOb/ OreO2E98Y7Cdsh95N1NZDi8koJ/XFvrl0uFK4smda325eyGrcsW1zDidbQcmSwPpDd5X /58TQ3xanIJxHfXDr7Oc81SfGWaU/2jlZH64ImG8MlJ9mTa7IOFVW44VNrHR90kGYYgr ILMP6dzaycJ7C6KtJX2TWsytWczxtwgQ1/JfxXSVC4MTEsT/duUayBusiGTffG0AKZMy NB3LFSRitrW5bTETFmPQi35incGdep0OQMoysXedlfBdY6kJeQ52UnEAJwf1Jb25a0e8 jmJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gkH5Q1TDIhutmwVILX/T3rPDHFrWSbZAiAIDjIzKqME=; b=NrqSAqqbh+2VC1dcdZdOBMEmOnnRwq8PQyaMp/7uT5qNUzdu+nr3AzykLcE1ZdW1Rr YjSEf7nqjAXUl5IWRwRqlf+cJC/Ux3G+B/iE92GFxKreRdHdhNNcVh5rl0NMhHmlcXGh nFNRptBVc96mFDheAvUFErw2vdfuR71ZaPsA5DYbNG9S+wVdcKrfcC9rzunZr/mAE/HV GZzJ4kLKt6AooJj4dfv3jFYRLYRwiig3WrznOuEeE2VVnvdfaMmgyFBRVDpDdfoV5IlU 2v7w+r+J+gb0pl/WZXa8Z1rKnFJWNcRZM71EbQEsCmcheg3S/B0i8UWq5jQe+mZfaEXG OWMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NmNUfmS7; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si4410707otk.84.2019.12.09.01.02.25; Mon, 09 Dec 2019 01:02:42 -0800 (PST) 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=@linaro.org header.s=google header.b=NmNUfmS7; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727394AbfLIJA3 (ORCPT + 99 others); Mon, 9 Dec 2019 04:00:29 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46832 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726377AbfLIJA3 (ORCPT ); Mon, 9 Dec 2019 04:00:29 -0500 Received: by mail-wr1-f67.google.com with SMTP id z7so15141819wrl.13 for ; Mon, 09 Dec 2019 01:00:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=gkH5Q1TDIhutmwVILX/T3rPDHFrWSbZAiAIDjIzKqME=; b=NmNUfmS7PtRbGmJj1h58B8NvLJb8RwTIrnaF03qB9TYrNgwdcLO4PzqTkwJaXexQMR jRkPyNrCpTNYQbFMsyyQI/zidB1NZlv7BxNJ21tklQfvWbHSCinb0WAk3njzcSc671Ti NT6A8SeeJzsX9g/txt0Hu32WFHC8gvCfpUxgafdmjoLK5B4S+0jjXeDiq+PffnxAgeQr oyz3Q//7zOAt3X4GIp/4joZW7KSqVFd31mAPSqGaPTgKilcVj1+YlnLKQWMx00GGShu7 k5+0ppXzi1QzUFxI1xX1Ulajt/1/HzFW6mdqrcdobslGAXVG/nFOJBhz+41aEcEmbkVk fMYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=gkH5Q1TDIhutmwVILX/T3rPDHFrWSbZAiAIDjIzKqME=; b=B6p2mHR/g6lO6jdopdlLCy4GibmNQbDf42pKVF0JQVhYmmJYwBVp6zV8Tuo8cpOG3d dEdydJ7jzWYWVv8MMq7WCbMJQUILu9z9FygiU7pThVCCRa0n1D99ZaJlklXX9f/Yjbje 5q/pMc6mKnWrWkLcmlYlUg/NlXIg1dd9fOltbZ5O1HLLW+KLKKAhEx+NvAOZuRt/p0gR 79xxSnx8wRo3QdljhTILNpeJGvLIHIMsLnYh5EdwUXeypCQaRwqwTrPN7F8ilf5FwAKw YsJtBXHC5pgKQF4s2qQowCdLLvxfjX7nT8H0qpgXdX/JnMsGBcly0Am8NLOly3Pq0eZY ivqA== X-Gm-Message-State: APjAAAXTFJPy3LKMePIGrn2Zm5NamViouijY3qpThJMo6l0iEfXUHzHx cDQYjgeHlOew9xJGjBd4h/PMwQ== X-Received: by 2002:a5d:6708:: with SMTP id o8mr829863wru.296.1575882027154; Mon, 09 Dec 2019 01:00:27 -0800 (PST) Received: from dell ([2.27.35.145]) by smtp.gmail.com with ESMTPSA id w19sm1965157wmc.22.2019.12.09.01.00.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 01:00:26 -0800 (PST) Date: Mon, 9 Dec 2019 09:00:20 +0000 From: Lee Jones To: Chuhong Yuan Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] mfd: sm501: fix mismatches of request_mem_region Message-ID: <20191209090020.GG3468@dell> References: <20191116151308.17817-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191116151308.17817-1-hslester96@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 16 Nov 2019, Chuhong Yuan wrote: > This driver misuses release_resource + kfree to match request_mem_region, > which is incorrect. > The right way is to use release_mem_region. > Replace the mismatched calls with the right ones to fix it. > > Signed-off-by: Chuhong Yuan > --- > drivers/mfd/sm501.c | 19 +++++++------------ > 1 file changed, 7 insertions(+), 12 deletions(-) > > diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c > index 154270f8d8d7..e49787e6bb93 100644 > --- a/drivers/mfd/sm501.c > +++ b/drivers/mfd/sm501.c > @@ -1086,8 +1086,7 @@ static int sm501_register_gpio(struct sm501_devdata *sm) > iounmap(gpio->regs); > > err_claimed: > - release_resource(gpio->regs_res); > - kfree(gpio->regs_res); > + release_mem_region(iobase, 0x20); > > return ret; > } > @@ -1095,6 +1094,7 @@ static int sm501_register_gpio(struct sm501_devdata *sm) > static void sm501_gpio_remove(struct sm501_devdata *sm) > { > struct sm501_gpio *gpio = &sm->gpio; > + resource_size_t iobase = sm->io_res->start + SM501_GPIO; Shouldn't this be 'struct resource *'? -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog