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: 654814 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE0E3C61DA4 for ; Sat, 18 Feb 2023 20:59:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbjBRU72 (ORCPT ); Sat, 18 Feb 2023 15:59:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjBRU71 (ORCPT ); Sat, 18 Feb 2023 15:59:27 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9449814203 for ; Sat, 18 Feb 2023 12:59:26 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id ee44so2159241edb.5 for ; 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=N5Z2ICNzH1ZHRen1cABRfJxMYauYgI8hrnPV17ryX8pLJ4+0omXMG91vVDR6z584KO EPmYiFgH+Z/AMh/kKSow1457JSgOowFNoeKR5K7VvtkG2uff+CesCOf8SAZKF/M10/2P pf7Q7o8tSR0hJ6F0aRO5GU9U5acDL+e62eMj+rJCH2uwTzc8DOJSsTDKKKzoo3f0KbMK WB9WeGYsFwrbNj0ExSUsf+wBVbHUGsR/38/rM/5qjv4LXubue0Kkh1FsDQa2A6Nr+YDx JFmhS1/75KH0pRMCuZ9G8Gak/uNgTb2OwGVU+5h+dyQ3GYnsgVlPZ8vu6rSfOKFGz6v5 xiMw== X-Gm-Message-State: AO0yUKXKeQkE0Zmbw7mQnfIjA9NJEokKb7vsrwPNJI8T2xvTRsqCRgAm d9ASUMpIN22B3VBhVeeDYak= 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> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.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: 654927 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29EF8C636CC for ; Sat, 18 Feb 2023 20:59:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229642AbjBRU7a (ORCPT ); Sat, 18 Feb 2023 15:59:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjBRU73 (ORCPT ); Sat, 18 Feb 2023 15:59:29 -0500 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FC2D14203 for ; Sat, 18 Feb 2023 12:59:28 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id ec30so5335808edb.10 for ; Sat, 18 Feb 2023 12:59:28 -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=1nHFZEgTNM6qI8My1mRrJ5xqarTuAIUtEirgprClpgMTjoawucHJkIsMEYd/e+QKiq 8A7WawEVnGXcW5KU26Tj3XB43K4lR5HVtYOeexpGODoW7c/Y2NAtxNt8GN5xPWffmID8 XEh+wJ/OtJ3LPsjh/AoJrXJ51GILI5XaSE13cuAzh39V1IJbjYzpETgeBHpneIrBpz8c oxjyisMyXwxK6pBu65kQ7Rmrys84wHMsuK7jjaziNkK5Ip5jo6qNJcerFDEe7nzEmF6i PnBB3vpeXSOyf5XNsfiyxITSGPJVkvzbHEOD4SBIw7iNaK+bvhb1KDk9kdMixoPq4NiN Q4bQ== X-Gm-Message-State: AO0yUKVZYc4XdJGRdKTXgG1FNah3aBiAt5UzkF7v3tu2jboMDFQcnElx Be9mXDOUWtfq/iukY89E01Q= 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> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Use devm_clk_get_optional_enabled() to simplify the code. Signed-off-by: Heiner Kallweit --- 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: 654926 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47EAEC636CC for ; Sat, 18 Feb 2023 20:59:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbjBRU7e (ORCPT ); Sat, 18 Feb 2023 15:59:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbjBRU7c (ORCPT ); Sat, 18 Feb 2023 15:59:32 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F276114239 for ; Sat, 18 Feb 2023 12:59:29 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id ec30so5335939edb.10 for ; 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=lYKKug4UhuULRjYAGFxpv8bWe6ZcA5Q04EGUG1qh7Z1g3XeHvzez1jqY30gpji9a5U 3bkaBOj/6tTlqj2VVDUwKOxeWvzNsCadZ8vBguOQcfz1KA6kEMp6quvAQKbfuuKx+IgU xD6yoyyRVzZ/XkmnDrcDwTeS2+7E0AX26pxjLkRcaPX/peCGWUy1oDegNnbSI50CqS8A y1kxGGT4ShvH0wg2cXZLAWug0IkxkqMrBnwG5ZpH7u/ISGhiiK0KXTwr51U+HyG6HKpO 2VbjVV8SyAH2Ta5bGFZeQe5uwGPIUMHHqFpbF3ZVL+dVSsm1F0/t5tTih6Oh+NT+rnZ8 8ebg== X-Gm-Message-State: AO0yUKX4OI134CuTxI94DJzwEMvJTR7yjr1nvSV6igRo/KkBtPsjd3uM 1ArCOV9tkbUJsjKMEqxZfE0= 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> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org drvdata isn't used, therefore remove this call. Signed-off-by: Heiner Kallweit --- 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: 654813 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89C41C61DA4 for ; Sat, 18 Feb 2023 20:59:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229656AbjBRU7e (ORCPT ); Sat, 18 Feb 2023 15:59:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbjBRU7c (ORCPT ); Sat, 18 Feb 2023 15:59:32 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D6CC1554E for ; Sat, 18 Feb 2023 12:59:31 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id ez14so5103000edb.1 for ; Sat, 18 Feb 2023 12:59:31 -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=JKYUsONQLb7kPAoD0bc/15nFo4J6y0/9VmkGU8hfUL9rgS2AiN91MJh05UQtW0ZQ4E 0d/gzYIWdLSIR5ufYyYpb3v+Y9qGUlBuzlWBpqWrH+kSupHAEntb3z3hun+ugF6X9V3U KCQmU8l/62W0ImH217Lq0zHRi0Ti+RzC/O6hFyXibSv4Y0ldpWk5Hq67tpLz4Uc80Se2 RU/KtWIpvnmjSxK21DLOOQAFQeZEF13WcmQ6lwXu2mb7VI8TRyw0PdwhHEsZw/11EI40 5dib3RctwibypFYucG30hs0Ep2nraLmL+z9ApLHSUNnMdMXyx0A1p3BzFFuebZolsIws 3eDQ== X-Gm-Message-State: AO0yUKUtaIhNJ4n8z5LRLK9o4jAOFqQ36hmg/hb4oRrW7bzB4fHsPmGB lZBCHlZJ89V6r9alBvy6txg= 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> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.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: 654812 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6833DC6379F for ; Sat, 18 Feb 2023 20:59:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbjBRU7f (ORCPT ); Sat, 18 Feb 2023 15:59:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjBRU7d (ORCPT ); Sat, 18 Feb 2023 15:59:33 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 868C714EA9 for ; Sat, 18 Feb 2023 12:59:32 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id t19so4722633edi.13 for ; 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=wAKuOdEmhHGMfJHqsfzKxTqPogg9OSM86kgy5JxxJ3pPiAxQlWcjOdFaJLK56cNcHE 9u257otqG+0Z9JlGWH7KdwtfHRczfVgOczW8ZlmCPGQnkqPkTMX7CRoBsjuLeymgS12Y oWukwkE5C+1oSth7INqag01TYRvfKF80Mcrmmem6uSTbWShbltfaMaY1EGaea7Qm5DGT ooDc/n4BXiDaZ89xGm3Jvu0YIQOT8gC9A51M7WgCY+7n/hCDUk1WeZeuEquOr5J/hqUd ySvIU+zYJf7nLzDpkBqzfTqF0zbNXoqwC53b8JALO/tGQPOwPpzT8niVDmzgYO4r1ARe 8blQ== X-Gm-Message-State: AO0yUKXGgbOSGR1vKP6xCog9hDe/xPlc28YqOiQTS96FUddhTIv67mop oOSgl9DufBvkFoVxiTtaWhE= 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> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.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[] = {