diff mbox series

[U-Boot,5/5] remoteproc: stm32: invert the is_running() return value

Message ID 1570635389-8445-6-git-send-email-fabien.dessenne@st.com
State Superseded
Delegated to: Tom Rini
Headers show
Series remoteproc: add elf resource table loader | expand

Commit Message

Fabien DESSENNE Oct. 9, 2019, 3:36 p.m. UTC
The .is_running() ops expects a return value of 0 if the processor is
running, 1 if not running : align to this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
---
 drivers/remoteproc/stm32_copro.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Suman Anna Oct. 11, 2019, 8 p.m. UTC | #1
On 10/9/19 10:36 AM, Fabien Dessenne wrote:
> The .is_running() ops expects a return value of 0 if the processor is
> running, 1 if not running : align to this.
> 
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>

This patch should be earlier than patch4, right?

Reviewed-by: Suman Anna <s-anna@ti.com>

> ---
>  drivers/remoteproc/stm32_copro.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/stm32_copro.c b/drivers/remoteproc/stm32_copro.c
> index eef3416..fce9653 100644
> --- a/drivers/remoteproc/stm32_copro.c
> +++ b/drivers/remoteproc/stm32_copro.c
> @@ -237,14 +237,14 @@ static int stm32_copro_stop(struct udevice *dev)
>  /**
>   * stm32_copro_is_running() - Is the STM32 remote processor running
>   * @dev:	corresponding STM32 remote processor device
> - * @return 1 if the remote processor is running, 0 otherwise
> + * @return 0 if the remote processor is running, 1 otherwise
>   */
>  static int stm32_copro_is_running(struct udevice *dev)
>  {
>  	struct stm32_copro_privdata *priv;
>  
>  	priv = dev_get_priv(dev);
> -	return priv->is_running;
> +	return !priv->is_running;
>  }
>  
>  static const struct dm_rproc_ops stm32_copro_ops = {
>
Fabien DESSENNE Oct. 14, 2019, 3:50 p.m. UTC | #2
On 11/10/2019 10:00 PM, Suman Anna wrote:
> On 10/9/19 10:36 AM, Fabien Dessenne wrote:
>> The .is_running() ops expects a return value of 0 if the processor is
>> running, 1 if not running : align to this.
>>
>> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
> This patch should be earlier than patch4, right?


You're probably right. I will double check this in v2.


>
> Reviewed-by: Suman Anna <s-anna@ti.com>
>
>> ---
>>   drivers/remoteproc/stm32_copro.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/remoteproc/stm32_copro.c b/drivers/remoteproc/stm32_copro.c
>> index eef3416..fce9653 100644
>> --- a/drivers/remoteproc/stm32_copro.c
>> +++ b/drivers/remoteproc/stm32_copro.c
>> @@ -237,14 +237,14 @@ static int stm32_copro_stop(struct udevice *dev)
>>   /**
>>    * stm32_copro_is_running() - Is the STM32 remote processor running
>>    * @dev:	corresponding STM32 remote processor device
>> - * @return 1 if the remote processor is running, 0 otherwise
>> + * @return 0 if the remote processor is running, 1 otherwise
>>    */
>>   static int stm32_copro_is_running(struct udevice *dev)
>>   {
>>   	struct stm32_copro_privdata *priv;
>>   
>>   	priv = dev_get_priv(dev);
>> -	return priv->is_running;
>> +	return !priv->is_running;
>>   }
>>   
>>   static const struct dm_rproc_ops stm32_copro_ops = {
>>
diff mbox series

Patch

diff --git a/drivers/remoteproc/stm32_copro.c b/drivers/remoteproc/stm32_copro.c
index eef3416..fce9653 100644
--- a/drivers/remoteproc/stm32_copro.c
+++ b/drivers/remoteproc/stm32_copro.c
@@ -237,14 +237,14 @@  static int stm32_copro_stop(struct udevice *dev)
 /**
  * stm32_copro_is_running() - Is the STM32 remote processor running
  * @dev:	corresponding STM32 remote processor device
- * @return 1 if the remote processor is running, 0 otherwise
+ * @return 0 if the remote processor is running, 1 otherwise
  */
 static int stm32_copro_is_running(struct udevice *dev)
 {
 	struct stm32_copro_privdata *priv;
 
 	priv = dev_get_priv(dev);
-	return priv->is_running;
+	return !priv->is_running;
 }
 
 static const struct dm_rproc_ops stm32_copro_ops = {