Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp791381ybf; Fri, 28 Feb 2020 07:42:56 -0800 (PST) X-Google-Smtp-Source: APXvYqzzGNB/kb507W5DZLnHbiW5ea9d/OQYNwTqDlxIJeyh06IPZAB4XVaPSNASzBp2G2AmL3z7 X-Received: by 2002:aca:3194:: with SMTP id x142mr2330484oix.172.1582904576170; Fri, 28 Feb 2020 07:42:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582904576; cv=none; d=google.com; s=arc-20160816; b=UcUg9pLAwxwk7G+WcG9CfXw20ydtoCA1ERdEen5SeNs97KYXvmzDdqGOfGVtsU7Dn8 xa9ryY8qPevqvx6b6I0zUeaIv6jdiEgdSAfMxvHUS9ryw8bH3PCWLCWaSRMvz7jM4WhB Dpq10jdt+zG4atgN3z53vuNRlLI5WYwckwRXFwCmuolUW2QaNJbrVszpfvMkFfGL7lf6 cZlgG6AJdFiePVAxFWs8ww2QAFbVPU/LNSMKCRRMbtZsGIeqErqUSyIvrM1EbXZDe5Ab psNCsQm3c9qOs/zpORiSnp13ApqdyBrYsZF8UVpJZYIEi1i71azkiou5dNxSgbA65Jvp td2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=ufh6/9f7UQjn+9arPRj1c/9Z3GCp2z/Am5Y76SrZ/FY=; b=hMzzJ7EJuK+IV4QzgJUxto1v1cHQ36rCH/dvsMATHfhuur9+ReTUGvlkBFvECatbum Ene7ucK73XdrE9aN34ft2GSdejiyiyfMh/ogUyT025s9cDPeDlMDE5IXiVboN9yUkOFF 0S0gg+IS8OO9+XJca/KKXpwlsaIs0g4VH7dx0Pdmv1aHSaRwdLp47VhinbHORsC5L7Ak CNhj7H6IKjtICR9yBZ+380otEL1ZUFMKqk0pWfWqTLUfrBjcN4nCmJnK7Z9go+Ts4Kqd W93XAg3rdTRxQfcM3Z2o+666dKg44ipD31T8+HR5j3j5aU4vF2lroZJbqB91eZSqnjsN XuBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=j9vAS3FE; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s70si841822oie.178.2020.02.28.07.42.44; Fri, 28 Feb 2020 07:42:56 -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=@cirrus.com header.s=PODMain02222019 header.b=j9vAS3FE; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727386AbgB1PmU (ORCPT + 99 others); Fri, 28 Feb 2020 10:42:20 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:3964 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726940AbgB1PmS (ORCPT ); Fri, 28 Feb 2020 10:42:18 -0500 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01SFcchc002611; Fri, 28 Feb 2020 09:42:17 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=PODMain02222019; bh=ufh6/9f7UQjn+9arPRj1c/9Z3GCp2z/Am5Y76SrZ/FY=; b=j9vAS3FE6Q5wGWY6Lixa19TgB/e3FKKlbumsGDPEfO4RSgtVdDOC75378CLN7bUFXQgG JJUe+JjZOWp+2wYv5TiWV7C/vwl3QC265Fueu8oOUb0E9iRi7LKwE0r6bE5LSXcxCRwW QDi2UMOKvXZzVC3j8fLTKyV5FkYxYYiJ+ceR1aLnc10n4kFMjhrdAJnrJmd1fRkOap16 eE9bweH1zVQUoAUR7sS74qL1Sd7KWlOQpH16S56UhsTIvKGjTlxbNlg7MC9D76VFLVvI slf1o8V3smcnO3dbAZeQ0f0t90KJZAQzBK1cKyjxILiWLML22383o4PjK7sL6maY2B3H PA== Authentication-Results: ppops.net; spf=pass smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from ediex02.ad.cirrus.com ([5.172.152.52]) by mx0a-001ae601.pphosted.com with ESMTP id 2yepwmse6v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 28 Feb 2020 09:42:17 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Fri, 28 Feb 2020 15:42:15 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1591.10 via Frontend Transport; Fri, 28 Feb 2020 15:42:15 +0000 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id F02A645A; Fri, 28 Feb 2020 15:42:14 +0000 (UTC) From: Charles Keepax To: CC: , , Subject: [PATCH] pinctrl: madera: Add missing call to pinctrl_unregister_mappings Date: Fri, 28 Feb 2020 15:42:14 +0000 Message-ID: <20200228154214.13916-1-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 include:spf-001ae601.pphosted.com include:spf.protection.outlook.com ip4:5.172.152.52 -all X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=745 clxscore=1015 adultscore=0 priorityscore=1501 bulkscore=0 mlxscore=0 spamscore=0 suspectscore=1 impostorscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002280124 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pinctrl_register_mappings is called in the pdata case, however a call to pinctrl_unregister_mappings is missing causing the mappings to be leaked on driver unbind. Add the missing call to correct this issue. Signed-off-by: Charles Keepax --- drivers/pinctrl/cirrus/pinctrl-madera-core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/pinctrl/cirrus/pinctrl-madera-core.c b/drivers/pinctrl/cirrus/pinctrl-madera-core.c index 7b6409ef553c9..dce2626384a90 100644 --- a/drivers/pinctrl/cirrus/pinctrl-madera-core.c +++ b/drivers/pinctrl/cirrus/pinctrl-madera-core.c @@ -1073,13 +1073,26 @@ static int madera_pin_probe(struct platform_device *pdev) return ret; } + platform_set_drvdata(pdev, priv); + dev_dbg(priv->dev, "pinctrl probed ok\n"); return 0; } +static int madera_pin_remove(struct platform_device *pdev) +{ + struct madera_pin_private *priv = platform_get_drvdata(pdev); + + if (priv->madera->pdata.gpio_configs) + pinctrl_unregister_mappings(priv->madera->pdata.gpio_configs); + + return 0; +} + static struct platform_driver madera_pin_driver = { .probe = madera_pin_probe, + .remove = madera_pin_remove, .driver = { .name = "madera-pinctrl", }, -- 2.11.0