diff mbox

[1/5] ARM: imx: Use PTR_ERR_OR_ZERO in platform-mxc_rnga.c

Message ID 1401339434-26085-1-git-send-email-sachin.kamat@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sachin Kamat May 29, 2014, 4:57 a.m. UTC
PTR_ERR_OR_ZERO simplifies the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 arch/arm/mach-imx/devices/platform-mxc_rnga.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Shawn Guo May 29, 2014, 8:03 a.m. UTC | #1
On Thu, May 29, 2014 at 10:27:10AM +0530, Sachin Kamat wrote:
> PTR_ERR_OR_ZERO simplifies the code.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  arch/arm/mach-imx/devices/platform-mxc_rnga.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/devices/platform-mxc_rnga.c b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
> index c58404badb59..33d58ca2001a 100644
> --- a/arch/arm/mach-imx/devices/platform-mxc_rnga.c
> +++ b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
> @@ -6,6 +6,7 @@
>   * the terms of the GNU General Public License version 2 as published by the
>   * Free Software Foundation.
>   */
> +#include <linux/err.h>
>  #include "../hardware.h"
>  #include "devices-common.h"
>  
> @@ -48,9 +49,6 @@ static int __init imxXX_add_mxc_rnga(void)
>  #endif /* if defined(CONFIG_SOC_IMX31) */
>  		ret = ERR_PTR(-ENODEV);
>  
> -	if (IS_ERR(ret))
> -		return PTR_ERR(ret);
> -
> -	return 0;
> +	return PTR_ERR_OR_ZERO(ret);

The existing code looks just fine and actually more readable to me.
Also, all the files you are patching will eventually be killed by DT
support.  So let's just leave it there as it is for now.

Shawn

>  }
>  arch_initcall(imxXX_add_mxc_rnga);
> -- 
> 1.7.9.5
>
Sachin Kamat May 29, 2014, 8:06 a.m. UTC | #2
On 29 May 2014 13:33, Shawn Guo <shawn.guo@freescale.com> wrote:
> On Thu, May 29, 2014 at 10:27:10AM +0530, Sachin Kamat wrote:
>> PTR_ERR_OR_ZERO simplifies the code.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> ---
>>  arch/arm/mach-imx/devices/platform-mxc_rnga.c |    6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/mach-imx/devices/platform-mxc_rnga.c b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
>> index c58404badb59..33d58ca2001a 100644
>> --- a/arch/arm/mach-imx/devices/platform-mxc_rnga.c
>> +++ b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
>> @@ -6,6 +6,7 @@
>>   * the terms of the GNU General Public License version 2 as published by the
>>   * Free Software Foundation.
>>   */
>> +#include <linux/err.h>
>>  #include "../hardware.h"
>>  #include "devices-common.h"
>>
>> @@ -48,9 +49,6 @@ static int __init imxXX_add_mxc_rnga(void)
>>  #endif /* if defined(CONFIG_SOC_IMX31) */
>>               ret = ERR_PTR(-ENODEV);
>>
>> -     if (IS_ERR(ret))
>> -             return PTR_ERR(ret);
>> -
>> -     return 0;
>> +     return PTR_ERR_OR_ZERO(ret);
>
> The existing code looks just fine and actually more readable to me.
> Also, all the files you are patching will eventually be killed by DT
> support.  So let's just leave it there as it is for now.

If these files are meant to go, then we can leave these changes out.
Thanks Shawn.
Philippe Rétornaz June 2, 2014, 5:18 p.m. UTC | #3
Le 29/05/2014 10:03, Shawn Guo a écrit :
> On Thu, May 29, 2014 at 10:27:10AM +0530, Sachin Kamat wrote:
>> PTR_ERR_OR_ZERO simplifies the code.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> ---
>> arch/arm/mach-imx/devices/platform-mxc_rnga.c |    6 ++---- 1 file
>> changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/mach-imx/devices/platform-mxc_rnga.c
>> b/arch/arm/mach-imx/devices/platform-mxc_rnga.c index
>> [...]
>
> The existing code looks just fine and actually more readable to me.
> Also, all the files you are patching will eventually be killed by DT
> support.  So let's just leave it there as it is for now.

heh ... well ... not so fast please !
There is a non-negligible amount of work to have a fully functional
imx31 on DT.

Not working:
- USB  (chipidea driver sort of works, but the PHY is a complete mess).
- Camera
- SPI hardware chip select support
- pinmux support is totally absent

Currently, on imx31 we can boot on DT with (and only if the bootloader
does the pinmux for you):
- SDMA
- Watchdog
- SDHC
- Timer
- Uart

And I did not even had a look at the i2c, EMI, LCD and sound support.

So I hope imx31 platform boards can stay until the situation gets better.

Thanks,

Philippe
diff mbox

Patch

diff --git a/arch/arm/mach-imx/devices/platform-mxc_rnga.c b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
index c58404badb59..33d58ca2001a 100644
--- a/arch/arm/mach-imx/devices/platform-mxc_rnga.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
@@ -6,6 +6,7 @@ 
  * the terms of the GNU General Public License version 2 as published by the
  * Free Software Foundation.
  */
+#include <linux/err.h>
 #include "../hardware.h"
 #include "devices-common.h"
 
@@ -48,9 +49,6 @@  static int __init imxXX_add_mxc_rnga(void)
 #endif /* if defined(CONFIG_SOC_IMX31) */
 		ret = ERR_PTR(-ENODEV);
 
-	if (IS_ERR(ret))
-		return PTR_ERR(ret);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(ret);
 }
 arch_initcall(imxXX_add_mxc_rnga);