All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function
@ 2021-07-01 15:49 Hexagon Email Recovery
  0 siblings, 0 replies; 4+ messages in thread
From: Hexagon Email Recovery @ 2021-07-01 15:49 UTC (permalink / raw)
  To: u-boot; +Cc: patrick.delaunay, patrice.chotard, uboot-stm32

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@hexagon.com.

Original sender: patrick.delaunay@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function
  2021-06-28 12:56 ` [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function Patrick Delaunay
  2021-07-01  7:36   ` Patrice CHOTARD
@ 2021-07-16  8:28   ` Patrick DELAUNAY
  1 sibling, 0 replies; 4+ messages in thread
From: Patrick DELAUNAY @ 2021-07-16  8:28 UTC (permalink / raw)
  To: u-boot; +Cc: Patrice Chotard, U-Boot STM32

Hi,

On 6/28/21 2:56 PM, Patrick Delaunay wrote:
> Add a helper function to access to BSEC misc driver.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
>
>   arch/arm/mach-stm32mp/cmd_stm32key.c | 19 +++++++++++++------
>   1 file changed, 13 insertions(+), 6 deletions(-)
>

Applied to u-boot-stm/master, thanks!

Regards
Patrick


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function
  2021-06-28 12:56 ` [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function Patrick Delaunay
@ 2021-07-01  7:36   ` Patrice CHOTARD
  2021-07-16  8:28   ` Patrick DELAUNAY
  1 sibling, 0 replies; 4+ messages in thread
From: Patrice CHOTARD @ 2021-07-01  7:36 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: U-Boot STM32

Hi Patrick

On 6/28/21 2:56 PM, Patrick Delaunay wrote:
> Add a helper function to access to BSEC misc driver.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
>  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;
> 
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function
  2021-06-28 12:55 [PATCH 0/7] stm32mp: cmd_stm32key: updates Patrick Delaunay
@ 2021-06-28 12:56 ` Patrick Delaunay
  2021-07-01  7:36   ` Patrice CHOTARD
  2021-07-16  8:28   ` Patrick DELAUNAY
  0 siblings, 2 replies; 4+ messages in thread
From: Patrick Delaunay @ 2021-06-28 12:56 UTC (permalink / raw)
  To: u-boot; +Cc: Patrick Delaunay, Patrice Chotard, U-Boot STM32

Add a helper function to access to BSEC misc driver.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-16  8:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 15:49 [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function Hexagon Email Recovery
  -- strict thread matches above, loose matches on Subject: below --
2021-06-28 12:55 [PATCH 0/7] stm32mp: cmd_stm32key: updates Patrick Delaunay
2021-06-28 12:56 ` [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function Patrick Delaunay
2021-07-01  7:36   ` Patrice CHOTARD
2021-07-16  8:28   ` Patrick DELAUNAY

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.