From patchwork Thu Nov 1 07:19:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10663593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D02213B5 for ; Thu, 1 Nov 2018 07:19:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDF582B997 for ; Thu, 1 Nov 2018 07:19:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D11682B9B8; Thu, 1 Nov 2018 07:19:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 74B2D2B997 for ; Thu, 1 Nov 2018 07:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UM8LqNW5qp7ihLeC0krrsM8Y8RlUSAzkzjHQF+5skuE=; b=SdpmCp+wf0yMBa dfBTN/S/WC94lcS7zeUzbh796xFfxGE2hLPFDMntqfaP9UqHFPiRzloWXivclCZ6lVnAbWLYTpMB6 GHLT92z3Kg/jFaAafxlQ+ptLYRX77+IVxgqIrWkafSiWG1UJUGZn6seS81eKazziD+Kd3nTiyE5/S FgnSrIx+6EWgX6IDXzF+7Hve3xirRYkrHAbltTuPvIJRZjO01EDKFHNPvxdIFB2kxna+f0QQeKAC9 40t/1ti5CXpyo/xhcUTjDnasT4XIqetoj1tEM9x65lX6dvPsGqCA1ru82toJZVkQA5guTsvPqXkTw z4my035Z7+oK98HUoEaQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gI7Gf-0005mE-Gu; Thu, 01 Nov 2018 07:19:49 +0000 Received: from mail-lj1-f194.google.com ([209.85.208.194]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gI7Gd-0005j3-2G for linux-arm-kernel@lists.infradead.org; Thu, 01 Nov 2018 07:19:48 +0000 Received: by mail-lj1-f194.google.com with SMTP id a28-v6so14152378ljd.6 for ; Thu, 01 Nov 2018 00:19:36 -0700 (PDT) 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:in-reply-to:user-agent; bh=yodtWAaw5BTk3hbCqBw9o101omzQN2QDRD/joFnNkiA=; b=dsiFoqzvdnufcBElli/YihAhUni3NJddnC2RxC+f+RfnTnYiW5CYxhqcviruiRw6S7 zWL3B7CjO/PKS1DgG4LYEHYiNm2tE2nEaaJMw+JXLIOxJVdOkrF98LJnVTG8lu19re+B VQ2A5sinN8AuDld3KzK4RYZoecbZhbiScQSjfEHVDvNAE8MagHFSIjf3q+cUH1dGKgkk mOYBYFK/TlJMkbWQIbwq2hwnmHWftXk1V3ptbo1JNkS9GYlVf2Ha8m7Xkpvmu9+jCGaw 9dWE6MRWVUmwDWotFwrO0yNbb9vKWU7/Xr04Toc69/p+bpKelDxvB6R4YAJrEPmgtvhr epIQ== X-Gm-Message-State: AGRZ1gKM8Vj5OcpvdN9lEOO0eLNBhOmS9mUcmWzKF6LBY8tH8XWqCN+6 MTR2iZFgXPv3KI+ebb/wS78= X-Google-Smtp-Source: AJdET5eUuISbkUGNn72cxrLKDqXMAfSvg/3aJ2eYCd4be5+L8XJkHeHpMYROEMUbhtnFkEkjQBnxJw== X-Received: by 2002:a2e:4408:: with SMTP id r8-v6mr4407134lja.21.1541056775260; Thu, 01 Nov 2018 00:19:35 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id w13-v6sm3340046lfc.61.2018.11.01.00.19.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Nov 2018 00:19:34 -0700 (PDT) Date: Thu, 1 Nov 2018 09:19:22 +0200 From: Matti Vaittinen To: Jonathan Corbet , Michael Turquette , Stephen Boyd , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Russell King , Andy Gross , David Brown , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Andrey Smirnov , Sebastian Reichel , Guenter Roeck , Rob Herring , Matti Vaittinen , Huang Shijie , Akshu Agrawal , "Rafael J. Wysocki" , Daniel Kurtz , mazziesaccount@gmail.com Subject: [PATCH v2 3/8] clk: clk-s3c2410-dclk: clean up clkdev lookup leak Message-ID: <8e396e22b328f35538a01193797fbd0d001f885d.1541054985.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181101_001947_109770_9D450569 X-CRM114-Status: GOOD ( 14.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm variant of clkdev lookup registration in order to avoid clkdev lookup leak at device remove. Signed-off-by: Matti Vaittinen --- drivers/clk/samsung/clk-s3c2410-dclk.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/clk/samsung/clk-s3c2410-dclk.c b/drivers/clk/samsung/clk-s3c2410-dclk.c index 0d92f3e5e3d9..07798debfec4 100644 --- a/drivers/clk/samsung/clk-s3c2410-dclk.c +++ b/drivers/clk/samsung/clk-s3c2410-dclk.c @@ -309,16 +309,17 @@ static int s3c24xx_dclk_probe(struct platform_device *pdev) goto err_clk_register; } - ret = clk_hw_register_clkdev(clk_table[MUX_DCLK0], "dclk0", NULL); + ret = devm_clk_hw_register_clkdev(&pdev->dev, clk_table[MUX_DCLK0], + "dclk0", NULL); if (!ret) - ret = clk_hw_register_clkdev(clk_table[MUX_DCLK1], "dclk1", - NULL); + ret = devm_clk_hw_register_clkdev(&pdev->dev, + clk_table[MUX_DCLK1], "dclk1", NULL); if (!ret) - ret = clk_hw_register_clkdev(clk_table[MUX_CLKOUT0], - "clkout0", NULL); + ret = devm_clk_hw_register_clkdev(&pdev->dev, + clk_table[MUX_CLKOUT0], "clkout0", NULL); if (!ret) - ret = clk_hw_register_clkdev(clk_table[MUX_CLKOUT1], - "clkout1", NULL); + ret = devm_clk_hw_register_clkdev(&pdev->dev, + clk_table[MUX_CLKOUT1], "clkout1", NULL); if (ret) { dev_err(&pdev->dev, "failed to register aliases, %d\n", ret); goto err_clk_register;