mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] nvmem: ocotp: decouple featctrl from barebox,provide-mac-address
@ 2023-01-10  8:51 Ahmad Fatoum
  2023-01-10 14:34 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-01-10  8:51 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

imx_ocotp_init_dt() does both barebox,provide-mac-address and
barebox,feature-controller parsing, but it erroneously exited
early when the former was not available. Change this so no
early exit happens.

Fixes: 4adc4e12ac95 ("nvmem: ocotp: add i.MX8M[MN] feature controller support")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/nvmem/ocotp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/nvmem/ocotp.c b/drivers/nvmem/ocotp.c
index 7545059aa92b..2fef84074302 100644
--- a/drivers/nvmem/ocotp.c
+++ b/drivers/nvmem/ocotp.c
@@ -646,14 +646,12 @@ static int imx_ocotp_init_dt(struct ocotp_priv *priv)
 	const __be32 *prop;
 	struct device_node *node = priv->dev.parent->of_node;
 	u32 tester4;
-	int ret, len;
+	int ret, len = 0;
 
 	if (!node)
 		return 0;
 
 	prop = of_get_property(node, "barebox,provide-mac-address", &len);
-	if (!prop)
-		return 0;
 
 	for (; len >= MAC_ADDRESS_PROPLEN; len -= MAC_ADDRESS_PROPLEN) {
 		struct device_node *rnode;
-- 
2.30.2




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

* Re: [PATCH master] nvmem: ocotp: decouple featctrl from barebox,provide-mac-address
  2023-01-10  8:51 [PATCH master] nvmem: ocotp: decouple featctrl from barebox,provide-mac-address Ahmad Fatoum
@ 2023-01-10 14:34 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-01-10 14:34 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Tue, Jan 10, 2023 at 09:51:59AM +0100, Ahmad Fatoum wrote:
> imx_ocotp_init_dt() does both barebox,provide-mac-address and
> barebox,feature-controller parsing, but it erroneously exited
> early when the former was not available. Change this so no
> early exit happens.
> 
> Fixes: 4adc4e12ac95 ("nvmem: ocotp: add i.MX8M[MN] feature controller support")
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/nvmem/ocotp.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/nvmem/ocotp.c b/drivers/nvmem/ocotp.c
> index 7545059aa92b..2fef84074302 100644
> --- a/drivers/nvmem/ocotp.c
> +++ b/drivers/nvmem/ocotp.c
> @@ -646,14 +646,12 @@ static int imx_ocotp_init_dt(struct ocotp_priv *priv)
>  	const __be32 *prop;
>  	struct device_node *node = priv->dev.parent->of_node;
>  	u32 tester4;
> -	int ret, len;
> +	int ret, len = 0;
>  
>  	if (!node)
>  		return 0;
>  
>  	prop = of_get_property(node, "barebox,provide-mac-address", &len);
> -	if (!prop)
> -		return 0;
>  
>  	for (; len >= MAC_ADDRESS_PROPLEN; len -= MAC_ADDRESS_PROPLEN) {
>  		struct device_node *rnode;
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2023-01-10 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10  8:51 [PATCH master] nvmem: ocotp: decouple featctrl from barebox,provide-mac-address Ahmad Fatoum
2023-01-10 14:34 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox