From patchwork Tue Sep 6 15:38:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 9317373 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 33DF760752 for ; Tue, 6 Sep 2016 15:40:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AC2728DF3 for ; Tue, 6 Sep 2016 15:40:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F42828DFD; Tue, 6 Sep 2016 15:40:11 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC60128DF3 for ; Tue, 6 Sep 2016 15:40:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933357AbcIFPkK (ORCPT ); Tue, 6 Sep 2016 11:40:10 -0400 Received: from down.free-electrons.com ([37.187.137.238]:59276 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933412AbcIFPkJ (ORCPT ); Tue, 6 Sep 2016 11:40:09 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id 7FBF12EA1; Tue, 6 Sep 2016 17:40:01 +0200 (CEST) Received: from latitudeE7470 (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 3EF961BC9; Tue, 6 Sep 2016 17:39:51 +0200 (CEST) From: Romain Perier To: dsaxena@plexity.net, mpm@selenic.com, Herbert Xu Cc: Gregory Clement , Thomas Petazzoni , Romain Perier , Nadav Haklai , Omri Itach , Shadi Ammouri , Yahuda Yitschak , Hanna Hawa , Neta Zur Hershkovits , Igal Liberman , Marcin Wojtas , linux-crypto@vger.kernel.org Subject: [PATCH 4/9] hwrng: omap - Use the managed device resource API for registration Date: Tue, 6 Sep 2016 17:38:52 +0200 Message-Id: <20160906153857.5503-5-romain.perier@free-electrons.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160906153857.5503-1-romain.perier@free-electrons.com> References: <20160906153857.5503-1-romain.perier@free-electrons.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_hwrng_register instead of hwrng_register. It avoids the need to handle unregistration explicitly from the remove function. Signed-off-by: Romain Perier --- drivers/char/hw_random/omap-rng.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index d47b24d..171c3e8 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c @@ -381,7 +381,7 @@ static int omap_rng_probe(struct platform_device *pdev) if (ret) goto err_ioremap; - ret = hwrng_register(&omap_rng_ops); + ret = devm_hwrng_register(dev, &omap_rng_ops); if (ret) goto err_register; @@ -402,8 +402,6 @@ static int omap_rng_remove(struct platform_device *pdev) { struct omap_rng_dev *priv = platform_get_drvdata(pdev); - hwrng_unregister(&omap_rng_ops); - priv->pdata->cleanup(priv); pm_runtime_put_sync(&pdev->dev);