From patchwork Sat Feb 18 20:55:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13145630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 126A2C636CC for ; Sat, 18 Feb 2023 21:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:From: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=r4b24tgvbN1QinFVtMVOHEOWiSE06Tqi3FeaazLP+j0=; b=JJI8VIHYZXR1ek eJfHECJIJLXvmQXrVPUDDDCJRsH+qhwNWEjln06etPL0EWsYUrXf0uBhUPOZyke+NAINQcs36M/0O 0dzSDkL1bPzA5C7Vqk9X3HX827miGtg+3SU3MO+THQsD2O2IpziQhX+FObZ/eiMfIOl1PvgJ2KuDW 7Rni+cABkUZSiduk41xnUa+3ua+u2hppGyWh32BW8zjeuszIp7mUzSQjUzArW8lgWbGrujg9MeaWC M9qEFuCvqXE5N/rqyZzLeGK6hIuJ1dEPILy8qCs0UrqY/c+Ne/3HWtLIlidAVXooQ1HjyVfLplYAT LZZIm2hXhk70F0qhw5Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTUJE-0006D3-ST; Sat, 18 Feb 2023 20:59:52 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTUIt-00068C-9Y; Sat, 18 Feb 2023 20:59:32 +0000 Received: by mail-ed1-x535.google.com with SMTP id fd2so5346181edb.2; Sat, 18 Feb 2023 12:59:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=0QTO9PpApH85uzwvnB99HB5hu6zu/FbxafdLqyL29Co=; b=d+ccR/0D22hSA5kCVrSjDpZIOSfgkYctT3r2H8LEPv5Sv5egD9jlKCfSt8ALY+6wPI Xi2vsWD0sHItyC48fZVquxpOUnsiRll6ZOBc/f/CMw+t4N0hX5TqqpDhPYSFh8eNfXnf evuZDeYi8/fgFpvN/fZCFfaIn5HBB+uNxmz/316Fb4g1jOvt7iSdxRoJncXjTTRtY55f 0TL2uIMVHWzKa8I1qACp5dGDXBFvohIMcLnMDwjnOCeR3y/Vmrb1TweKvilO7B2PE67l Z+TnCG5yFHEIC0WnA0mL4W52T+7qniFvmpVdcD6Re+ziHouevcp8xbMQfp6CWtnT6Gja NHhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0QTO9PpApH85uzwvnB99HB5hu6zu/FbxafdLqyL29Co=; b=rJx4F3YbMFXfcwqQcYo9le4sklG2bWlWpkfKB9ifeQ+zeoqKlqSU2Lq1YhiKkw+BfY SK/8yOLC8dUlZ/2eK4BMekX97YExtQ7Hx5HgQGVMnCKiUMNP6w2bKPihNSzZmbFa1KgG y7MVXqlvgQ8S8XsRJyI6QTDi0Te4IclIwmvS/hwQQXgYenjKnkg7+mdy7RladNWpSiba lI5E8MHjArF2yguC/5Cqpd8wvAjLQCwbY157sWmiUA6pXAJJahqRAEWX+Lm3F1Ok/WwG pZAGoD5e4Hk1zRUahlP/o6KnzBUUhkt0rwnd3e13noN+JBOaiBLToX/aoqgcOnPehlK+ DEqg== X-Gm-Message-State: AO0yUKXndORgF1V2JTLzot/licapyihV4x/j3J6KjbrJ+v0GMHuQur7p wfhSV607mgguPzBJUtXxqPU= X-Google-Smtp-Source: AK7set/dc9CZIosai3n1UIgyVUHTcMBDJdwpKTJKT2OsjIIjpXeznyAsfrrChlPzNtdR+d71IHx4pA== X-Received: by 2002:aa7:c2d3:0:b0:4ad:7bd3:bb44 with SMTP id m19-20020aa7c2d3000000b004ad7bd3bb44mr6597778edp.35.1676753965050; Sat, 18 Feb 2023 12:59:25 -0800 (PST) Received: from ?IPV6:2a01:c22:7b82:af00:2955:cfd1:cf55:9ea? (dynamic-2a01-0c22-7b82-af00-2955-cfd1-cf55-09ea.c22.pool.telefonica.de. [2a01:c22:7b82:af00:2955:cfd1:cf55:9ea]) by smtp.googlemail.com with ESMTPSA id f29-20020a50a6dd000000b004ad6e3e4a26sm3628583edc.84.2023.02.18.12.59.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Feb 2023 12:59:24 -0800 (PST) Message-ID: <08fa1416-8786-b442-2a45-0ba669992639@gmail.com> Date: Sat, 18 Feb 2023 21:55:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: [PATCH 1/5] hwrng: meson: remove unused member of struct meson_rng_data Content-Language: en-US From: Heiner Kallweit To: Olivia Mackall , Herbert Xu , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: Linux Crypto Mailing List , "linux-arm-kernel@lists.infradead.org" , "open list:ARM/Amlogic Meson..." References: <26216f60-d9b9-f40c-2c2a-95b3fde6c3bc@gmail.com> In-Reply-To: <26216f60-d9b9-f40c-2c2a-95b3fde6c3bc@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230218_125931_366753_D3F5486F X-CRM114-Status: UNSURE ( 8.34 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Member pdev isn't used, remove it. Signed-off-by: Heiner Kallweit Reviewed-by: Martin Blumenstingl --- drivers/char/hw_random/meson-rng.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/char/hw_random/meson-rng.c b/drivers/char/hw_random/meson-rng.c index 8bb30282c..e79069b6d 100644 --- a/drivers/char/hw_random/meson-rng.c +++ b/drivers/char/hw_random/meson-rng.c @@ -18,7 +18,6 @@ struct meson_rng_data { void __iomem *base; - struct platform_device *pdev; struct hwrng rng; struct clk *core_clk; }; @@ -48,8 +47,6 @@ static int meson_rng_probe(struct platform_device *pdev) if (!data) return -ENOMEM; - data->pdev = pdev; - data->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(data->base)) return PTR_ERR(data->base); From patchwork Sat Feb 18 20:56:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13145631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30F15C6379F for ; Sat, 18 Feb 2023 21:00:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:From: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bdBT9rwbAUDcOI64B1U9BaWYJr2defVoMFuQVGddIfc=; b=HynzqxjANm33r0 mjTq73JKADR2RStgYOkvGEWtO89SkHK2wARo0M1V+/pXPEGSBdL6gju0by4e4+HxGLThpQWiiiA5N cbyhCDzNXTILyJCnJn9oQRh6ngWG252g9Uo++Z93VUKcgJch7xKRBiTE9+7U45mDBhCPiJP0s8bFi o149RIA5+uiXSYq9U4KHxP3z71bUxFXAhnnC8pbM/ekj110tVc2NY7k0d4q+Nuknq4/D+2U3ZSgTk RvzTntzKdUEQhY9hYLywGe0TTFp6/spzIe049trA3oTt4uWHcMHHfoYOxlKOyVgiM1ZSlp36cxUTc S1W/38RhlqDtpUyTSsVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTUJf-0006PV-M5; Sat, 18 Feb 2023 21:00:19 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTUIu-00068H-Po; Sat, 18 Feb 2023 20:59:34 +0000 Received: by mail-ed1-x534.google.com with SMTP id z10so4913566edc.6; Sat, 18 Feb 2023 12:59:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=WdR42IB0NMvV6bLj/h4nCD5zMdmqmCIUqAFbenEs5jY=; b=dojBO0MiYR79MdvodHUNO3HcDuVwsneTZzbHkTbRl7v7la1fZAKaAArywlObWLMFzt O2FA6+fgDCKzhYC8iS8LVKClgJzXTtTEdPRdu5mB1h2GmuLLuyiv8uHkBayR20Gltt5V 3d8BEOWpUmBM9/uNxGYFkbXrZMI7oToWwkvlMV5WWrXVhLBPL0gLAEMh49m9HNWe8ffA MfYJaz6TXqVxMb9i14oLKeK7rIo2eQFvWAgcaJtjnsffWqT5cwJVk9StbcRfGZR3k5+h iRYcvsczzPzQNhdLxeEXrcGUcnsCoyHTUks2kUQgr7qiJJdc5heWGK6oP3lWlEVGZmYH I1dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WdR42IB0NMvV6bLj/h4nCD5zMdmqmCIUqAFbenEs5jY=; b=vkDjAspePDvuTxvK6k7jvnPFZfIM1ECLNk+A9nEQ/QJpBnE/u400sFUU5wqxTS+/4d SAAoA1hfDa+3GfHbiAysmABwMengw36GcjrY+PwaHCWLx6vJVqBnKiFGV+EKRUXrMaU1 l2cStK++vy0Pt770cqqQ9sDP88/nYyXIovN6BHqHhNEuyCAZ+CkZ43Kp0dEpIpi3y3As wDw3bWKHHT4tX18E8kBg/rfXWkaEvNgfFZgVi1Aa8jb3JDMoKOnRK8FS5mP4/FZdtIHH BK6vSTtCmc7jAnGYVPJaMBp+XH5TA9GrErxBq1eGMzEVOwSEd3UmbIjQcweiOjth+V6/ 4a1g== X-Gm-Message-State: AO0yUKUrErj3ksQLZ9INizZfoHloQCr+aShKm5YwhLAYtGpm4U/C5ukr 8PWd0L49StqZs5QSXBxRYho= X-Google-Smtp-Source: AK7set9cn7AqlwQY14jsDUTgDMEHCJVp98ap0AM9NBu0+EJmF1xUaZbDvmql9CCf4iQ0SRty6XfT/Q== X-Received: by 2002:a17:907:33cc:b0:895:58be:94a with SMTP id zk12-20020a17090733cc00b0089558be094amr3758894ejb.14.1676753966699; Sat, 18 Feb 2023 12:59:26 -0800 (PST) Received: from ?IPV6:2a01:c22:7b82:af00:2955:cfd1:cf55:9ea? (dynamic-2a01-0c22-7b82-af00-2955-cfd1-cf55-09ea.c22.pool.telefonica.de. [2a01:c22:7b82:af00:2955:cfd1:cf55:9ea]) by smtp.googlemail.com with ESMTPSA id de24-20020a1709069bd800b008b13c87d951sm3804629ejc.146.2023.02.18.12.59.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Feb 2023 12:59:26 -0800 (PST) Message-ID: Date: Sat, 18 Feb 2023 21:56:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: [PATCH 2/5] hwrng: meson: use devm_clk_get_optional_enabled Content-Language: en-US From: Heiner Kallweit To: Olivia Mackall , Herbert Xu , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: Linux Crypto Mailing List , "linux-arm-kernel@lists.infradead.org" , "open list:ARM/Amlogic Meson..." References: <26216f60-d9b9-f40c-2c2a-95b3fde6c3bc@gmail.com> In-Reply-To: <26216f60-d9b9-f40c-2c2a-95b3fde6c3bc@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230218_125932_887390_C1E691D2 X-CRM114-Status: GOOD ( 11.10 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Use devm_clk_get_optional_enabled() to simplify the code. Signed-off-by: Heiner Kallweit Reviewed-by: Martin Blumenstingl --- drivers/char/hw_random/meson-rng.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/char/hw_random/meson-rng.c b/drivers/char/hw_random/meson-rng.c index e79069b6d..22e3dcc6f 100644 --- a/drivers/char/hw_random/meson-rng.c +++ b/drivers/char/hw_random/meson-rng.c @@ -19,7 +19,6 @@ struct meson_rng_data { void __iomem *base; struct hwrng rng; - struct clk *core_clk; }; static int meson_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) @@ -32,16 +31,11 @@ static int meson_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) return sizeof(u32); } -static void meson_rng_clk_disable(void *data) -{ - clk_disable_unprepare(data); -} - static int meson_rng_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct meson_rng_data *data; - int ret; + struct clk *core_clk; data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); if (!data) @@ -51,21 +45,11 @@ static int meson_rng_probe(struct platform_device *pdev) if (IS_ERR(data->base)) return PTR_ERR(data->base); - data->core_clk = devm_clk_get_optional(dev, "core"); - if (IS_ERR(data->core_clk)) - return dev_err_probe(dev, PTR_ERR(data->core_clk), + core_clk = devm_clk_get_optional_enabled(dev, "core"); + if (IS_ERR(core_clk)) + return dev_err_probe(dev, PTR_ERR(core_clk), "Failed to get core clock\n"); - if (data->core_clk) { - ret = clk_prepare_enable(data->core_clk); - if (ret) - return ret; - ret = devm_add_action_or_reset(dev, meson_rng_clk_disable, - data->core_clk); - if (ret) - return ret; - } - data->rng.name = pdev->name; data->rng.read = meson_rng_read; From patchwork Sat Feb 18 20:57:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13145633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2E8C9C636CC for ; Sat, 18 Feb 2023 21:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:From: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CL75Ef8MueFukvvt0Tj8hlAl8mw0Mxvv8aYd6y66GCc=; b=LL8Z3RmQLjNxS9 ZOMfM/ctmzm8CgJf6JAcv2KXExSyRpfab5JDu34lWfkaBgrX8eE2jTnWSeBPQLCe1rgMrstpYcWBc 31brkYqkX1PQeJr1pc0HAR6umtMZY/ELhGlwL1A8SWPhSj3OnTv27lrNB1imAXdb1AmwUYfItPgGj aamIHbH0+5kKs/0VBM4Dapv9al6or3J0sfKsqOVeReApHucgCZFSeyEWlUVtkGHn2Oe49KoPK7zhF 2l2QYObxlQYKdRsymMWU5QhZrjjgIYtZ0mmt0zDAQbV2FnRV/3r6fIHLoW1MCg0IgqRd1l3mD+97N Ve4J5OFw4V5uQKmnJgVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTUJu-0006WS-Aa; Sat, 18 Feb 2023 21:00:34 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTUIv-00068N-OI; Sat, 18 Feb 2023 20:59:35 +0000 Received: by mail-ed1-x52a.google.com with SMTP id fd2so5346459edb.2; Sat, 18 Feb 2023 12:59:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1CdgShzJsLfglTo1Xd8hw9nnwHbg4uyqhCM3K/USB0M=; b=J5nWCaZqzX/ZvFVcvj2Aiyl/2tE3nKuC6Cu1p4AccJHRmqBjypVHdWoXGMN3bU/WL3 Dz5ZUwBPcqm7BJhvP1pJvWcjckmmTYrwSP4RZyACmiam65fA4utvDdcYuFUpC46nKSf5 5nZ0DdBF7LMKduLKy9vVUZDADy1w+CPcM457qH2SzJompaBGiMEewf2vPD1BVqEmygQN E9B6RQ80LbJwLS5MVgl//+XaEgJGCcjZ6tQHO/HDdKTEJyP2y/KOTD9g2ft+k4I2H5fG JvVPoQGrBSy3xNjakAjnsh2jNwvVMBacVnv+B0Rgmck66c8EXb90n1tg7bNYXw9KzHss RESQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1CdgShzJsLfglTo1Xd8hw9nnwHbg4uyqhCM3K/USB0M=; b=znjFVMDYFnbmqUZ97rF1aJwkyfZl9DIEr0Xxc4G5J7FxStB+vuogCKqgxIp9OLTvpM wnpPC6eA86XlwFNRI6jGzP/SwCkFh0fph+dXqopdhOQBEkn67HI4UUP2uqAwS5LcckXn voJPEVBvJf8mM+Cykp8OJBLE0BEOzEQXGHhnD5rm/cvp2enQOauflb4AWFVdaBT5QEgZ N9cF25cbkJ0VO9TNlwQHJzYM0bfCFF9BbhkgJZShLJokcfF3qr7o2NEfz6DOO1OzAUjX 1fVg7E0YDEafMzBIQvqNMdHS2JL06pSXxmLR7hdZ2moJ+b+vKML9hTCj5jOPgZW8myis zczw== X-Gm-Message-State: AO0yUKXEolFhESP5ZbaDPDdUr72TNmQrtNQZnLb2yq5rxTFpZin/Ma/1 1tPrMYY5erEhTWoN9VjeE5X0Ver6qss= X-Google-Smtp-Source: AK7set+pVqKO0qtR2rjMhz2whJ4ZFXhhPKg0n2vy/N4o4SSV+VoJpI48u988WW+cuxwn7blOgg6xFA== X-Received: by 2002:a05:6402:18:b0:4ab:4011:ff3d with SMTP id d24-20020a056402001800b004ab4011ff3dmr4876606edu.0.1676753968290; Sat, 18 Feb 2023 12:59:28 -0800 (PST) Received: from ?IPV6:2a01:c22:7b82:af00:2955:cfd1:cf55:9ea? (dynamic-2a01-0c22-7b82-af00-2955-cfd1-cf55-09ea.c22.pool.telefonica.de. [2a01:c22:7b82:af00:2955:cfd1:cf55:9ea]) by smtp.googlemail.com with ESMTPSA id h11-20020a50cdcb000000b004aaa4da918fsm3983907edj.45.2023.02.18.12.59.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Feb 2023 12:59:27 -0800 (PST) Message-ID: <7d1fc713-850d-d9cd-3fe2-60fd690f406a@gmail.com> Date: Sat, 18 Feb 2023 21:57:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: [PATCH 3/5] hwrng: meson: remove not needed call to platform_set_drvdata Content-Language: en-US From: Heiner Kallweit To: Olivia Mackall , Herbert Xu , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: Linux Crypto Mailing List , "linux-arm-kernel@lists.infradead.org" , "open list:ARM/Amlogic Meson..." References: <26216f60-d9b9-f40c-2c2a-95b3fde6c3bc@gmail.com> In-Reply-To: <26216f60-d9b9-f40c-2c2a-95b3fde6c3bc@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230218_125933_819490_28526125 X-CRM114-Status: UNSURE ( 7.43 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org drvdata isn't used, therefore remove this call. Signed-off-by: Heiner Kallweit Reviewed-by: Martin Blumenstingl --- drivers/char/hw_random/meson-rng.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/char/hw_random/meson-rng.c b/drivers/char/hw_random/meson-rng.c index 22e3dcc6f..a4eb8e35f 100644 --- a/drivers/char/hw_random/meson-rng.c +++ b/drivers/char/hw_random/meson-rng.c @@ -53,8 +53,6 @@ static int meson_rng_probe(struct platform_device *pdev) data->rng.name = pdev->name; data->rng.read = meson_rng_read; - platform_set_drvdata(pdev, data); - return devm_hwrng_register(dev, &data->rng); } From patchwork Sat Feb 18 20:58:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13145629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D209AC61DA4 for ; Sat, 18 Feb 2023 21:00:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:From: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ol82WoHOD0uQXalxBfWPCyKZ22Wv94PF2eOUuyS8q+w=; b=L1MBg8FSinADcR mIm+KT4tc7DrF7kyF0+SUS/j65n5nhZWLUirrVyttDLl52MFpMD6kGI6f1+NRqy7qlC1HRZAOu2Sf 1uvzijz48S+d+lVULXo/4PArFfRWZOlInQAO6lpiJajs3esXMvw0NOOEnVxraVNzDI0Yiz1hzfkRb 2qs/wjlpApkjvpuK6/EacmLEbxrArvfjS1KYiZdj5Uz/oM67Pjl7vCj1/u4f/y4iqALgCgNDeMlFD wyi+vvXJqvq12e/GJmmIDiSRkHLlTaLxWGdxYeh9/kikSVN430VjSx7MxPY2D+HdG+MF85c808M/+ z3ZSxHbHp28MDD+uU5VQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTUJF-0006DL-Et; Sat, 18 Feb 2023 20:59:53 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTUIt-00068T-83; Sat, 18 Feb 2023 20:59:32 +0000 Received: by mail-ed1-x529.google.com with SMTP id cn9so4962200edb.7; Sat, 18 Feb 2023 12:59:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=P1ozOXB1+zZ3Q23vSw9o85yMZkUJu05HyoWaZK330OQ=; b=o1OS4IpOoma7JtDQozUijuo160vnNSserkItANHAXJnEY+bNqmKGz1eWB0sLn6uT8p lkm+b74YtqgbYPPRES3X43AXUvPDfTJ8sU1mfOFlkQQu22lsMtzyrV+E0ilJjzJJt2S0 onorIRtTdKV/pq8s96rhJj6p5iSKFNKvKGSesT+OKQRPDiz0oBf8c8977UZ1nzRPU4Af J1b0WlvwWsi6P1Zlvov0tTeZQcj4COZ/gROZorWOtbyUYXSJw0pehhCwCxcYufTKvU38 /HbMHlygJxeMKx+j1kLSUdtfOwUPPzwvt6le/1yc0QB+kVc4jv2SOmRNKI88/KrdelqK S5JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=P1ozOXB1+zZ3Q23vSw9o85yMZkUJu05HyoWaZK330OQ=; b=ZBBJzaniMcrumDiRKYkGM11Md15b+j54WXT2mtPyPiBK8YUwSdSKzro3g3VRUdO9RB /1e+yVm6RXEWrfEcr17kq912SEiHcNYycJx1qZRcUsDVR0j1i7uNuutKCGyE4IzCa2y4 fq5hNIF28olQVd9uE17Fd5xjROY6uBeg5xXKhH1gAm+UaoYIHohhOPwLY2EsE8TebFvd n9wOGYL0a5efk2jPcpyXCnm3ujrnHlCvOmhPNupbgVrdWRDaq/uZGqvtsp6Kq1ItYPxn a7LdWUAhtHqsU/hwmrEK2OEpN5yGBpYOrFdy0g0VEs/lbqtAT5sQW10jaXQWhEU3abT+ Jtpg== X-Gm-Message-State: AO0yUKUzmz3ooVkQuiGoQ3wAW3fCLYVWSHi+w3cHKXicd2K1ijzTyGx3 KRza0pbK871Fx0zoDlISLh0= X-Google-Smtp-Source: AK7set+s82dof//uh76YWzHccMEghPUnl8N5ozBosD4OqaybacZZ7orcJqlrbF76QDPG5PD31rxn3Q== X-Received: by 2002:a17:906:3b91:b0:8b1:3824:1f58 with SMTP id u17-20020a1709063b9100b008b138241f58mr4478036ejf.21.1676753969676; Sat, 18 Feb 2023 12:59:29 -0800 (PST) Received: from ?IPV6:2a01:c22:7b82:af00:2955:cfd1:cf55:9ea? (dynamic-2a01-0c22-7b82-af00-2955-cfd1-cf55-09ea.c22.pool.telefonica.de. [2a01:c22:7b82:af00:2955:cfd1:cf55:9ea]) by smtp.googlemail.com with ESMTPSA id q11-20020a50c34b000000b004ad601533a3sm3695961edb.55.2023.02.18.12.59.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Feb 2023 12:59:29 -0800 (PST) Message-ID: <4dafc70f-be7f-bfdc-8845-bd97b27d1c4c@gmail.com> Date: Sat, 18 Feb 2023 21:58:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: [PATCH 4/5] hwrng: meson: use struct hw_random priv data Content-Language: en-US From: Heiner Kallweit To: Olivia Mackall , Herbert Xu , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: Linux Crypto Mailing List , "linux-arm-kernel@lists.infradead.org" , "open list:ARM/Amlogic Meson..." References: <26216f60-d9b9-f40c-2c2a-95b3fde6c3bc@gmail.com> In-Reply-To: <26216f60-d9b9-f40c-2c2a-95b3fde6c3bc@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230218_125931_339953_6DDD0A35 X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Use the priv data member of struct hwrng to make the iomem base address available in meson_rng_read(). This allows for removing struct meson_rng_data completely in the next step. __force is used to silence sparse warnings. Signed-off-by: Heiner Kallweit --- drivers/char/hw_random/meson-rng.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/char/hw_random/meson-rng.c b/drivers/char/hw_random/meson-rng.c index a4eb8e35f..bf7a6e594 100644 --- a/drivers/char/hw_random/meson-rng.c +++ b/drivers/char/hw_random/meson-rng.c @@ -17,16 +17,14 @@ #define RNG_DATA 0x00 struct meson_rng_data { - void __iomem *base; struct hwrng rng; }; static int meson_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) { - struct meson_rng_data *data = - container_of(rng, struct meson_rng_data, rng); + void __iomem *base = (__force void __iomem *)rng->priv; - *(u32 *)buf = readl_relaxed(data->base + RNG_DATA); + *(u32 *)buf = readl_relaxed(base + RNG_DATA); return sizeof(u32); } @@ -36,14 +34,15 @@ static int meson_rng_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct meson_rng_data *data; struct clk *core_clk; + void __iomem *base; data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; - data->base = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(data->base)) - return PTR_ERR(data->base); + base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); core_clk = devm_clk_get_optional_enabled(dev, "core"); if (IS_ERR(core_clk)) @@ -52,6 +51,7 @@ static int meson_rng_probe(struct platform_device *pdev) data->rng.name = pdev->name; data->rng.read = meson_rng_read; + data->rng.priv = (__force unsigned long)base; return devm_hwrng_register(dev, &data->rng); } From patchwork Sat Feb 18 20:59:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13145632 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 160D0C61DA4 for ; Sat, 18 Feb 2023 21:00:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:From: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7ivz51xKdr/PII0w/e9yysMxc2AzfYS6fB/8nWlQ748=; b=blLjZFjcnlD59H Va4lZYNA40b5nZJ9c8qf6/cpk/5bTa7C5WN9Mi6RUCDpbFDDBkGFTcowK3ygsWg12FgeompE5SX95 6QMcwLV/XpOH3Ieu4elwhf99bnzUkVw1964GR5YOz+ue18/V9LQLJihkZ46jKq3+cdhPL+jZWUF/L ZGjoTzmKJDel7DrOrxyIE4m+tOeE4fmQB2w+vvVtVCz5T6bE+OhgTJBShPjNG+ILmQk8kSUj0KXHH lPI+iDIarBPp+4IotizhRGGOBjRnxHCnIl/WShBn2g9dJEOFGQQXXXgr7Bqh0nesiWJKeFp58JjzK 7oT4UD9JJbwj2hAEU1hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTUJe-0006P1-Qd; Sat, 18 Feb 2023 21:00:18 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTUIu-00068w-Hd; Sat, 18 Feb 2023 20:59:33 +0000 Received: by mail-ed1-x52e.google.com with SMTP id k5so6386371edo.3; Sat, 18 Feb 2023 12:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5/WDNEbgisYy7HKbKtg3x5sM5lSnk3f53fWjIWsdioM=; b=Y5gt30hgLmyK/3disDGoNv7X5srdEOUlDiSjD/3a48VwOFAiYNikZNzBVmseWIQhc8 wmvRaOKgWbilnzKnxSlytLpkd6KzKJsiKCs5+q7xHD+eKN8kEQisu/hE0KiDbbqM0cFb n8vcdXIsovnFq0a8/68NvPOMDA39RCIuJfGy4fvcKRKD5zFwvtQmFoB4LT/zV8KB1qFH flHf1ONOnMquhWR1LE+59FNbM1msej2cg85DdtkUbl4LBz7z73l521/1eoGY0jjpxAId +swPpoZFN9EnsJt2paeQsP7Ufukg4c+eKVMcz+ZDSjakeyNohtIZcc9p2MhAW6l67PEh X9rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5/WDNEbgisYy7HKbKtg3x5sM5lSnk3f53fWjIWsdioM=; b=tFNaF9U5Sc4hzgiHCKJKEO11S0sOmkOxeQ/i4kB6sD7t67Ylgwp8Ebtbod1T6QpzAT EkAOnY4irGGx/NVEqg0tcylviq13m8XfM5IcLgpFpZKYpQY1O4S5tWjfbC54iE1EgDuz jsudsXR6iAXb1vBy4fXSp48iiaGGNBmlpK+C+Z+z1hTcCQuILvaGKlu1RBY7MMMPgM0e vHwTdK1tsnIRh458cGGJjulXIxrVYxTM9QTziUHl59X3ARzjaowe/yvyqBbyVQcBBXd5 A3g2Zp6dXI01IUgZtF5161yLu81Dcdeqsn+I6XgjLJRBK37yYtPbIBHVCRynZYz6XesY ApnQ== X-Gm-Message-State: AO0yUKWYw4yQ8RJ/X926k5+XtFaU1c/SRi7sqPQ287XRW3qVL0fKZJ6e g4Q2uaMKFOywNpBo/mGXTe8= X-Google-Smtp-Source: AK7set+1fXie4wFZicnTmT6HJm5KRsiKzoOl5iHtScvxq3/fscAEsLtL00IXPlWW+dYOolN6W6DI8w== X-Received: by 2002:a17:906:aad6:b0:8b1:3b95:cf3f with SMTP id kt22-20020a170906aad600b008b13b95cf3fmr4095079ejb.70.1676753971103; Sat, 18 Feb 2023 12:59:31 -0800 (PST) Received: from ?IPV6:2a01:c22:7b82:af00:2955:cfd1:cf55:9ea? (dynamic-2a01-0c22-7b82-af00-2955-cfd1-cf55-09ea.c22.pool.telefonica.de. [2a01:c22:7b82:af00:2955:cfd1:cf55:9ea]) by smtp.googlemail.com with ESMTPSA id s21-20020a1709060c1500b00887f6c39ac0sm3762386ejf.98.2023.02.18.12.59.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Feb 2023 12:59:30 -0800 (PST) Message-ID: Date: Sat, 18 Feb 2023 21:59:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: [PATCH 5/5] hwrng: meson: remove struct meson_rng_data Content-Language: en-US From: Heiner Kallweit To: Olivia Mackall , Herbert Xu , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: Linux Crypto Mailing List , "linux-arm-kernel@lists.infradead.org" , "open list:ARM/Amlogic Meson..." References: <26216f60-d9b9-f40c-2c2a-95b3fde6c3bc@gmail.com> In-Reply-To: <26216f60-d9b9-f40c-2c2a-95b3fde6c3bc@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230218_125932_635317_85F02A71 X-CRM114-Status: GOOD ( 11.16 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Because no other members of struct meson_rng_data are left, we can remove it completely. Signed-off-by: Heiner Kallweit --- drivers/char/hw_random/meson-rng.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/char/hw_random/meson-rng.c b/drivers/char/hw_random/meson-rng.c index bf7a6e594..633d98b48 100644 --- a/drivers/char/hw_random/meson-rng.c +++ b/drivers/char/hw_random/meson-rng.c @@ -16,10 +16,6 @@ #define RNG_DATA 0x00 -struct meson_rng_data { - struct hwrng rng; -}; - static int meson_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) { void __iomem *base = (__force void __iomem *)rng->priv; @@ -32,12 +28,12 @@ static int meson_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) static int meson_rng_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct meson_rng_data *data; struct clk *core_clk; void __iomem *base; + struct hwrng *rng; - data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); - if (!data) + rng = devm_kzalloc(dev, sizeof(*rng), GFP_KERNEL); + if (!rng) return -ENOMEM; base = devm_platform_ioremap_resource(pdev, 0); @@ -49,11 +45,11 @@ static int meson_rng_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(core_clk), "Failed to get core clock\n"); - data->rng.name = pdev->name; - data->rng.read = meson_rng_read; - data->rng.priv = (__force unsigned long)base; + rng->name = pdev->name; + rng->read = meson_rng_read; + rng->priv = (__force unsigned long)base; - return devm_hwrng_register(dev, &data->rng); + return devm_hwrng_register(dev, rng); } static const struct of_device_id meson_rng_of_match[] = {