hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/char/hw_random/iproc-rng200.c
....@@ -181,7 +181,6 @@
181181 static int iproc_rng200_probe(struct platform_device *pdev)
182182 {
183183 struct iproc_rng200_dev *priv;
184
- struct resource *res;
185184 struct device *dev = &pdev->dev;
186185 int ret;
187186
....@@ -190,22 +189,16 @@
190189 return -ENOMEM;
191190
192191 /* Map peripheral */
193
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
194
- if (!res) {
195
- dev_err(dev, "failed to get rng resources\n");
196
- return -EINVAL;
197
- }
198
-
199
- priv->base = devm_ioremap_resource(dev, res);
192
+ priv->base = devm_platform_ioremap_resource(pdev, 0);
200193 if (IS_ERR(priv->base)) {
201194 dev_err(dev, "failed to remap rng regs\n");
202195 return PTR_ERR(priv->base);
203196 }
204197
205
- priv->rng.name = "iproc-rng200",
206
- priv->rng.read = iproc_rng200_read,
207
- priv->rng.init = iproc_rng200_init,
208
- priv->rng.cleanup = iproc_rng200_cleanup,
198
+ priv->rng.name = "iproc-rng200";
199
+ priv->rng.read = iproc_rng200_read;
200
+ priv->rng.init = iproc_rng200_init;
201
+ priv->rng.cleanup = iproc_rng200_cleanup;
209202
210203 /* Register driver */
211204 ret = devm_hwrng_register(dev, &priv->rng);
....@@ -220,6 +213,8 @@
220213 }
221214
222215 static const struct of_device_id iproc_rng200_of_match[] = {
216
+ { .compatible = "brcm,bcm2711-rng200", },
217
+ { .compatible = "brcm,bcm7211-rng200", },
223218 { .compatible = "brcm,bcm7278-rng200", },
224219 { .compatible = "brcm,iproc-rng200", },
225220 {},