Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8390200ybi; Tue, 23 Jul 2019 07:45:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoOFnGGdSo755zFk9FZnHAKQCb0xcPhDlJrFmfH4SDBN2/rNqUyjxXAax8wChNL7UElFh+ X-Received: by 2002:a62:5253:: with SMTP id g80mr6094225pfb.179.1563893152668; Tue, 23 Jul 2019 07:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563893152; cv=none; d=google.com; s=arc-20160816; b=FcO1H5Ql6b6qaDXrnVwFiiBTxE+epurIx19P+livQ1RqnyYhjv6boymfE4YFMew2Ct pYHuLkmVvnGymtf31pXiKjZDoxMLqd7tzoIDmAyBmEENzxzFKSqDizfVXS1zFqy1Eunl uxwi3QhOpkEikHFjSMlLiBEvouUxDOMs7A9G9E4qYo6kQXXl7Xrf+ca7VsYbPhUFikKp lV47vb7bMtDln9tnFx9vCjrBj7f3NI5qT5GywkT+m/FPD7HPdSlfqMeneYeImt3crdIv URJxFHz5u4Tc9eYOmEupVhWQ8d270GBHDl0FjAbNR1FT2fyDD75QElAIqHBvCB8nV+2N xVzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=4QWiA/u7FUkm/LP2+FlraH63gXlLRpOie6WBL+YDZks=; b=kToLBSGbRDiBFmCwacfu4EEKykbDnUoL5WH2S1FEmYAyG2BMNRdieHW35TRpzu91z8 UqyVwj9ubrmFF+NrtrnbTeBuLdl9FPpCLcx/Y560nBOuCHQWJO4c3mFYWT8JRh086pE6 P3lZn1PxM+KEnBhIsiLm5eBr9Q7A26BN5FEbNJtpYcWUQbnbVpTTIW3gJ5+353mS49/P UkgWUBZEJFnKl+qGhFEqMHDukBO8LC0nGmXREiYXs7NejfqX16KkxsAvleY2o4aJGvWe OVH0ADz3a1rGoxSFsT/uYiIyXhuS4APVZM3CHjjLKa1ddhOeiEv+GOmDBd20PcODSygy 2GNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=c1pXgPiA; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si11794916pgh.434.2019.07.23.07.45.34; Tue, 23 Jul 2019 07:45:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=c1pXgPiA; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388257AbfGWHUw (ORCPT + 99 others); Tue, 23 Jul 2019 03:20:52 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42538 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388231AbfGWHUw (ORCPT ); Tue, 23 Jul 2019 03:20:52 -0400 Received: by mail-pl1-f196.google.com with SMTP id ay6so20271222plb.9; Tue, 23 Jul 2019 00:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4QWiA/u7FUkm/LP2+FlraH63gXlLRpOie6WBL+YDZks=; b=c1pXgPiAsMw1pk8bFK3PwA0hqGMc/sMpkQtw/FfggkERlGIWgPpZNFo/K4CSzw6hd6 +zz+DO4Bq011chyUgykYBW/IkBssKoYBjfFVYC1kredHk5WX1FmXs4DosE7MK1cerlGI wTU/dMy0KoS0rzhw4w/nFiiJwC7JNEC327bqEGrJQZrAfrJ39cs+2rQfU8ylPvzRK+QM 4afzpXrveZ3d9936OCfAJ7mRhYxKy9xZ5/Hp7WkO3w2hErwZqOUlEFaB14Lpv38NYXfO ZmQrd3mvX4gDwemKPKlxatRA0adWdrPQj/WycIIHZ+lLp6QJM0e6dVYom7AHafUlUbqD oG4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4QWiA/u7FUkm/LP2+FlraH63gXlLRpOie6WBL+YDZks=; b=NU0DVI8X+fBCb6xmvj3tVT4YzjmjBL7DbUIBw5AJl1iqajJPvF2kPu+eHVU0XdJ+r6 izZYNLLSg4iaZyGRhLMZokIZnUY1FwCNOHyBcgWa4JQjE7Fu86yEsUjee7dKNLGIqE1A cPM3ipIBV1DG5RTQL0t241dfKC5oteVkOYYqcppweKR1plRbhN3jt86DoxY4qGRUBkQV emd+wh76ZHTXVYuvUqfq+bwZPtoiiTq1a3qXFv9mxaHBgLBgciLesVw7VtG+0cAzPii1 mDlAZ63jHeCoKkSNf8iSZS33jQwVYqJK4mo2Niv3cKOdQLQ2wCmE5/NS5M74OCo+ttqw kiXw== X-Gm-Message-State: APjAAAWmJUzj2TS/MO57pOlAtmhXDE2gPcMQ5m6bXQjhfd/AMzc+oA09 ciFajWIuSk8xeZCyOJEuP9eRmIezMNo= X-Received: by 2002:a17:902:a9ca:: with SMTP id b10mr5633876plr.69.1563866451938; Tue, 23 Jul 2019 00:20:51 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id v18sm34217115pgl.87.2019.07.23.00.20.48 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 00:20:51 -0700 (PDT) From: Chuhong Yuan Cc: Herbert Xu , "David S . Miller" , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] crypto: atmel-sha204a: Use device-managed registration API Date: Tue, 23 Jul 2019 15:19:36 +0800 Message-Id: <20190723071934.12528-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Use devm_hwrng_register to get rid of manual unregistration. Signed-off-by: Chuhong Yuan --- drivers/crypto/atmel-sha204a.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c index ea0d2068ea4f..c96c14e7dab1 100644 --- a/drivers/crypto/atmel-sha204a.c +++ b/drivers/crypto/atmel-sha204a.c @@ -109,7 +109,7 @@ static int atmel_sha204a_probe(struct i2c_client *client, i2c_priv->hwrng.read = atmel_sha204a_rng_read; i2c_priv->hwrng.quality = 1024; - ret = hwrng_register(&i2c_priv->hwrng); + ret = devm_hwrng_register(&client->dev, &i2c_priv->hwrng); if (ret) dev_warn(&client->dev, "failed to register RNG (%d)\n", ret); @@ -127,7 +127,6 @@ static int atmel_sha204a_remove(struct i2c_client *client) if (i2c_priv->hwrng.priv) kfree((void *)i2c_priv->hwrng.priv); - hwrng_unregister(&i2c_priv->hwrng); return 0; } -- 2.20.1