diff mbox series

button: adc: fix treshold typo

Message ID 20210223151040.2201981-1-narmstrong@baylibre.com
State Accepted, archived
Commit efe1f064960bf4c593da137419682de906630a34
Delegated to: Neil Armstrong
Headers show
Series button: adc: fix treshold typo | expand

Commit Message

Neil Armstrong Feb. 23, 2021, 3:10 p.m. UTC
Fix the treshold typo in code by threshold.

Fixes: c0165c85c3 ("button: add a simple Analog to Digital Converter device based button driver")
Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/button/button-adc.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Marek Szyprowski Feb. 23, 2021, 6:18 p.m. UTC | #1
On 23.02.2021 16:10, Neil Armstrong wrote:
> Fix the treshold typo in code by threshold.
>
> Fixes: c0165c85c3 ("button: add a simple Analog to Digital Converter device based button driver")
> Suggested-by: Tom Rini <trini@konsulko.com>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>   drivers/button/button-adc.c | 14 +++++++-------
>   1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/button/button-adc.c b/drivers/button/button-adc.c
> index eed86564fb..fd896c76f9 100644
> --- a/drivers/button/button-adc.c
> +++ b/drivers/button/button-adc.c
> @@ -55,7 +55,7 @@ static int button_adc_of_to_plat(struct udevice *dev)
>   	struct button_uc_plat *uc_plat = dev_get_uclass_plat(dev);
>   	struct button_adc_priv *priv = dev_get_priv(dev);
>   	struct ofnode_phandle_args args;
> -	u32 treshold, up_treshold, t;
> +	u32 threshold, up_threshold, t;
>   	ofnode node;
>   	int ret;
>   
> @@ -73,12 +73,12 @@ static int button_adc_of_to_plat(struct udevice *dev)
>   		return ret;
>   
>   	ret = ofnode_read_u32(dev_ofnode(dev->parent),
> -			      "keyup-threshold-microvolt", &up_treshold);
> +			      "keyup-threshold-microvolt", &up_threshold);
>   	if (ret)
>   		return ret;
>   
>   	ret = ofnode_read_u32(dev_ofnode(dev), "press-threshold-microvolt",
> -			      &treshold);
> +			      &threshold);
>   	if (ret)
>   		return ret;
>   
> @@ -87,13 +87,13 @@ static int button_adc_of_to_plat(struct udevice *dev)
>   		if (ret)
>   			return ret;
>   
> -		if (t > treshold)
> -			up_treshold = t;
> +		if (t > threshold)
> +			up_threshold = t;
>   	}
>   
>   	priv->channel = args.args[0];
> -	priv->min = treshold;
> -	priv->max = up_treshold;
> +	priv->min = threshold;
> +	priv->max = up_threshold;
>   
>   	return ret;
>   }

Best regards
Neil Armstrong March 8, 2021, 9:44 a.m. UTC | #2
On 23/02/2021 19:18, Marek Szyprowski wrote:
> On 23.02.2021 16:10, Neil Armstrong wrote:
>> Fix the treshold typo in code by threshold.
>>
>> Fixes: c0165c85c3 ("button: add a simple Analog to Digital Converter device based button driver")
>> Suggested-by: Tom Rini <trini@konsulko.com>
>> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> ---
>>   drivers/button/button-adc.c | 14 +++++++-------
>>   1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/button/button-adc.c b/drivers/button/button-adc.c
>> index eed86564fb..fd896c76f9 100644
>> --- a/drivers/button/button-adc.c
>> +++ b/drivers/button/button-adc.c
>> @@ -55,7 +55,7 @@ static int button_adc_of_to_plat(struct udevice *dev)
>>   	struct button_uc_plat *uc_plat = dev_get_uclass_plat(dev);
>>   	struct button_adc_priv *priv = dev_get_priv(dev);
>>   	struct ofnode_phandle_args args;
>> -	u32 treshold, up_treshold, t;
>> +	u32 threshold, up_threshold, t;
>>   	ofnode node;
>>   	int ret;
>>   
>> @@ -73,12 +73,12 @@ static int button_adc_of_to_plat(struct udevice *dev)
>>   		return ret;
>>   
>>   	ret = ofnode_read_u32(dev_ofnode(dev->parent),
>> -			      "keyup-threshold-microvolt", &up_treshold);
>> +			      "keyup-threshold-microvolt", &up_threshold);
>>   	if (ret)
>>   		return ret;
>>   
>>   	ret = ofnode_read_u32(dev_ofnode(dev), "press-threshold-microvolt",
>> -			      &treshold);
>> +			      &threshold);
>>   	if (ret)
>>   		return ret;
>>   
>> @@ -87,13 +87,13 @@ static int button_adc_of_to_plat(struct udevice *dev)
>>   		if (ret)
>>   			return ret;
>>   
>> -		if (t > treshold)
>> -			up_treshold = t;
>> +		if (t > threshold)
>> +			up_threshold = t;
>>   	}
>>   
>>   	priv->channel = args.args[0];
>> -	priv->min = treshold;
>> -	priv->max = up_treshold;
>> +	priv->min = threshold;
>> +	priv->max = up_threshold;
>>   
>>   	return ret;
>>   }
> 
> Best regards
> 


Applied to u-boot-amlogic
diff mbox series

Patch

diff --git a/drivers/button/button-adc.c b/drivers/button/button-adc.c
index eed86564fb..fd896c76f9 100644
--- a/drivers/button/button-adc.c
+++ b/drivers/button/button-adc.c
@@ -55,7 +55,7 @@  static int button_adc_of_to_plat(struct udevice *dev)
 	struct button_uc_plat *uc_plat = dev_get_uclass_plat(dev);
 	struct button_adc_priv *priv = dev_get_priv(dev);
 	struct ofnode_phandle_args args;
-	u32 treshold, up_treshold, t;
+	u32 threshold, up_threshold, t;
 	ofnode node;
 	int ret;
 
@@ -73,12 +73,12 @@  static int button_adc_of_to_plat(struct udevice *dev)
 		return ret;
 
 	ret = ofnode_read_u32(dev_ofnode(dev->parent),
-			      "keyup-threshold-microvolt", &up_treshold);
+			      "keyup-threshold-microvolt", &up_threshold);
 	if (ret)
 		return ret;
 
 	ret = ofnode_read_u32(dev_ofnode(dev), "press-threshold-microvolt",
-			      &treshold);
+			      &threshold);
 	if (ret)
 		return ret;
 
@@ -87,13 +87,13 @@  static int button_adc_of_to_plat(struct udevice *dev)
 		if (ret)
 			return ret;
 
-		if (t > treshold)
-			up_treshold = t;
+		if (t > threshold)
+			up_threshold = t;
 	}
 
 	priv->channel = args.args[0];
-	priv->min = treshold;
-	priv->max = up_treshold;
+	priv->min = threshold;
+	priv->max = up_threshold;
 
 	return ret;
 }