Because no other members of struct meson_rng_data are left, we can remove it completely. Signed-off-by: Heiner Kallweit <hkallweit1@xxxxxxxxx> --- 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[] = { -- 2.39.2