mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
nvmem: sunxi_sid: Read out SID for randomness without looping
Since the reg_read callbacks already support arbitrary, but 4-byte aligned. offsets and lengths into the SID, there is no need for another for loop just to use it to read 1 byte at a time. Read out the whole SID block in one go. Signed-off-by: Chen-Yu Tsai <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
dd4c1047b1
commit
9c4adfb5dc
1 changed files with 2 additions and 3 deletions
|
|
@ -154,7 +154,7 @@ static int sunxi_sid_probe(struct platform_device *pdev)
|
|||
struct resource *res;
|
||||
struct nvmem_device *nvmem;
|
||||
struct sunxi_sid *sid;
|
||||
int i, size;
|
||||
int size;
|
||||
char *randomness;
|
||||
const struct sunxi_sid_cfg *cfg;
|
||||
|
||||
|
|
@ -189,8 +189,7 @@ static int sunxi_sid_probe(struct platform_device *pdev)
|
|||
if (!randomness)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
econfig.reg_read(sid, i, &randomness[i], 1);
|
||||
econfig.reg_read(sid, 0, randomness, size);
|
||||
|
||||
add_device_randomness(randomness, size);
|
||||
kfree(randomness);
|
||||
|
|
|
|||
Loading…
Reference in a new issue