Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp305483pxb; Wed, 4 Nov 2020 23:53:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2Wlxyiee7Kr6O2lAnNULtiin4Vgl4dpQx/JT+Q/DYjiP3oyq5JleIh3yenXHAxHGa6lu6 X-Received: by 2002:aa7:d787:: with SMTP id s7mr1237842edq.205.1604562788879; Wed, 04 Nov 2020 23:53:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604562788; cv=none; d=google.com; s=arc-20160816; b=dZ4uldxNMCE8mFySIHgxBrbG3QHrv0og6gvPb7cxJqCkq6KBzzuOUBB4epFOUPKCS9 tlsN2pR5dx8psHHMNoCDMZnSTfuH4O91HiVLkaPaCSu/c/m+HqFIz/Y7kb/Z7mL0Kc2h fMdvziYmXvLpjwMMbhEs7USN1jZi9us8wnsSTTrWPUSQlUQgWAytOET9yioGd65rjD5J jOddRcLCMS6WHiimW2aqeEh7mWNjOy/AbMnhhss0KB2Dj7l2ugy8tj5sDXUqYGwB/m2g yHO1/X7IL9Et6Eh0+YQG9FaAkF0G9YzeuHT8h+SdvO9s7MFpa2+SwSG/RmD00jfZvCCI Xr6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=y9nYMNipFWE8sSkn1Vl8PkFScRN6z5TpxXpkMWetXpU=; b=SIr1/4Neg1+++7yk6zuB9SdkJUkv16Y3U7/sCJYULJi9+ROG0ERS+YQsdRF+YB6hYI 34bcVEVNXr08OGvyBGBelEDdD91DSlyroSDwVbzk5HtcuCBGPeVPSmn4RBodoqm4Smd7 WrwrGJgBRxCYoArmr34Yn9DVTxtzq+80xPMkwL7kw+nGg7ehuN+QRzh5sajm5bGQo69R G8ZVdvfMTU8SNZMjptTRG1LWyzjlGmTqsimB4dlsEw9DotXPlLubI6zXB8lj/Tmip9ZX oBzP9YK4681E/SnTSguOT1iDoFUpkncEwElDgLTYEJu+lvIWjYYBRWb6IolQxaAiuwBk SiUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=EcKDtfv4; 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 y22si651758ejc.23.2020.11.04.23.52.46; Wed, 04 Nov 2020 23:53:08 -0800 (PST) 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; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=EcKDtfv4; 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 S1729779AbgKEHvD (ORCPT + 99 others); Thu, 5 Nov 2020 02:51:03 -0500 Received: from ssl.serverraum.org ([176.9.125.105]:53821 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725287AbgKEHvD (ORCPT ); Thu, 5 Nov 2020 02:51:03 -0500 Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 8CFC322EE3; Thu, 5 Nov 2020 08:51:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1604562661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y9nYMNipFWE8sSkn1Vl8PkFScRN6z5TpxXpkMWetXpU=; b=EcKDtfv4J8/6mEv4+l/JnAIjw2EfFpGZbPhRTvUJxHMf/xSCy0jvF90Prq51i4SLhoWCBx o527QJDxBJ6k3M7cpXMX3bGoOFnSesN38eVWUdreIdKfvnWX8Yd1S6XTkKbhmIG8GJcADN HwxhyugtauPxeyIRfrrC8bngWYlKxog= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 05 Nov 2020 08:50:59 +0100 From: Michael Walle To: Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Turquette Subject: Re: [PATCH] clk: fsl-sai: fix memory leak In-Reply-To: <160453619129.3965362.7473462251338349415@swboyd.mtv.corp.google.com> References: <20201101184818.2754-1-michael@walle.cc> <160453619129.3965362.7473462251338349415@swboyd.mtv.corp.google.com> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <93b003ea4b80e0b6ec3eb63288e028eb@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2020-11-05 01:29, schrieb Stephen Boyd: > Quoting Michael Walle (2020-11-01 10:48:18) >> diff --git a/drivers/clk/clk-fsl-sai.c b/drivers/clk/clk-fsl-sai.c >> index 0221180a4dd7..1e81c8d8a6fd 100644 >> --- a/drivers/clk/clk-fsl-sai.c >> +++ b/drivers/clk/clk-fsl-sai.c >> @@ -68,9 +68,20 @@ static int fsl_sai_clk_probe(struct platform_device >> *pdev) >> if (IS_ERR(hw)) >> return PTR_ERR(hw); >> >> + platform_set_drvdata(pdev, hw); >> + >> return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, >> hw); >> } >> >> +static int fsl_sai_clk_remove(struct platform_device *pdev) >> +{ >> + struct clk_hw *hw = platform_get_drvdata(pdev); >> + >> + clk_hw_unregister_composite(hw); > > Should we add a devm_clk_hw_register_composite() API and use it here? > That way we don't need a remove function and devm can be used > throughout. Can do. But does adding a devm_ function qualify for the -stable branch? Or should I expect to have exactly this patch as a backport there then? -michael