[PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function

Hexagon Email Recovery email-recovery6 at hexagon.com
Thu Jul 1 17:49:24 CEST 2021


This message could not be delivered immediately due to an internal mail routing issue.
The mail routing error has been resolved in the meantime.
We apologize for the delay in delivery and any inconvenience this may have caused.
In case of any questions please contact us via it at hexagon.com.

Original sender: patrick.delaunay at foss.st.com
Original delivery time: 28-Jun-2021 01:34 PM (UTC)
-----------------------------------------------------------------------------------------------------------------------
This email is not from Hexagon’s Office 365 instance. Please be careful while clicking links, opening attachments, or replying to this email. Add a helper function to access to BSEC misc driver. Signed-off-by: Patrick Delaunay --- arch/arm/mach-stm32mp/cmd_stm32key.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c index c4cb6342fa..886c52794f 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32key.c +++ b/arch/arm/mach-stm32mp/cmd_stm32key.c @@ -14,6 +14,17 @@ #define STM32_OTP_HASH_KEY_START 24 #define STM32_OTP_HASH_KEY_SIZE 8 +static int get_misc_dev(struct udevice **dev) +{ + int ret; + + ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(stm32mp_bsec), dev); + if (ret) + log_err("Can't find stm32mp_bsec driver\n"); + + return ret; +} + static void read_hash_value(u32 addr) { int i; @@ -31,13 +42,9 @@ static int fuse_hash_value(u32 addr, bool print) u32 word, val; int i, ret; - ret = uclass_get_device_by_driver(UCLASS_MISC, - DM_DRIVER_GET(stm32mp_bsec), - &dev); - if (ret) { - log_err("Can't find stm32mp_bsec driver\n"); + ret = get_misc_dev(&dev); + if (ret) return ret; - } for (i = 0, word = STM32_OTP_HASH_KEY_START; i < STM32_OTP_HASH_KEY_SIZE; -- 2.25.1


More information about the U-Boot mailing list