Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hwrng: npcm - Add struct device pointer to device context struct

Add a struct device pointer field to the device's context struct. This
makes using the unsigned long priv pointer in struct hwrng unnecessary, so
remove that one as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Sakari Ailus and committed by
Herbert Xu
a6b3e1f9 c2c460c3

+5 -4
+5 -4
drivers/char/hw_random/npcm-rng.c
··· 32 32 struct npcm_rng { 33 33 void __iomem *base; 34 34 struct hwrng rng; 35 + struct device *dev; 35 36 u32 clkp; 36 37 }; 37 38 ··· 58 57 int retval = 0; 59 58 int ready; 60 59 61 - pm_runtime_get_sync((struct device *)priv->rng.priv); 60 + pm_runtime_get_sync(priv->dev); 62 61 63 62 while (max) { 64 63 if (wait) { ··· 80 79 max--; 81 80 } 82 81 83 - pm_runtime_mark_last_busy((struct device *)priv->rng.priv); 84 - pm_runtime_put_sync_autosuspend((struct device *)priv->rng.priv); 82 + pm_runtime_mark_last_busy(priv->dev); 83 + pm_runtime_put_sync_autosuspend(priv->dev); 85 84 86 85 return retval || !wait ? retval : -EIO; 87 86 } ··· 110 109 #endif 111 110 priv->rng.name = pdev->name; 112 111 priv->rng.read = npcm_rng_read; 113 - priv->rng.priv = (unsigned long)&pdev->dev; 112 + priv->dev = &pdev->dev; 114 113 priv->clkp = (u32)(uintptr_t)of_device_get_match_data(&pdev->dev); 115 114 116 115 writel(NPCM_RNG_M1ROSEL, priv->base + NPCM_RNGMODE_REG);