[PATCH] staging: unisys: visorbus: add missing include

2016-10-15 Thread Laurent Navet
this removes lots of sparse warnings :
warning: symbol 'visorchannel_destroy' was not declared. Should it be static?
warning: symbol 'visorchannel_get_physaddr' was not declared. Should it be 
static?
warning: symbol 'visorchannel_get_nbytes' was not declared. Should it be static?
warning: symbol 'visorchannel_uuid_id' was not declared. Should it be static?
warning: symbol 'visorchannel_id' was not declared. Should it be static?
warning: symbol 'visorchannel_zoneid' was not declared. Should it be static?
warning: symbol 'visorchannel_get_clientpartition' was not declared. Should it 
be static?
warning: symbol 'visorchannel_set_clientpartition' was not declared. Should it 
be static?
warning: symbol 'visorchannel_read' was not declared. Should it be static?
warning: symbol 'visorchannel_write' was not declared. Should it be static?
warning: symbol 'visorchannel_get_header' was not declared. Should it be static?
warning: symbol 'visorchannel_create' was not declared. Should it be static?
warning: symbol 'visorchannel_create_with_lock' was not declared. Should it be 
static?

Signed-off-by: Laurent Navet <laurent.na...@gmail.com>
---
 drivers/staging/unisys/visorbus/visorchannel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 300a65d..a1381eb 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -23,6 +23,7 @@
 #include 
 
 #include "visorbus.h"
+#include "visorbus_private.h"
 #include "controlvmchannel.h"
 
 #define MYDRVNAME "visorchannel"
-- 
2.1.4



[PATCH] staging: unisys: visorbus: add missing include

2016-10-15 Thread Laurent Navet
this removes lots of sparse warnings :
warning: symbol 'visorchannel_destroy' was not declared. Should it be static?
warning: symbol 'visorchannel_get_physaddr' was not declared. Should it be 
static?
warning: symbol 'visorchannel_get_nbytes' was not declared. Should it be static?
warning: symbol 'visorchannel_uuid_id' was not declared. Should it be static?
warning: symbol 'visorchannel_id' was not declared. Should it be static?
warning: symbol 'visorchannel_zoneid' was not declared. Should it be static?
warning: symbol 'visorchannel_get_clientpartition' was not declared. Should it 
be static?
warning: symbol 'visorchannel_set_clientpartition' was not declared. Should it 
be static?
warning: symbol 'visorchannel_read' was not declared. Should it be static?
warning: symbol 'visorchannel_write' was not declared. Should it be static?
warning: symbol 'visorchannel_get_header' was not declared. Should it be static?
warning: symbol 'visorchannel_create' was not declared. Should it be static?
warning: symbol 'visorchannel_create_with_lock' was not declared. Should it be 
static?

Signed-off-by: Laurent Navet 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 300a65d..a1381eb 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -23,6 +23,7 @@
 #include 
 
 #include "visorbus.h"
+#include "visorbus_private.h"
 #include "controlvmchannel.h"
 
 #define MYDRVNAME "visorchannel"
-- 
2.1.4



[PATCH] docs/driver-model: fix typo

2016-09-15 Thread Laurent Navet
No need to be be, just be should be sufficient.

Signed-off-by: Laurent Navet <laurent.na...@gmail.com>
---
 Documentation/driver-model/device.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/driver-model/device.txt 
b/Documentation/driver-model/device.txt
index 1e70220..2403eb8 100644
--- a/Documentation/driver-model/device.txt
+++ b/Documentation/driver-model/device.txt
@@ -50,7 +50,7 @@ Attributes of devices can be exported by a device driver 
through sysfs.
 Please see Documentation/filesystems/sysfs.txt for more information
 on how sysfs works.
 
-As explained in Documentation/kobject.txt, device attributes must be be
+As explained in Documentation/kobject.txt, device attributes must be
 created before the KOBJ_ADD uevent is generated. The only way to realize
 that is by defining an attribute group.
 
-- 
2.1.4



[PATCH] docs/driver-model: fix typo

2016-09-15 Thread Laurent Navet
No need to be be, just be should be sufficient.

Signed-off-by: Laurent Navet 
---
 Documentation/driver-model/device.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/driver-model/device.txt 
b/Documentation/driver-model/device.txt
index 1e70220..2403eb8 100644
--- a/Documentation/driver-model/device.txt
+++ b/Documentation/driver-model/device.txt
@@ -50,7 +50,7 @@ Attributes of devices can be exported by a device driver 
through sysfs.
 Please see Documentation/filesystems/sysfs.txt for more information
 on how sysfs works.
 
-As explained in Documentation/kobject.txt, device attributes must be be
+As explained in Documentation/kobject.txt, device attributes must be
 created before the KOBJ_ADD uevent is generated. The only way to realize
 that is by defining an attribute group.
 
-- 
2.1.4



Re: [PATCH] resources: Remove unneeded initialization of local variable

2015-12-29 Thread Laurent Navet
why not directly ?

struct region_devres *dr = devres_alloc(devm_region_release,
sizeof(struct region_devres),..



2015-12-29 14:24 UTC+01:00, Bojan Prtvar :
> Few lines below dr is reinitialized by devres_alloc()
> so we don't need to init it by NULL in the beginning of
> __devm_request_region()
>
> Signed-off-by: Bojan Prtvar 
> ---
>  kernel/resource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/resource.c b/kernel/resource.c
> index f150dbb..1e48ede 100644
> --- a/kernel/resource.c
> +++ b/kernel/resource.c
> @@ -1356,7 +1356,7 @@ struct resource * __devm_request_region(struct device
> *dev,
>   struct resource *parent, resource_size_t start,
>   resource_size_t n, const char *name)
>  {
> - struct region_devres *dr = NULL;
> + struct region_devres *dr;
>   struct resource *res;
>
>   dr = devres_alloc(devm_region_release, sizeof(struct region_devres),
> --
> 2.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors"
> in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] resources: Remove unneeded initialization of local variable

2015-12-29 Thread Laurent Navet
why not directly ?

struct region_devres *dr = devres_alloc(devm_region_release,
sizeof(struct region_devres),..



2015-12-29 14:24 UTC+01:00, Bojan Prtvar :
> Few lines below dr is reinitialized by devres_alloc()
> so we don't need to init it by NULL in the beginning of
> __devm_request_region()
>
> Signed-off-by: Bojan Prtvar 
> ---
>  kernel/resource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/resource.c b/kernel/resource.c
> index f150dbb..1e48ede 100644
> --- a/kernel/resource.c
> +++ b/kernel/resource.c
> @@ -1356,7 +1356,7 @@ struct resource * __devm_request_region(struct device
> *dev,
>   struct resource *parent, resource_size_t start,
>   resource_size_t n, const char *name)
>  {
> - struct region_devres *dr = NULL;
> + struct region_devres *dr;
>   struct resource *res;
>
>   dr = devres_alloc(devm_region_release, sizeof(struct region_devres),
> --
> 2.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors"
> in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] i2c: s3c2410: remove unused variable

2015-07-17 Thread Laurent Navet
in i2c_s3c_irq_nextbyte() ret is assigned zero and just used to return.
Remove it and make i2c_s3c_irq_nextbyte() a void function.
Found by using coccinelle.

Signed-off-by: Laurent Navet 
---
 drivers/i2c/busses/i2c-s3c2410.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 50bfd8c..612303a 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -146,7 +146,7 @@ static const struct platform_device_id s3c24xx_driver_ids[] 
= {
 };
 MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids);
 
-static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long 
iicstat);
+static void i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long 
iicstat);
 
 #ifdef CONFIG_OF
 static const struct of_device_id s3c24xx_i2c_match[] = {
@@ -405,11 +405,10 @@ static inline int is_msgend(struct s3c24xx_i2c *i2c)
  * process an interrupt and work out what to do
  */
 
-static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
+static void i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long 
iicstat)
 {
unsigned long tmp;
unsigned char byte;
-   int ret = 0;
 
switch (i2c->state) {
 
@@ -565,7 +564,7 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, 
unsigned long iicstat)
tmp &= ~S3C2410_IICCON_IRQPEND;
writel(tmp, i2c->regs + S3C2410_IICCON);
  out:
-   return ret;
+   return;
 }
 
 /* s3c24xx_i2c_irq
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] i2c: s3c2410: remove unused variable

2015-07-17 Thread Laurent Navet
in i2c_s3c_irq_nextbyte() ret is assigned zero and just used to return.
Remove it and make i2c_s3c_irq_nextbyte() a void function.
Found by using coccinelle.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/i2c/busses/i2c-s3c2410.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 50bfd8c..612303a 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -146,7 +146,7 @@ static const struct platform_device_id s3c24xx_driver_ids[] 
= {
 };
 MODULE_DEVICE_TABLE(platform, s3c24xx_driver_ids);
 
-static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long 
iicstat);
+static void i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long 
iicstat);
 
 #ifdef CONFIG_OF
 static const struct of_device_id s3c24xx_i2c_match[] = {
@@ -405,11 +405,10 @@ static inline int is_msgend(struct s3c24xx_i2c *i2c)
  * process an interrupt and work out what to do
  */
 
-static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
+static void i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long 
iicstat)
 {
unsigned long tmp;
unsigned char byte;
-   int ret = 0;
 
switch (i2c-state) {
 
@@ -565,7 +564,7 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, 
unsigned long iicstat)
tmp = ~S3C2410_IICCON_IRQPEND;
writel(tmp, i2c-regs + S3C2410_IICCON);
  out:
-   return ret;
+   return;
 }
 
 /* s3c24xx_i2c_irq
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] i2c: s3c2410: remove unused variable

2015-07-16 Thread Laurent Navet
ret is assigned zero and just used to return. remove it.
Found by using coccinelle.

Signed-off-by: Laurent Navet 
---
 drivers/i2c/busses/i2c-s3c2410.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 50bfd8c..cf3c6c0 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -409,7 +409,6 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, 
unsigned long iicstat)
 {
unsigned long tmp;
unsigned char byte;
-   int ret = 0;
 
switch (i2c->state) {
 
@@ -565,7 +564,7 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, 
unsigned long iicstat)
tmp &= ~S3C2410_IICCON_IRQPEND;
writel(tmp, i2c->regs + S3C2410_IICCON);
  out:
-   return ret;
+   return 0;
 }
 
 /* s3c24xx_i2c_irq
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] i2c: s3c2410: remove unused variable

2015-07-16 Thread Laurent Navet
ret is assigned zero and just used to return. remove it.
Found by using coccinelle.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/i2c/busses/i2c-s3c2410.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 50bfd8c..cf3c6c0 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -409,7 +409,6 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, 
unsigned long iicstat)
 {
unsigned long tmp;
unsigned char byte;
-   int ret = 0;
 
switch (i2c-state) {
 
@@ -565,7 +564,7 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, 
unsigned long iicstat)
tmp = ~S3C2410_IICCON_IRQPEND;
writel(tmp, i2c-regs + S3C2410_IICCON);
  out:
-   return ret;
+   return 0;
 }
 
 /* s3c24xx_i2c_irq
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ext4 crypto: fix typo

2015-07-09 Thread Laurent Navet
derivatio -> derivation.

Signed-off-by: Laurent Navet 
---
 fs/ext4/crypto_key.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index ce75bc8..1d510c1 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -30,7 +30,7 @@ static void derive_crypt_complete(struct crypto_async_request 
*req, int rc)
 
 /**
  * ext4_derive_key_aes() - Derive a key using AES-128-ECB
- * @deriving_key: Encryption key used for derivatio.
+ * @deriving_key: Encryption key used for derivation.
  * @source_key:   Source key to which to apply derivation.
  * @derived_key:  Derived key.
  *
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] ext4 crypto: exit cleanly if ext4_derive_key_aes() fails

2015-07-09 Thread Laurent Navet
Return value of ext4_derive_key_aes() is stored but not used.
Add test to exit cleanly if ext4_derive_key_aes() fail.
Also fix coverity CID 1309760.

Signed-off-by: Laurent Navet 
---
 fs/ext4/crypto_key.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index 442d24e..ce75bc8 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -220,6 +220,8 @@ retry:
BUG_ON(master_key->size != EXT4_AES_256_XTS_KEY_SIZE);
res = ext4_derive_key_aes(ctx.nonce, master_key->raw,
  raw_key);
+   if (res)
+   goto out;
 got_key:
ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
if (!ctfm || IS_ERR(ctfm)) {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ext4 crypto: remove unneeded assignation

2015-07-09 Thread Laurent Navet
Make sense,
I send a v2, thank's

2015-07-08 22:01 UTC+02:00, Darrick J. Wong :
> On Wed, Jul 08, 2015 at 09:51:15PM +0200, Laurent Navet wrote:
>> Return value of ext4_derive_key_aes() is stored but never used before
>> being overwritten.
>> Also fix coverity CID 1309760.
>>
>> Signed-off-by: Laurent Navet 
>> ---
>>  fs/ext4/crypto_key.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
>> index 442d24e..92f9172 100644
>> --- a/fs/ext4/crypto_key.c
>> +++ b/fs/ext4/crypto_key.c
>> @@ -218,7 +218,7 @@ retry:
>>  BUILD_BUG_ON(EXT4_AES_128_ECB_KEY_SIZE !=
>>   EXT4_KEY_DERIVATION_NONCE_SIZE);
>>  BUG_ON(master_key->size != EXT4_AES_256_XTS_KEY_SIZE);
>> -res = ext4_derive_key_aes(ctx.nonce, master_key->raw,
>> +ext4_derive_key_aes(ctx.nonce, master_key->raw,
>>raw_key);
>
> I don't think it's a good idea to drop the error code on the floor and keep
> going as if nothing bad had happened.
>
> --D
>
>>  got_key:
>>  ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
>> --
>> 2.1.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ext4 crypto: remove unneeded assignation

2015-07-09 Thread Laurent Navet
Make sense,
I send a v2, thank's

2015-07-08 22:01 UTC+02:00, Darrick J. Wong darrick.w...@oracle.com:
 On Wed, Jul 08, 2015 at 09:51:15PM +0200, Laurent Navet wrote:
 Return value of ext4_derive_key_aes() is stored but never used before
 being overwritten.
 Also fix coverity CID 1309760.

 Signed-off-by: Laurent Navet laurent.na...@gmail.com
 ---
  fs/ext4/crypto_key.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
 index 442d24e..92f9172 100644
 --- a/fs/ext4/crypto_key.c
 +++ b/fs/ext4/crypto_key.c
 @@ -218,7 +218,7 @@ retry:
  BUILD_BUG_ON(EXT4_AES_128_ECB_KEY_SIZE !=
   EXT4_KEY_DERIVATION_NONCE_SIZE);
  BUG_ON(master_key-size != EXT4_AES_256_XTS_KEY_SIZE);
 -res = ext4_derive_key_aes(ctx.nonce, master_key-raw,
 +ext4_derive_key_aes(ctx.nonce, master_key-raw,
raw_key);

 I don't think it's a good idea to drop the error code on the floor and keep
 going as if nothing bad had happened.

 --D

  got_key:
  ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
 --
 2.1.4

 --
 To unsubscribe from this list: send the line unsubscribe linux-ext4 in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ext4 crypto: fix typo

2015-07-09 Thread Laurent Navet
derivatio - derivation.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 fs/ext4/crypto_key.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index ce75bc8..1d510c1 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -30,7 +30,7 @@ static void derive_crypt_complete(struct crypto_async_request 
*req, int rc)
 
 /**
  * ext4_derive_key_aes() - Derive a key using AES-128-ECB
- * @deriving_key: Encryption key used for derivatio.
+ * @deriving_key: Encryption key used for derivation.
  * @source_key:   Source key to which to apply derivation.
  * @derived_key:  Derived key.
  *
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] ext4 crypto: exit cleanly if ext4_derive_key_aes() fails

2015-07-09 Thread Laurent Navet
Return value of ext4_derive_key_aes() is stored but not used.
Add test to exit cleanly if ext4_derive_key_aes() fail.
Also fix coverity CID 1309760.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 fs/ext4/crypto_key.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index 442d24e..ce75bc8 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -220,6 +220,8 @@ retry:
BUG_ON(master_key-size != EXT4_AES_256_XTS_KEY_SIZE);
res = ext4_derive_key_aes(ctx.nonce, master_key-raw,
  raw_key);
+   if (res)
+   goto out;
 got_key:
ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
if (!ctfm || IS_ERR(ctfm)) {
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ext4 crypto: remove unneeded assignation

2015-07-08 Thread Laurent Navet
Return value of ext4_derive_key_aes() is stored but never used before
being overwritten.
Also fix coverity CID 1309760.

Signed-off-by: Laurent Navet 
---
 fs/ext4/crypto_key.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index 442d24e..92f9172 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -218,7 +218,7 @@ retry:
BUILD_BUG_ON(EXT4_AES_128_ECB_KEY_SIZE !=
 EXT4_KEY_DERIVATION_NONCE_SIZE);
BUG_ON(master_key->size != EXT4_AES_256_XTS_KEY_SIZE);
-   res = ext4_derive_key_aes(ctx.nonce, master_key->raw,
+   ext4_derive_key_aes(ctx.nonce, master_key->raw,
  raw_key);
 got_key:
ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [media] dvb-core: remove ktime_add_us() call

2015-07-08 Thread Laurent Navet
Calling ktime_add_us() seems useless as is only useful for it's return 
value which is ignored.
Also fix coverity CID 1309761.

Signed-off-by: Laurent Navet 
---
 drivers/media/dvb-core/dvb_frontend.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/dvb-core/dvb_frontend.c 
b/drivers/media/dvb-core/dvb_frontend.c
index 842b9c8..4205628 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -901,7 +901,6 @@ void dvb_frontend_sleep_until(ktime_t *waketime, u32 
add_usec)
 {
s32 delta, newdelta;
 
-   ktime_add_us(*waketime, add_usec);
delta = ktime_us_delta(ktime_get_real(), *waketime);
if (delta > 2500) {
msleep((delta - 1500) / 1000);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ext4 crypto: remove unneeded assignation

2015-07-08 Thread Laurent Navet
Return value of ext4_derive_key_aes() is stored but never used before
being overwritten.
Also fix coverity CID 1309760.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 fs/ext4/crypto_key.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index 442d24e..92f9172 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -218,7 +218,7 @@ retry:
BUILD_BUG_ON(EXT4_AES_128_ECB_KEY_SIZE !=
 EXT4_KEY_DERIVATION_NONCE_SIZE);
BUG_ON(master_key-size != EXT4_AES_256_XTS_KEY_SIZE);
-   res = ext4_derive_key_aes(ctx.nonce, master_key-raw,
+   ext4_derive_key_aes(ctx.nonce, master_key-raw,
  raw_key);
 got_key:
ctfm = crypto_alloc_ablkcipher(cipher_str, 0, 0);
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [media] dvb-core: remove ktime_add_us() call

2015-07-08 Thread Laurent Navet
Calling ktime_add_us() seems useless as is only useful for it's return 
value which is ignored.
Also fix coverity CID 1309761.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/media/dvb-core/dvb_frontend.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/dvb-core/dvb_frontend.c 
b/drivers/media/dvb-core/dvb_frontend.c
index 842b9c8..4205628 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -901,7 +901,6 @@ void dvb_frontend_sleep_until(ktime_t *waketime, u32 
add_usec)
 {
s32 delta, newdelta;
 
-   ktime_add_us(*waketime, add_usec);
delta = ktime_us_delta(ktime_get_real(), *waketime);
if (delta  2500) {
msleep((delta - 1500) / 1000);
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] gpiolib: remove unneeded assignation

2015-07-07 Thread Laurent Navet
ret is assigned value from of_property_read_string_index but is
overwritten before being used so remove it.
Also fix coverity CID 1309759

Signed-off-by: Laurent Navet 
---
 drivers/gpio/gpiolib-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index a6c67c6..346da01 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -365,7 +365,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip 
*chip)
 
if (pinspec.args[2]) {
if (group_names) {
-   ret = of_property_read_string_index(np,
+   of_property_read_string_index(np,
group_names_propname,
index, );
if (strlen(name)) {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] gpiolib: remove unneeded assignation

2015-07-07 Thread Laurent Navet
ret is assigned value from of_property_read_string_index but is
overwritten before being used so remove it.
Also fix coverity CID 1309759

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/gpio/gpiolib-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index a6c67c6..346da01 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -365,7 +365,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip 
*chip)
 
if (pinspec.args[2]) {
if (group_names) {
-   ret = of_property_read_string_index(np,
+   of_property_read_string_index(np,
group_names_propname,
index, name);
if (strlen(name)) {
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] iio: buffer: remove unneeded test

2015-05-30 Thread Laurent Navet
The same code is executed regardless ret value, so this test
can be removed.
Also fix coverity scan CID 1268786.

Signed-off-by: Laurent Navet 
---
 drivers/iio/industrialio-buffer.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/iio/industrialio-buffer.c 
b/drivers/iio/industrialio-buffer.c
index df919f4..e7fbcce 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -806,8 +806,6 @@ static ssize_t iio_buffer_store_enable(struct device *dev,
ret = __iio_update_buffers(indio_dev,
 NULL, indio_dev->buffer);
 
-   if (ret < 0)
-   goto done;
 done:
mutex_unlock(_dev->mlock);
return (ret < 0) ? ret : len;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] iio: buffer: remove unneeded test

2015-05-30 Thread Laurent Navet
The same code is executed regardless ret value, so this test
can be removed.
Also fix coverity scan CID 1268786.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/iio/industrialio-buffer.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/iio/industrialio-buffer.c 
b/drivers/iio/industrialio-buffer.c
index df919f4..e7fbcce 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -806,8 +806,6 @@ static ssize_t iio_buffer_store_enable(struct device *dev,
ret = __iio_update_buffers(indio_dev,
 NULL, indio_dev-buffer);
 
-   if (ret  0)
-   goto done;
 done:
mutex_unlock(indio_dev-mlock);
return (ret  0) ? ret : len;
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: gdm72xx: remove unneeded test

2015-05-27 Thread Laurent Navet
The same code is executed regardless ret value, so this test can be
removed.

Signed-off-by: Laurent Navet 
---
 drivers/staging/gdm72xx/usb_boot.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/gdm72xx/usb_boot.c 
b/drivers/staging/gdm72xx/usb_boot.c
index 3ccc447..7f80553 100644
--- a/drivers/staging/gdm72xx/usb_boot.c
+++ b/drivers/staging/gdm72xx/usb_boot.c
@@ -255,8 +255,6 @@ static int em_wait_ack(struct usb_device *usbdev, int 
send_zlp)
 
/*Wait for ACK*/
ret = gdm_wibro_recv(usbdev, , sizeof(ack));
-   if (ret < 0)
-   goto out;
 out:
return ret;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: gdm72xx: remove unneeded test

2015-05-27 Thread Laurent Navet
The same code is executed regardless ret value, so this test can be
removed.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/staging/gdm72xx/usb_boot.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/gdm72xx/usb_boot.c 
b/drivers/staging/gdm72xx/usb_boot.c
index 3ccc447..7f80553 100644
--- a/drivers/staging/gdm72xx/usb_boot.c
+++ b/drivers/staging/gdm72xx/usb_boot.c
@@ -255,8 +255,6 @@ static int em_wait_ack(struct usb_device *usbdev, int 
send_zlp)
 
/*Wait for ACK*/
ret = gdm_wibro_recv(usbdev, ack, sizeof(ack));
-   if (ret  0)
-   goto out;
 out:
return ret;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] i40e: remove unneeded tests

2015-05-26 Thread Laurent Navet
The same code is executed regardless ret_code value, so these tests can
be removed.
Fix Coverity CID 1268789 and 1268791

Signed-off-by: Laurent Navet 
---
 drivers/net/ethernet/intel/i40e/i40e_hmc.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_hmc.c 
b/drivers/net/ethernet/intel/i40e/i40e_hmc.c
index 9b987cc..eae4248 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_hmc.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_hmc.c
@@ -298,8 +298,6 @@ i40e_status i40e_remove_sd_bp_new(struct i40e_hw *hw,
goto exit;
}
ret_code = i40e_free_dma_mem(hw, &(sd_entry->u.bp.addr));
-   if (ret_code)
-   goto exit;
 exit:
return ret_code;
 }
@@ -353,8 +351,6 @@ i40e_status i40e_remove_pd_page_new(struct i40e_hw *hw,
}
/* free memory here */
ret_code = i40e_free_dma_mem(hw, &(sd_entry->u.pd_table.pd_page_addr));
-   if (ret_code)
-   goto exit;
 exit:
return ret_code;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] MAINTAINERS: update Emulex ocrdma email addresses

2015-05-26 Thread Laurent Navet
@emulex.com addresses respond to use @avagotech.com.

Signed-off-by: Laurent Navet 
---
 MAINTAINERS | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f8e0afb..05766f7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8846,9 +8846,9 @@ S:Supported
 F: drivers/net/ethernet/emulex/benet/
 
 EMULEX ONECONNECT ROCE DRIVER
-M: Selvin Xavier 
-M: Devesh Sharma 
-M: Mitesh Ahuja 
+M: Selvin Xavier 
+M: Devesh Sharma 
+M: Mitesh Ahuja 
 L: linux-r...@vger.kernel.org
 W: http://www.emulex.com
 S: Supported
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] i40e: remove unneeded tests

2015-05-26 Thread Laurent Navet
The same code is executed regardless ret_code value, so these tests can
be removed.
Fix Coverity CID 1268789 and 1268791

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/net/ethernet/intel/i40e/i40e_hmc.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_hmc.c 
b/drivers/net/ethernet/intel/i40e/i40e_hmc.c
index 9b987cc..eae4248 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_hmc.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_hmc.c
@@ -298,8 +298,6 @@ i40e_status i40e_remove_sd_bp_new(struct i40e_hw *hw,
goto exit;
}
ret_code = i40e_free_dma_mem(hw, (sd_entry-u.bp.addr));
-   if (ret_code)
-   goto exit;
 exit:
return ret_code;
 }
@@ -353,8 +351,6 @@ i40e_status i40e_remove_pd_page_new(struct i40e_hw *hw,
}
/* free memory here */
ret_code = i40e_free_dma_mem(hw, (sd_entry-u.pd_table.pd_page_addr));
-   if (ret_code)
-   goto exit;
 exit:
return ret_code;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] MAINTAINERS: update Emulex ocrdma email addresses

2015-05-26 Thread Laurent Navet
@emulex.com addresses respond to use @avagotech.com.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 MAINTAINERS | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f8e0afb..05766f7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8846,9 +8846,9 @@ S:Supported
 F: drivers/net/ethernet/emulex/benet/
 
 EMULEX ONECONNECT ROCE DRIVER
-M: Selvin Xavier selvin.xav...@emulex.com
-M: Devesh Sharma devesh.sha...@emulex.com
-M: Mitesh Ahuja mitesh.ah...@emulex.com
+M: Selvin Xavier selvin.xav...@avagotech.com
+M: Devesh Sharma devesh.sha...@avagotech.com
+M: Mitesh Ahuja mitesh.ah...@avagotech.com
 L: linux-r...@vger.kernel.org
 W: http://www.emulex.com
 S: Supported
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] RDMA/ocrdma: remove unneeded tests

2015-05-21 Thread Laurent Navet
The same code is executed regardless status value, so these tests can
be removed.
Fix Coverity CID 1271151 and 1268788

Signed-off-by: Laurent Navet 
---
 drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c 
b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index 0c9e959..e748090 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -1960,9 +1960,6 @@ static int ocrdma_mbx_reg_mr_cont(struct ocrdma_dev *dev,
upper_32_bits(hwmr->pbl_table[i + pbl_offset].pa);
}
status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
-   if (status)
-   goto mbx_err;
-mbx_err:
kfree(cmd);
return status;
 }
@@ -3044,9 +3041,6 @@ static int ocrdma_mbx_modify_eqd(struct ocrdma_dev *dev, 
struct ocrdma_eq *eq,
(eq[i].aic_obj.prev_eqd * 65)/100;
}
status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
-   if (status)
-   goto mbx_err;
-mbx_err:
kfree(cmd);
return status;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] RDMA/ocrdma: remove unneeded tests

2015-05-21 Thread Laurent Navet
The same code is executed regardless status value, so these tests can
be removed.
Fix Coverity CID 1271151 and 1268788

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c 
b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index 0c9e959..e748090 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -1960,9 +1960,6 @@ static int ocrdma_mbx_reg_mr_cont(struct ocrdma_dev *dev,
upper_32_bits(hwmr-pbl_table[i + pbl_offset].pa);
}
status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
-   if (status)
-   goto mbx_err;
-mbx_err:
kfree(cmd);
return status;
 }
@@ -3044,9 +3041,6 @@ static int ocrdma_mbx_modify_eqd(struct ocrdma_dev *dev, 
struct ocrdma_eq *eq,
(eq[i].aic_obj.prev_eqd * 65)/100;
}
status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd);
-   if (status)
-   goto mbx_err;
-mbx_err:
kfree(cmd);
return status;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [media] fc0013: remove unneeded test

2015-04-02 Thread Laurent Navet
The same code is executed if ret is true or false, so this test can
be removed.
Fix Coverity CID 1268782.

Signed-off-by: Laurent Navet 
---
 drivers/media/tuners/fc0013.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/tuners/fc0013.c b/drivers/media/tuners/fc0013.c
index b416231..522690d 100644
--- a/drivers/media/tuners/fc0013.c
+++ b/drivers/media/tuners/fc0013.c
@@ -217,8 +217,6 @@ static int fc0013_set_vhf_track(struct fc0013_priv *priv, 
u32 freq)
} else {/* UHF and GPS */
ret = fc0013_writereg(priv, 0x1d, tmp | 0x1c);
}
-   if (ret)
-   goto error_out;
 error_out:
return ret;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] [media] fc0013: remove unneeded test

2015-04-02 Thread Laurent Navet
The same code is executed if ret is true or false, so this test can
be removed.
Fix Coverity CID 1268782.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/media/tuners/fc0013.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/tuners/fc0013.c b/drivers/media/tuners/fc0013.c
index b416231..522690d 100644
--- a/drivers/media/tuners/fc0013.c
+++ b/drivers/media/tuners/fc0013.c
@@ -217,8 +217,6 @@ static int fc0013_set_vhf_track(struct fc0013_priv *priv, 
u32 freq)
} else {/* UHF and GPS */
ret = fc0013_writereg(priv, 0x1d, tmp | 0x1c);
}
-   if (ret)
-   goto error_out;
 error_out:
return ret;
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: line6: fix possible overrun

2014-04-27 Thread Laurent Navet
Thank's for your answers,
will try to look deeper,

>> >
>> > If we want to sovle the truncation issue then we need to think of
>> > shorter names for BassPODxtLive, BassPODxtPro, PODStudioUX1, and
>> > PODStudioUX2.
>> >
>>
>> In that case I suggest compile time assertions that ids and names fit
>
> That sounds like some magic code which I would love to see.  :)
>
>>  and a WARN_ON + -EINVAL in line6_init_audio to catch future
>>  offenders.
>
> Returning -EINVAL is a bad idea because it would break the driver
> completely and make it unusable.
>
>>
>> As a side note I'm not sure if pod_try_init from
>> drivers/staging/line6/pod.c
>> cleans up properly after failed line6_init_audio.
>
> Yeah.  It doesn't seem to clean up at all.
>

Laurent Navet.
-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: line6: fix possible overrun

2014-04-27 Thread Laurent Navet
Thank's for your answers,
will try to look deeper,

 
  If we want to sovle the truncation issue then we need to think of
  shorter names for BassPODxtLive, BassPODxtPro, PODStudioUX1, and
  PODStudioUX2.
 

 In that case I suggest compile time assertions that ids and names fit

 That sounds like some magic code which I would love to see.  :)

  and a WARN_ON + -EINVAL in line6_init_audio to catch future
  offenders.

 Returning -EINVAL is a bad idea because it would break the driver
 completely and make it unusable.


 As a side note I'm not sure if pod_try_init from
 drivers/staging/line6/pod.c
 cleans up properly after failed line6_init_audio.

 Yeah.  It doesn't seem to clean up at all.


Laurent Navet.
-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: line6: fix possible overrun

2014-04-26 Thread Laurent Navet
The strcpy operation may write past the end of the fixed-size destination
buffer if the source buffer is too large.

Found by coverity scan : CID 144979

Signed-off-by: Laurent Navet 
---
build tested only

 drivers/staging/line6/audio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/line6/audio.c b/drivers/staging/line6/audio.c
index 171d80c..65f5cd4 100644
--- a/drivers/staging/line6/audio.c
+++ b/drivers/staging/line6/audio.c
@@ -32,9 +32,10 @@ int line6_init_audio(struct usb_line6 *line6)
 
line6->card = card;
 
-   strcpy(card->id, line6->properties->id);
+   strncpy(card->id, line6->properties->id, (sizeof(card->id)-1));
strcpy(card->driver, DRIVER_NAME);
-   strcpy(card->shortname, line6->properties->name);
+   strncpy(card->shortname, line6->properties->name,
+   (sizeof(card->shortname)-1));
/* longname is 80 chars - see asound.h */
sprintf(card->longname, "Line6 %s at USB %s", line6->properties->name,
dev_name(line6->ifcdev));
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: line6: fix possible overrun

2014-04-26 Thread Laurent Navet
The strcpy operation may write past the end of the fixed-size destination
buffer if the source buffer is too large.

Found by coverity scan : CID 144979

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
build tested only

 drivers/staging/line6/audio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/line6/audio.c b/drivers/staging/line6/audio.c
index 171d80c..65f5cd4 100644
--- a/drivers/staging/line6/audio.c
+++ b/drivers/staging/line6/audio.c
@@ -32,9 +32,10 @@ int line6_init_audio(struct usb_line6 *line6)
 
line6-card = card;
 
-   strcpy(card-id, line6-properties-id);
+   strncpy(card-id, line6-properties-id, (sizeof(card-id)-1));
strcpy(card-driver, DRIVER_NAME);
-   strcpy(card-shortname, line6-properties-name);
+   strncpy(card-shortname, line6-properties-name,
+   (sizeof(card-shortname)-1));
/* longname is 80 chars - see asound.h */
sprintf(card-longname, Line6 %s at USB %s, line6-properties-name,
dev_name(line6-ifcdev));
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: slicoss: fix possible missing iounmap

2013-11-15 Thread Laurent Navet
if slic_card_locate failed, memmapped_ioaddr is not unmapped.

Signed-off-by: Laurent Navet 
---
 drivers/staging/slicoss/slicoss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index 652272b..ab7206d 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -3708,7 +3708,7 @@ static int slic_entry_probe(struct pci_dev *pcidev,
err = slic_card_locate(adapter);
if (err) {
dev_err(>dev, "cannot locate card\n");
-   goto err_out_free_mmio_region;
+   goto err_out_unmap;
}
 
card = adapter->card;
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: slicoss: fix possible missing iounmap

2013-11-15 Thread Laurent Navet
if slic_card_locate failed, memmapped_ioaddr is not unmapped.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/staging/slicoss/slicoss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index 652272b..ab7206d 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -3708,7 +3708,7 @@ static int slic_entry_probe(struct pci_dev *pcidev,
err = slic_card_locate(adapter);
if (err) {
dev_err(pcidev-dev, cannot locate card\n);
-   goto err_out_free_mmio_region;
+   goto err_out_unmap;
}
 
card = adapter-card;
-- 
1.8.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] octeon_mgmt: remove double validation of mac address

2013-10-29 Thread Laurent Navet
Mac address validity is already checked in of_get_mac_address().
No need to do it twice.

Signed-off-by: Laurent Navet 
---
 drivers/net/ethernet/octeon/octeon_mgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c 
b/drivers/net/ethernet/octeon/octeon_mgmt.c
index 622aa75..1b326cbc 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -1545,7 +1545,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
 
mac = of_get_mac_address(pdev->dev.of_node);
 
-   if (mac && is_valid_ether_addr(mac))
+   if (mac)
memcpy(netdev->dev_addr, mac, ETH_ALEN);
else
eth_hw_addr_random(netdev);
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mvneta: remove double validation of mac address

2013-10-29 Thread Laurent Navet
Mac address validity is already checked in of_get_mac_address().
No need to do it twice.

Signed-off-by: Laurent Navet 
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c 
b/drivers/net/ethernet/marvell/mvneta.c
index e35bac7..7d99e695 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2811,7 +2811,7 @@ static int mvneta_probe(struct platform_device *pdev)
}
 
dt_mac_addr = of_get_mac_address(dn);
-   if (dt_mac_addr && is_valid_ether_addr(dt_mac_addr)) {
+   if (dt_mac_addr) {
mac_from = "device tree";
memcpy(dev->dev_addr, dt_mac_addr, ETH_ALEN);
} else {
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mvneta: remove double validation of mac address

2013-10-29 Thread Laurent Navet
Mac address validity is already checked in of_get_mac_address().
No need to do it twice.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c 
b/drivers/net/ethernet/marvell/mvneta.c
index e35bac7..7d99e695 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2811,7 +2811,7 @@ static int mvneta_probe(struct platform_device *pdev)
}
 
dt_mac_addr = of_get_mac_address(dn);
-   if (dt_mac_addr  is_valid_ether_addr(dt_mac_addr)) {
+   if (dt_mac_addr) {
mac_from = device tree;
memcpy(dev-dev_addr, dt_mac_addr, ETH_ALEN);
} else {
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] octeon_mgmt: remove double validation of mac address

2013-10-29 Thread Laurent Navet
Mac address validity is already checked in of_get_mac_address().
No need to do it twice.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/net/ethernet/octeon/octeon_mgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c 
b/drivers/net/ethernet/octeon/octeon_mgmt.c
index 622aa75..1b326cbc 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -1545,7 +1545,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
 
mac = of_get_mac_address(pdev-dev.of_node);
 
-   if (mac  is_valid_ether_addr(mac))
+   if (mac)
memcpy(netdev-dev_addr, mac, ETH_ALEN);
else
eth_hw_addr_random(netdev);
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: lustre: use ERR_CAST() function

2013-07-05 Thread Laurent Navet
use ERR_CAST() function instead of ERR_PTR() and PTR_ERR()
found using coccinelle and err_cast.cocci

Signed-off-by: Laurent Navet 
---
 drivers/staging/lustre/lustre/llite/llite_nfs.c|2 +-
 drivers/staging/lustre/lustre/llite/rw.c   |2 +-
 drivers/staging/lustre/lustre/obdclass/local_storage.c |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c 
b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index 28cc41e..d2c459c 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -131,7 +131,7 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, 
struct lu_fid *paren
 
inode = search_inode_for_lustre(sb, fid);
if (IS_ERR(inode))
-   RETURN(ERR_PTR(PTR_ERR(inode)));
+   RETURN(ERR_CAST(inode));
 
if (is_bad_inode(inode)) {
/* we didn't find the right inode.. */
diff --git a/drivers/staging/lustre/lustre/llite/rw.c 
b/drivers/staging/lustre/lustre/llite/rw.c
index fac1178..30e98ed 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -110,7 +110,7 @@ static struct ll_cl_context *ll_cl_init(struct file *file,
 
env = cl_env_get();
if (IS_ERR(env))
-   return ERR_PTR(PTR_ERR(env));
+   return ERR_CAST(env);
 
lcc = _env_info(env)->vti_io_ctx;
memset(lcc, 0, sizeof(*lcc));
diff --git a/drivers/staging/lustre/lustre/obdclass/local_storage.c 
b/drivers/staging/lustre/lustre/obdclass/local_storage.c
index 3be35a8..e1db7ab 100644
--- a/drivers/staging/lustre/lustre/obdclass/local_storage.c
+++ b/drivers/staging/lustre/lustre/obdclass/local_storage.c
@@ -443,7 +443,7 @@ struct dt_object *local_file_find_or_create_with_fid(const 
struct lu_env *env,
 
ls = ls_device_get(dt);
if (IS_ERR(ls)) {
-   dto = ERR_PTR(PTR_ERR(ls));
+   dto = ERR_CAST(ls);
} else {
/* create the object */
dti->dti_attr.la_valid  = LA_MODE;
@@ -537,7 +537,7 @@ local_index_find_or_create_with_fid(const struct lu_env 
*env,
 
ls = ls_device_get(dt);
if (IS_ERR(ls)) {
-   dto = ERR_PTR(PTR_ERR(ls));
+   dto = ERR_CAST(ls);
} else {
/* create the object */
dti->dti_attr.la_valid  = LA_MODE;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: lustre: use ERR_CAST() function

2013-07-05 Thread Laurent Navet
use ERR_CAST() function instead of ERR_PTR() and PTR_ERR()
found using coccinelle and err_cast.cocci

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/staging/lustre/lustre/llite/llite_nfs.c|2 +-
 drivers/staging/lustre/lustre/llite/rw.c   |2 +-
 drivers/staging/lustre/lustre/obdclass/local_storage.c |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c 
b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index 28cc41e..d2c459c 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -131,7 +131,7 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, 
struct lu_fid *paren
 
inode = search_inode_for_lustre(sb, fid);
if (IS_ERR(inode))
-   RETURN(ERR_PTR(PTR_ERR(inode)));
+   RETURN(ERR_CAST(inode));
 
if (is_bad_inode(inode)) {
/* we didn't find the right inode.. */
diff --git a/drivers/staging/lustre/lustre/llite/rw.c 
b/drivers/staging/lustre/lustre/llite/rw.c
index fac1178..30e98ed 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -110,7 +110,7 @@ static struct ll_cl_context *ll_cl_init(struct file *file,
 
env = cl_env_get(refcheck);
if (IS_ERR(env))
-   return ERR_PTR(PTR_ERR(env));
+   return ERR_CAST(env);
 
lcc = vvp_env_info(env)-vti_io_ctx;
memset(lcc, 0, sizeof(*lcc));
diff --git a/drivers/staging/lustre/lustre/obdclass/local_storage.c 
b/drivers/staging/lustre/lustre/obdclass/local_storage.c
index 3be35a8..e1db7ab 100644
--- a/drivers/staging/lustre/lustre/obdclass/local_storage.c
+++ b/drivers/staging/lustre/lustre/obdclass/local_storage.c
@@ -443,7 +443,7 @@ struct dt_object *local_file_find_or_create_with_fid(const 
struct lu_env *env,
 
ls = ls_device_get(dt);
if (IS_ERR(ls)) {
-   dto = ERR_PTR(PTR_ERR(ls));
+   dto = ERR_CAST(ls);
} else {
/* create the object */
dti-dti_attr.la_valid  = LA_MODE;
@@ -537,7 +537,7 @@ local_index_find_or_create_with_fid(const struct lu_env 
*env,
 
ls = ls_device_get(dt);
if (IS_ERR(ls)) {
-   dto = ERR_PTR(PTR_ERR(ls));
+   dto = ERR_CAST(ls);
} else {
/* create the object */
dti-dti_attr.la_valid  = LA_MODE;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] drivers: video: mxsfb: clean use of devm_ioremap_resource()

2013-05-21 Thread Laurent Navet
Check of 'res' and calls to dev_err are already done in devm_ioremap_resource,
so no need to do them twice.

Signed-off-by: Laurent Navet 
---
 drivers/video/mxsfb.c |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 21223d4..6a1b338 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -883,12 +883,6 @@ static int mxsfb_probe(struct platform_device *pdev)
if (of_id)
pdev->id_entry = of_id->data;
 
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(>dev, "Cannot get memory IO resource\n");
-   return -ENODEV;
-   }
-
fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), >dev);
if (!fb_info) {
dev_err(>dev, "Failed to allocate fbdev\n");
@@ -897,9 +891,9 @@ static int mxsfb_probe(struct platform_device *pdev)
 
host = to_imxfb_host(fb_info);
 
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
host->base = devm_ioremap_resource(>dev, res);
if (IS_ERR(host->base)) {
-   dev_err(>dev, "ioremap failed\n");
ret = PTR_ERR(host->base);
goto fb_release;
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] drivers: video: mxsfb: clean use of devm_ioremap_resource()

2013-05-21 Thread Laurent Navet
Check of 'res' and calls to dev_err are already done in devm_ioremap_resource,
so no need to do them twice.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/video/mxsfb.c |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 21223d4..6a1b338 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -883,12 +883,6 @@ static int mxsfb_probe(struct platform_device *pdev)
if (of_id)
pdev-id_entry = of_id-data;
 
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(pdev-dev, Cannot get memory IO resource\n);
-   return -ENODEV;
-   }
-
fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), pdev-dev);
if (!fb_info) {
dev_err(pdev-dev, Failed to allocate fbdev\n);
@@ -897,9 +891,9 @@ static int mxsfb_probe(struct platform_device *pdev)
 
host = to_imxfb_host(fb_info);
 
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
host-base = devm_ioremap_resource(pdev-dev, res);
if (IS_ERR(host-base)) {
-   dev_err(pdev-dev, ioremap failed\n);
ret = PTR_ERR(host-base);
goto fb_release;
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: video: mxsfb: clean use of devm_ioremap_resource()

2013-05-16 Thread Laurent Navet
2013/5/16, Jingoo Han :
> It makes build warning as below:
>
> drivers/video/mxsfb.c:887:13: warning: 'host' is used uninitialized in this
> function [-Wuninitialized]
> drivers/video/mxsfb.c:965:21: warning: 'fb_info' may be used uninitialized
> in this function [-Wuninitialized]
>
> It breaks the assignment.
>   host = to_imxfb_host(fb_info);
>
> Also, 'goto fb_release;' is not good.
> Please use ' return PTR_ERR(host->base);' as below:
> +   host->base = devm_ioremap_resource(>dev, res);
> +   if (IS_ERR(host->base))
> +   return PTR_ERR(host->base);
>
>
> Best regards,
> Jingoo Han

Thank's for reviewing, I'll look at and resend.

Laurent,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] drivers: mmc: host: use devm_ioremap_resource()

2013-05-16 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet 
---
 drivers/mmc/host/mvsdio.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 8960fc8..a66ee4b 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -758,9 +758,9 @@ static int __init mvsd_probe(struct platform_device *pdev)
 
spin_lock_init(>lock);
 
-   host->base = devm_request_and_ioremap(>dev, r);
-   if (!host->base) {
-   ret = -ENOMEM;
+   host->base = devm_ioremap_resource(>dev, r);
+   if (IS_ERR(host->base)) {
+   ret = PTR_ERR(host->base);
goto out;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] drivers: mmc: host: use devm_ioremap_resource()

2013-05-16 Thread Laurent Navet
This second version fix a typo in commit message reported by Jingoo Han

Regards,
Laurent.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] drivers: mmc: host: use devm_ioremap_resource()

2013-05-16 Thread Laurent Navet
This second version fix a typo in commit message reported by Jingoo Han

Regards,
Laurent.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] drivers: mmc: host: use devm_ioremap_resource()

2013-05-16 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/mmc/host/mvsdio.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 8960fc8..a66ee4b 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -758,9 +758,9 @@ static int __init mvsd_probe(struct platform_device *pdev)
 
spin_lock_init(host-lock);
 
-   host-base = devm_request_and_ioremap(pdev-dev, r);
-   if (!host-base) {
-   ret = -ENOMEM;
+   host-base = devm_ioremap_resource(pdev-dev, r);
+   if (IS_ERR(host-base)) {
+   ret = PTR_ERR(host-base);
goto out;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: video: mxsfb: clean use of devm_ioremap_resource()

2013-05-16 Thread Laurent Navet
2013/5/16, Jingoo Han jg1@samsung.com:
 It makes build warning as below:

 drivers/video/mxsfb.c:887:13: warning: 'host' is used uninitialized in this
 function [-Wuninitialized]
 drivers/video/mxsfb.c:965:21: warning: 'fb_info' may be used uninitialized
 in this function [-Wuninitialized]

 It breaks the assignment.
   host = to_imxfb_host(fb_info);

 Also, 'goto fb_release;' is not good.
 Please use ' return PTR_ERR(host-base);' as below:
 +   host-base = devm_ioremap_resource(pdev-dev, res);
 +   if (IS_ERR(host-base))
 +   return PTR_ERR(host-base);


 Best regards,
 Jingoo Han

Thank's for reviewing, I'll look at and resend.

Laurent,
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
> Oh is that deprecated? I had no clue :-/
> Can you point to some rationale about this so I'm not
> totally misguided in my world..?
>
Yes: https://lkml.org/lkml/2013/1/21/360

>
> Grant is just going to *not* love this type of patches replacing
> nullchecks with IS_ERR() stuff all over the kernel.

again, yes : https://lkml.org/lkml/2013/2/9/52

Laurent,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: gpio: gpio-msm-v1.c: use devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
Replace calls to deprecated devm_request_and_ioremap by devm_ioremap_resource.
Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet 
---
 drivers/gpio/gpio-msm-v1.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-msm-v1.c b/drivers/gpio/gpio-msm-v1.c
index c798585..c0ead43 100644
--- a/drivers/gpio/gpio-msm-v1.c
+++ b/drivers/gpio/gpio-msm-v1.c
@@ -652,14 +652,14 @@ static int __devinit gpio_msm_v1_probe(struct 
platform_device *pdev)
return irq2;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   base1 = devm_request_and_ioremap(>dev, res);
-   if (!base1)
-   return -EADDRNOTAVAIL;
+   base1 = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(base1))
+   return PTR_ERR(base1);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-   base2 = devm_request_and_ioremap(>dev, res);
-   if (!base2)
-   return -EADDRNOTAVAIL;
+   base2 = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(base2))
+   return PTR_ERR(base2);
 
for (i = FIRST_GPIO_IRQ; i < FIRST_GPIO_IRQ + NR_GPIO_IRQS; i++) {
if (i - FIRST_GPIO_IRQ >=
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: dma: sh: sudmac: use devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet 
---
 drivers/dma/sh/sudmac.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/sh/sudmac.c b/drivers/dma/sh/sudmac.c
index e7c94bb..0a81e30 100644
--- a/drivers/dma/sh/sudmac.c
+++ b/drivers/dma/sh/sudmac.c
@@ -360,9 +360,9 @@ static int sudmac_probe(struct platform_device *pdev)
 
dma_dev = _dev->shdma_dev.dma_dev;
 
-   su_dev->chan_reg = devm_request_and_ioremap(>dev, chan);
-   if (!su_dev->chan_reg)
-   return err;
+   su_dev->chan_reg = devm_ioremap_resource(>dev, chan);
+   if (IS_ERR(su_dev->chan_reg))
+   return PTR_ERR(su_dev->chan_reg);
 
dma_cap_set(DMA_SLAVE, dma_dev->cap_mask);
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers/spi/spi-tegra114.c clean use of devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
Check of 'r' and calls to dev_err are already done in devm_ioremap_resource,
so no need to do them twice.

Signed-off-by: Laurent Navet 
---
 drivers/spi/spi-tegra114.c |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index 598eb45..18a6592 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -1059,18 +1059,12 @@ static int tegra_spi_probe(struct platform_device *pdev)
spin_lock_init(>lock);
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!r) {
-   dev_err(>dev, "No IO memory resource\n");
-   ret = -ENODEV;
-   goto exit_free_master;
-   }
-   tspi->phys = r->start;
tspi->base = devm_ioremap_resource(>dev, r);
if (IS_ERR(tspi->base)) {
ret = PTR_ERR(tspi->base);
-   dev_err(>dev, "ioremap failed: err = %d\n", ret);
goto exit_free_master;
}
+   tspi->phys = r->start;
 
spi_irq = platform_get_irq(pdev, 0);
tspi->irq = spi_irq;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: video: mxsfb: clean use of devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
Check of 'res' and calls to dev_err are already done in devm_ioremap_resource,
so no need to do them twice.

Signed-off-by: Laurent Navet 
---
 drivers/video/mxsfb.c |   14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 21223d4..0f3d0fc 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -884,9 +884,10 @@ static int mxsfb_probe(struct platform_device *pdev)
pdev->id_entry = of_id->data;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(>dev, "Cannot get memory IO resource\n");
-   return -ENODEV;
+   host->base = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(host->base)) {
+   ret = PTR_ERR(host->base);
+   goto fb_release;
}
 
fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), >dev);
@@ -897,13 +898,6 @@ static int mxsfb_probe(struct platform_device *pdev)
 
host = to_imxfb_host(fb_info);
 
-   host->base = devm_ioremap_resource(>dev, res);
-   if (IS_ERR(host->base)) {
-   dev_err(>dev, "ioremap failed\n");
-   ret = PTR_ERR(host->base);
-   goto fb_release;
-   }
-
host->pdev = pdev;
platform_set_drvdata(pdev, host);
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net: ethernet: freescale: use devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
>> --- a/drivers/net/ethernet/freescale/fec_main.c
>> +++ b/drivers/net/ethernet/freescale/fec_main.c
>> @@ -1843,8 +1843,6 @@ fec_probe(struct platform_device *pdev)
>> pdev->id_entry = of_id->data;
>>
>> r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> -   if (!r)
>> -   return -ENXIO;
>>
>
> why remove this check?

it's already checked in devm_ioremap_resource in a better way,

void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res)
 {
...
 if (!res || resource_type(res) != IORESOURCE_MEM) {
 dev_err(dev, "invalid resource\n");
 return ERR_PTR(-EINVAL);
 }
...

Laurent.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net: ethernet: freescale: use devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
 --- a/drivers/net/ethernet/freescale/fec_main.c
 +++ b/drivers/net/ethernet/freescale/fec_main.c
 @@ -1843,8 +1843,6 @@ fec_probe(struct platform_device *pdev)
 pdev-id_entry = of_id-data;

 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 -   if (!r)
 -   return -ENXIO;


 why remove this check?

it's already checked in devm_ioremap_resource in a better way,

void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res)
 {
...
 if (!res || resource_type(res) != IORESOURCE_MEM) {
 dev_err(dev, invalid resource\n);
 return ERR_PTR(-EINVAL);
 }
...

Laurent.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: video: mxsfb: clean use of devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
Check of 'res' and calls to dev_err are already done in devm_ioremap_resource,
so no need to do them twice.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/video/mxsfb.c |   14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 21223d4..0f3d0fc 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -884,9 +884,10 @@ static int mxsfb_probe(struct platform_device *pdev)
pdev-id_entry = of_id-data;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(pdev-dev, Cannot get memory IO resource\n);
-   return -ENODEV;
+   host-base = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(host-base)) {
+   ret = PTR_ERR(host-base);
+   goto fb_release;
}
 
fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), pdev-dev);
@@ -897,13 +898,6 @@ static int mxsfb_probe(struct platform_device *pdev)
 
host = to_imxfb_host(fb_info);
 
-   host-base = devm_ioremap_resource(pdev-dev, res);
-   if (IS_ERR(host-base)) {
-   dev_err(pdev-dev, ioremap failed\n);
-   ret = PTR_ERR(host-base);
-   goto fb_release;
-   }
-
host-pdev = pdev;
platform_set_drvdata(pdev, host);
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers/spi/spi-tegra114.c clean use of devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
Check of 'r' and calls to dev_err are already done in devm_ioremap_resource,
so no need to do them twice.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/spi/spi-tegra114.c |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index 598eb45..18a6592 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -1059,18 +1059,12 @@ static int tegra_spi_probe(struct platform_device *pdev)
spin_lock_init(tspi-lock);
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!r) {
-   dev_err(pdev-dev, No IO memory resource\n);
-   ret = -ENODEV;
-   goto exit_free_master;
-   }
-   tspi-phys = r-start;
tspi-base = devm_ioremap_resource(pdev-dev, r);
if (IS_ERR(tspi-base)) {
ret = PTR_ERR(tspi-base);
-   dev_err(pdev-dev, ioremap failed: err = %d\n, ret);
goto exit_free_master;
}
+   tspi-phys = r-start;
 
spi_irq = platform_get_irq(pdev, 0);
tspi-irq = spi_irq;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: dma: sh: sudmac: use devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/dma/sh/sudmac.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/sh/sudmac.c b/drivers/dma/sh/sudmac.c
index e7c94bb..0a81e30 100644
--- a/drivers/dma/sh/sudmac.c
+++ b/drivers/dma/sh/sudmac.c
@@ -360,9 +360,9 @@ static int sudmac_probe(struct platform_device *pdev)
 
dma_dev = su_dev-shdma_dev.dma_dev;
 
-   su_dev-chan_reg = devm_request_and_ioremap(pdev-dev, chan);
-   if (!su_dev-chan_reg)
-   return err;
+   su_dev-chan_reg = devm_ioremap_resource(pdev-dev, chan);
+   if (IS_ERR(su_dev-chan_reg))
+   return PTR_ERR(su_dev-chan_reg);
 
dma_cap_set(DMA_SLAVE, dma_dev-cap_mask);
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: gpio: gpio-msm-v1.c: use devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
Replace calls to deprecated devm_request_and_ioremap by devm_ioremap_resource.
Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/gpio/gpio-msm-v1.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-msm-v1.c b/drivers/gpio/gpio-msm-v1.c
index c798585..c0ead43 100644
--- a/drivers/gpio/gpio-msm-v1.c
+++ b/drivers/gpio/gpio-msm-v1.c
@@ -652,14 +652,14 @@ static int __devinit gpio_msm_v1_probe(struct 
platform_device *pdev)
return irq2;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   base1 = devm_request_and_ioremap(pdev-dev, res);
-   if (!base1)
-   return -EADDRNOTAVAIL;
+   base1 = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(base1))
+   return PTR_ERR(base1);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-   base2 = devm_request_and_ioremap(pdev-dev, res);
-   if (!base2)
-   return -EADDRNOTAVAIL;
+   base2 = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(base2))
+   return PTR_ERR(base2);
 
for (i = FIRST_GPIO_IRQ; i  FIRST_GPIO_IRQ + NR_GPIO_IRQS; i++) {
if (i - FIRST_GPIO_IRQ =
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource()

2013-05-14 Thread Laurent Navet
 Oh is that deprecated? I had no clue :-/
 Can you point to some rationale about this so I'm not
 totally misguided in my world..?

Yes: https://lkml.org/lkml/2013/1/21/360


 Grant is just going to *not* love this type of patches replacing
 nullchecks with IS_ERR() stuff all over the kernel.

again, yes : https://lkml.org/lkml/2013/2/9/52

Laurent,
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] net: ethernet: freescale: use devm_ioremap_resource()

2013-05-13 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
also remove tests on 'r' since devm_ioremap_resource() checks for it
in a better way.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet 
---
 drivers/net/ethernet/freescale/fec_main.c |   13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c 
b/drivers/net/ethernet/freescale/fec_main.c
index aff0310..0afc7ff 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1843,8 +1843,6 @@ fec_probe(struct platform_device *pdev)
pdev->id_entry = of_id->data;
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!r)
-   return -ENXIO;
 
/* Init network device */
ndev = alloc_etherdev(sizeof(struct fec_enet_private));
@@ -1861,17 +1859,16 @@ fec_probe(struct platform_device *pdev)
(pdev->id_entry->driver_data & FEC_QUIRK_HAS_GBIT))
fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG;
 
-   fep->hwp = devm_request_and_ioremap(>dev, r);
+   fep->hwp = devm_ioremap_resource(>dev, r);
+   if (IS_ERR(fep->hwp)) {
+   ret = PTR_ERR(fep->hwp);
+   goto failed_ioremap;
+   }
fep->pdev = pdev;
fep->dev_id = dev_id++;
 
fep->bufdesc_ex = 0;
 
-   if (!fep->hwp) {
-   ret = -ENOMEM;
-   goto failed_ioremap;
-   }
-
platform_set_drvdata(pdev, ndev);
 
ret = of_get_phy_mode(pdev->dev.of_node);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: net: can: grcan: use devm_ioremap_resource()

2013-05-13 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
dev_err() message is no more needed since it's already displayed in
devm_ioremap_resource().

Signed-off-by: Laurent Navet 
---
 drivers/net/can/grcan.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
index 17fbc7a..9e9d0d6 100644
--- a/drivers/net/can/grcan.c
+++ b/drivers/net/can/grcan.c
@@ -1683,10 +1683,9 @@ static int grcan_probe(struct platform_device *ofdev)
}
 
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-   base = devm_request_and_ioremap(>dev, res);
-   if (!base) {
-   dev_err(>dev, "couldn't map IO resource\n");
-   err = -EADDRNOTAVAIL;
+   base = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(base)) {
+   err = PTR_ERR(base);
goto exit_error;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: net: ethernet: broadcom: bcm63xx: use devm_ioremap_resource()

2013-05-13 Thread Laurent Navet
Replace calls to deprecated devm_request_and_ioremap by devm_ioremap_resource.
also remove tests on 'res' since devm_ioremap_resource() checks for it
in a better form.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet 
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c |   16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c 
b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 0b3e23e..0497d0a 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1628,7 +1628,7 @@ static int bcm_enet_probe(struct platform_device *pdev)
res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
res_irq_tx = platform_get_resource(pdev, IORESOURCE_IRQ, 2);
-   if (!res_mem || !res_irq || !res_irq_rx || !res_irq_tx)
+   if (!res_irq || !res_irq_rx || !res_irq_tx)
return -ENODEV;
 
ret = 0;
@@ -1641,9 +1641,9 @@ static int bcm_enet_probe(struct platform_device *pdev)
if (ret)
goto out;
 
-   priv->base = devm_request_and_ioremap(>dev, res_mem);
-   if (priv->base == NULL) {
-   ret = -ENOMEM;
+   priv->base = devm_ioremap_resource(>dev, res_mem);
+   if (IS_ERR(priv->base)) {
+   ret = PTR_ERR(priv->base);
goto out;
}
 
@@ -1869,12 +1869,10 @@ static int bcm_enet_shared_probe(struct platform_device 
*pdev)
struct resource *res;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res)
-   return -ENODEV;
 
-   bcm_enet_shared_base = devm_request_and_ioremap(>dev, res);
-   if (!bcm_enet_shared_base)
-   return -ENOMEM;
+   bcm_enet_shared_base = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(bcm_enet_shared_base))
+   return PTR_ERR(bcm_enet_shared_base);
 
return 0;
 }
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] arch: sparc: kernel: use devm_ioremap_resource()

2013-05-13 Thread Laurent Navet
The same is done almost everywhere in kernel tree :

e.g :
http://lxr.free-electrons.com/source/drivers/staging/iio/adc/mxs-lradc.c#L928
http://lxr.free-electrons.com/source/drivers/gpio/gpio-mxs.c#L292
http://lxr.free-electrons.com/source/drivers/iommu/tegra-smmu.c#L1181
http://lxr.free-electrons.com/source/drivers/rtc/rtc-spear.c#L388
http://lxr.free-electrons.com/source/drivers/i2c/busses/i2c-imx.c#L514
http://lxr.free-electrons.com/source/sound/soc/kirkwood/kirkwood-i2s.c#L475

and so on...  all theses functions return an int.

Regards,
Laurent.

2013/5/12, Sam Ravnborg :
> On Sun, May 12, 2013 at 04:10:07PM +0200, Laurent Navet wrote:
>> Replace a call to deprecated devm_request_and_ioremap by
>> devm_ioremap_resource.
>>
>> Found with coccicheck and this semantic patch:
>>  scripts/coccinelle/api/devm_request_and_ioremap.cocci.
>>
>> Signed-off-by: Laurent Navet 
>> ---
>>  arch/sparc/kernel/leon_pci_grpci1.c |8 +++-
>>  1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/sparc/kernel/leon_pci_grpci1.c
>> b/arch/sparc/kernel/leon_pci_grpci1.c
>> index 7739a54..6df26e3 100644
>> --- a/arch/sparc/kernel/leon_pci_grpci1.c
>> +++ b/arch/sparc/kernel/leon_pci_grpci1.c
>> @@ -536,11 +536,9 @@ static int grpci1_of_probe(struct platform_device
>> *ofdev)
>>
>>  /* find device register base address */
>>  res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
>> -regs = devm_request_and_ioremap(>dev, res);
>> -if (!regs) {
>> -dev_err(>dev, "io-regs mapping failed\n");
>> -return -EADDRNOTAVAIL;
>> -}
>> +regs = devm_ioremap_resource(>dev, res);
>> +if (IS_ERR(regs))
>> +return PTR_ERR(regs);
>
> This looks bogus. The function return an int - not a pointer.
>
>   Sam
>


-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] arch: sparc: kernel: use devm_ioremap_resource()

2013-05-13 Thread Laurent Navet
The same is done almost everywhere in kernel tree :

e.g :
http://lxr.free-electrons.com/source/drivers/staging/iio/adc/mxs-lradc.c#L928
http://lxr.free-electrons.com/source/drivers/gpio/gpio-mxs.c#L292
http://lxr.free-electrons.com/source/drivers/iommu/tegra-smmu.c#L1181
http://lxr.free-electrons.com/source/drivers/rtc/rtc-spear.c#L388
http://lxr.free-electrons.com/source/drivers/i2c/busses/i2c-imx.c#L514
http://lxr.free-electrons.com/source/sound/soc/kirkwood/kirkwood-i2s.c#L475

and so on...  all theses functions return an int.

Regards,
Laurent.

2013/5/12, Sam Ravnborg s...@ravnborg.org:
 On Sun, May 12, 2013 at 04:10:07PM +0200, Laurent Navet wrote:
 Replace a call to deprecated devm_request_and_ioremap by
 devm_ioremap_resource.

 Found with coccicheck and this semantic patch:
  scripts/coccinelle/api/devm_request_and_ioremap.cocci.

 Signed-off-by: Laurent Navet laurent.na...@gmail.com
 ---
  arch/sparc/kernel/leon_pci_grpci1.c |8 +++-
  1 file changed, 3 insertions(+), 5 deletions(-)

 diff --git a/arch/sparc/kernel/leon_pci_grpci1.c
 b/arch/sparc/kernel/leon_pci_grpci1.c
 index 7739a54..6df26e3 100644
 --- a/arch/sparc/kernel/leon_pci_grpci1.c
 +++ b/arch/sparc/kernel/leon_pci_grpci1.c
 @@ -536,11 +536,9 @@ static int grpci1_of_probe(struct platform_device
 *ofdev)

  /* find device register base address */
  res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
 -regs = devm_request_and_ioremap(ofdev-dev, res);
 -if (!regs) {
 -dev_err(ofdev-dev, io-regs mapping failed\n);
 -return -EADDRNOTAVAIL;
 -}
 +regs = devm_ioremap_resource(ofdev-dev, res);
 +if (IS_ERR(regs))
 +return PTR_ERR(regs);

 This looks bogus. The function return an int - not a pointer.

   Sam



-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: net: ethernet: broadcom: bcm63xx: use devm_ioremap_resource()

2013-05-13 Thread Laurent Navet
Replace calls to deprecated devm_request_and_ioremap by devm_ioremap_resource.
also remove tests on 'res' since devm_ioremap_resource() checks for it
in a better form.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c |   16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c 
b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 0b3e23e..0497d0a 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1628,7 +1628,7 @@ static int bcm_enet_probe(struct platform_device *pdev)
res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
res_irq_tx = platform_get_resource(pdev, IORESOURCE_IRQ, 2);
-   if (!res_mem || !res_irq || !res_irq_rx || !res_irq_tx)
+   if (!res_irq || !res_irq_rx || !res_irq_tx)
return -ENODEV;
 
ret = 0;
@@ -1641,9 +1641,9 @@ static int bcm_enet_probe(struct platform_device *pdev)
if (ret)
goto out;
 
-   priv-base = devm_request_and_ioremap(pdev-dev, res_mem);
-   if (priv-base == NULL) {
-   ret = -ENOMEM;
+   priv-base = devm_ioremap_resource(pdev-dev, res_mem);
+   if (IS_ERR(priv-base)) {
+   ret = PTR_ERR(priv-base);
goto out;
}
 
@@ -1869,12 +1869,10 @@ static int bcm_enet_shared_probe(struct platform_device 
*pdev)
struct resource *res;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res)
-   return -ENODEV;
 
-   bcm_enet_shared_base = devm_request_and_ioremap(pdev-dev, res);
-   if (!bcm_enet_shared_base)
-   return -ENOMEM;
+   bcm_enet_shared_base = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(bcm_enet_shared_base))
+   return PTR_ERR(bcm_enet_shared_base);
 
return 0;
 }
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: net: can: grcan: use devm_ioremap_resource()

2013-05-13 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
dev_err() message is no more needed since it's already displayed in
devm_ioremap_resource().

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/net/can/grcan.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
index 17fbc7a..9e9d0d6 100644
--- a/drivers/net/can/grcan.c
+++ b/drivers/net/can/grcan.c
@@ -1683,10 +1683,9 @@ static int grcan_probe(struct platform_device *ofdev)
}
 
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-   base = devm_request_and_ioremap(ofdev-dev, res);
-   if (!base) {
-   dev_err(ofdev-dev, couldn't map IO resource\n);
-   err = -EADDRNOTAVAIL;
+   base = devm_ioremap_resource(ofdev-dev, res);
+   if (IS_ERR(base)) {
+   err = PTR_ERR(base);
goto exit_error;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] net: ethernet: freescale: use devm_ioremap_resource()

2013-05-13 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
also remove tests on 'r' since devm_ioremap_resource() checks for it
in a better way.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/net/ethernet/freescale/fec_main.c |   13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c 
b/drivers/net/ethernet/freescale/fec_main.c
index aff0310..0afc7ff 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1843,8 +1843,6 @@ fec_probe(struct platform_device *pdev)
pdev-id_entry = of_id-data;
 
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!r)
-   return -ENXIO;
 
/* Init network device */
ndev = alloc_etherdev(sizeof(struct fec_enet_private));
@@ -1861,17 +1859,16 @@ fec_probe(struct platform_device *pdev)
(pdev-id_entry-driver_data  FEC_QUIRK_HAS_GBIT))
fep-pause_flag |= FEC_PAUSE_FLAG_AUTONEG;
 
-   fep-hwp = devm_request_and_ioremap(pdev-dev, r);
+   fep-hwp = devm_ioremap_resource(pdev-dev, r);
+   if (IS_ERR(fep-hwp)) {
+   ret = PTR_ERR(fep-hwp);
+   goto failed_ioremap;
+   }
fep-pdev = pdev;
fep-dev_id = dev_id++;
 
fep-bufdesc_ex = 0;
 
-   if (!fep-hwp) {
-   ret = -ENOMEM;
-   goto failed_ioremap;
-   }
-
platform_set_drvdata(pdev, ndev);
 
ret = of_get_phy_mode(pdev-dev.of_node);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: net: ethernet: broadcom: bcm63xx: use devm_ioremap_resource()

2013-05-12 Thread Laurent Navet
Please, don't take this one

I'll send a more complete one later,
Sorry,

2013/5/12, Laurent Navet :
> Replace a call to deprecated devm_request_and_ioremap by
> devm_ioremap_resource.
>
> Found with coccicheck and this semantic patch:
>  scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> Signed-off-by: Laurent Navet 
> ---
>  drivers/net/ethernet/broadcom/bcm63xx_enet.c |6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> index 0b3e23e..9de4217 100644
> --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
> @@ -1641,9 +1641,9 @@ static int bcm_enet_probe(struct platform_device
> *pdev)
>   if (ret)
>   goto out;
>
> - priv->base = devm_request_and_ioremap(>dev, res_mem);
> - if (priv->base == NULL) {
> - ret = -ENOMEM;
> + priv->base = devm_ioremap_resource(>dev, res_mem);
> + if (IS_ERR(priv->base)) {
> + ret = PTR_ERR(priv->base);
>   goto out;
>   }
>
> --
> 1.7.10.4
>
>


-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: net: ethernet: broadcom: bcm63xx: use devm_ioremap_resource()

2013-05-12 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet 
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c 
b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 0b3e23e..9de4217 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1641,9 +1641,9 @@ static int bcm_enet_probe(struct platform_device *pdev)
if (ret)
goto out;
 
-   priv->base = devm_request_and_ioremap(>dev, res_mem);
-   if (priv->base == NULL) {
-   ret = -ENOMEM;
+   priv->base = devm_ioremap_resource(>dev, res_mem);
+   if (IS_ERR(priv->base)) {
+   ret = PTR_ERR(priv->base);
goto out;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource()

2013-05-12 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet 
---
 drivers/pinctrl/vt8500/pinctrl-wmt.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c 
b/drivers/pinctrl/vt8500/pinctrl-wmt.c
index ab63104..e877082 100644
--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
+++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
@@ -569,10 +569,10 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
struct resource *res;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   data->base = devm_request_and_ioremap(>dev, res);
-   if (!data->base) {
+   data->base = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(data->base)) {
dev_err(>dev, "failed to map memory resource\n");
-   return -EBUSY;
+   return PTR_ERR(data->base);
}
 
wmt_desc.pins = data->pins;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: mmc: host: use devm_ioremap_resource()

2013-05-12 Thread Laurent Navet
eplace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet 
---
 drivers/mmc/host/mvsdio.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 8960fc8..a66ee4b 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -758,9 +758,9 @@ static int __init mvsd_probe(struct platform_device *pdev)
 
spin_lock_init(>lock);
 
-   host->base = devm_request_and_ioremap(>dev, r);
-   if (!host->base) {
-   ret = -ENOMEM;
+   host->base = devm_ioremap_resource(>dev, r);
+   if (IS_ERR(host->base)) {
+   ret = PTR_ERR(host->base);
goto out;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] arch: sparc: kernel: use devm_ioremap_resource()

2013-05-12 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet 
---
 arch/sparc/kernel/leon_pci_grpci1.c |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/sparc/kernel/leon_pci_grpci1.c 
b/arch/sparc/kernel/leon_pci_grpci1.c
index 7739a54..6df26e3 100644
--- a/arch/sparc/kernel/leon_pci_grpci1.c
+++ b/arch/sparc/kernel/leon_pci_grpci1.c
@@ -536,11 +536,9 @@ static int grpci1_of_probe(struct platform_device *ofdev)
 
/* find device register base address */
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-   regs = devm_request_and_ioremap(>dev, res);
-   if (!regs) {
-   dev_err(>dev, "io-regs mapping failed\n");
-   return -EADDRNOTAVAIL;
-   }
+   regs = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(regs))
+   return PTR_ERR(regs);
 
/*
 * check that we're in Host Slot and that we can act as a Host Bridge
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] arch: sparc: kernel: use devm_ioremap_resource()

2013-05-12 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 arch/sparc/kernel/leon_pci_grpci1.c |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/sparc/kernel/leon_pci_grpci1.c 
b/arch/sparc/kernel/leon_pci_grpci1.c
index 7739a54..6df26e3 100644
--- a/arch/sparc/kernel/leon_pci_grpci1.c
+++ b/arch/sparc/kernel/leon_pci_grpci1.c
@@ -536,11 +536,9 @@ static int grpci1_of_probe(struct platform_device *ofdev)
 
/* find device register base address */
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-   regs = devm_request_and_ioremap(ofdev-dev, res);
-   if (!regs) {
-   dev_err(ofdev-dev, io-regs mapping failed\n);
-   return -EADDRNOTAVAIL;
-   }
+   regs = devm_ioremap_resource(ofdev-dev, res);
+   if (IS_ERR(regs))
+   return PTR_ERR(regs);
 
/*
 * check that we're in Host Slot and that we can act as a Host Bridge
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: mmc: host: use devm_ioremap_resource()

2013-05-12 Thread Laurent Navet
eplace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/mmc/host/mvsdio.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 8960fc8..a66ee4b 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -758,9 +758,9 @@ static int __init mvsd_probe(struct platform_device *pdev)
 
spin_lock_init(host-lock);
 
-   host-base = devm_request_and_ioremap(pdev-dev, r);
-   if (!host-base) {
-   ret = -ENOMEM;
+   host-base = devm_ioremap_resource(pdev-dev, r);
+   if (IS_ERR(host-base)) {
+   ret = PTR_ERR(host-base);
goto out;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource()

2013-05-12 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/pinctrl/vt8500/pinctrl-wmt.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c 
b/drivers/pinctrl/vt8500/pinctrl-wmt.c
index ab63104..e877082 100644
--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
+++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
@@ -569,10 +569,10 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
struct resource *res;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   data-base = devm_request_and_ioremap(pdev-dev, res);
-   if (!data-base) {
+   data-base = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(data-base)) {
dev_err(pdev-dev, failed to map memory resource\n);
-   return -EBUSY;
+   return PTR_ERR(data-base);
}
 
wmt_desc.pins = data-pins;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: net: ethernet: broadcom: bcm63xx: use devm_ioremap_resource()

2013-05-12 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c 
b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 0b3e23e..9de4217 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1641,9 +1641,9 @@ static int bcm_enet_probe(struct platform_device *pdev)
if (ret)
goto out;
 
-   priv-base = devm_request_and_ioremap(pdev-dev, res_mem);
-   if (priv-base == NULL) {
-   ret = -ENOMEM;
+   priv-base = devm_ioremap_resource(pdev-dev, res_mem);
+   if (IS_ERR(priv-base)) {
+   ret = PTR_ERR(priv-base);
goto out;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: net: ethernet: broadcom: bcm63xx: use devm_ioremap_resource()

2013-05-12 Thread Laurent Navet
Please, don't take this one

I'll send a more complete one later,
Sorry,

2013/5/12, Laurent Navet laurent.na...@gmail.com:
 Replace a call to deprecated devm_request_and_ioremap by
 devm_ioremap_resource.

 Found with coccicheck and this semantic patch:
  scripts/coccinelle/api/devm_ioremap_resource.cocci

 Signed-off-by: Laurent Navet laurent.na...@gmail.com
 ---
  drivers/net/ethernet/broadcom/bcm63xx_enet.c |6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

 diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
 b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
 index 0b3e23e..9de4217 100644
 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
 +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
 @@ -1641,9 +1641,9 @@ static int bcm_enet_probe(struct platform_device
 *pdev)
   if (ret)
   goto out;

 - priv-base = devm_request_and_ioremap(pdev-dev, res_mem);
 - if (priv-base == NULL) {
 - ret = -ENOMEM;
 + priv-base = devm_ioremap_resource(pdev-dev, res_mem);
 + if (IS_ERR(priv-base)) {
 + ret = PTR_ERR(priv-base);
   goto out;
   }

 --
 1.7.10.4




-- 
« On ne résout pas un problème avec les modes de pensée qui l’ont engendré. »
« You cannot solve current problems with current thinking. Current
problems are the result of current thinking »
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] iio: adc: exynos_adc: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace calls to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet 
---
 drivers/iio/adc/exynos_adc.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index 9f3a8ef..22d034a 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -270,16 +270,16 @@ static int exynos_adc_probe(struct platform_device *pdev)
info = iio_priv(indio_dev);
 
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   info->regs = devm_request_and_ioremap(>dev, mem);
-   if (!info->regs) {
-   ret = -ENOMEM;
+   info->regs = devm_ioremap_resource(>dev, mem);
+   if (IS_ERR(info->regs)) {
+   ret = PTR_ERR(info->regs);
goto err_iio;
}
 
mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-   info->enable_reg = devm_request_and_ioremap(>dev, mem);
-   if (!info->enable_reg) {
-   ret = -ENOMEM;
+   info->enable_reg = devm_ioremap_resource(>dev, mem);
+   if (IS_ERR(info->enable_reg)) {
+   ret = PTR_ERR(info->enable_reg);
goto err_iio;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: mtd: devices: elm: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet 
---
 drivers/mtd/devices/elm.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
index 2ec5da9..2bafb06 100644
--- a/drivers/mtd/devices/elm.c
+++ b/drivers/mtd/devices/elm.c
@@ -344,9 +344,9 @@ static int elm_probe(struct platform_device *pdev)
return -ENODEV;
}
 
-   info->elm_base = devm_request_and_ioremap(>dev, res);
-   if (!info->elm_base)
-   return -EADDRNOTAVAIL;
+   info->elm_base = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(info->elm_base))
+   return PTR_ERR(info->elm_base);
 
ret = devm_request_irq(>dev, irq->start, elm_isr, 0,
pdev->name, info);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] drivers: mtd: nand: davinci: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet 
---
 drivers/mtd/nand/davinci_nand.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 94e17af..941f69a 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -623,11 +623,14 @@ static int __init nand_davinci_probe(struct 
platform_device *pdev)
goto err_nomem;
}
 
-   vaddr = devm_request_and_ioremap(>dev, res1);
-   base = devm_request_and_ioremap(>dev, res2);
-   if (!vaddr || !base) {
-   dev_err(>dev, "ioremap failed\n");
-   ret = -EADDRNOTAVAIL;
+   vaddr = devm_ioremap_resource(>dev, res1);
+   if (IS_ERR(vaddr)) {
+   ret = PTR_ERR(vaddr);
+   goto err_ioremap;
+   }
+   base = devm_ioremap_resource(>dev, res2);
+   if (IS_ERR(base)) {
+   ret = PTR_ERR(base);
goto err_ioremap;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: mtd: nand: davinci: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet 
---
 drivers/mtd/nand/davinci_nand.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 94e17af..4a96e58 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -623,11 +623,14 @@ static int __init nand_davinci_probe(struct 
platform_device *pdev)
goto err_nomem;
}
 
-   vaddr = devm_request_and_ioremap(>dev, res1);
-   base = devm_request_and_ioremap(>dev, res2);
-   if (!vaddr || !base) {
-   dev_err(>dev, "ioremap failed\n");
-   ret = -EADDRNOTAVAIL;
+   vaddr = devm_ioremap_resource(>dev, res1);
+   base = devm_ioremap_resource(>dev, res2);
+   if (IS_ERR(vaddr)) {
+   ret = PTR_ERR(vaddr);
+   goto err_ioremap;
+   }
+   if (IS_ERR(base)) {
+   ret = PTR_ERR(base);
goto err_ioremap;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: misc: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet 
---
 drivers/misc/sram.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 437192e..4a93886 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -50,9 +50,10 @@ static int sram_probe(struct platform_device *pdev)
 
size = resource_size(res);
 
-   virt_base = devm_request_and_ioremap(>dev, res);
-   if (!virt_base)
-   return -EADDRNOTAVAIL;
+   virt_base = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(virt_base))
+   return PTR_ERR(virt_base);
+
 
sram = devm_kzalloc(>dev, sizeof(*sram), GFP_KERNEL);
if (!sram)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: spi: bmc2835: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet 
---
 drivers/spi/spi-bcm2835.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 89c0b50..a4185e4 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -331,10 +331,9 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
goto out_master_put;
}
 
-   bs->regs = devm_request_and_ioremap(>dev, res);
-   if (!bs->regs) {
-   dev_err(>dev, "could not request/map memory region\n");
-   err = -ENODEV;
+   bs->regs = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(bs->regs)) {
+   err = PTR_ERR(bs->regs);
goto out_master_put;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: crypto: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace calls to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet 
---
 drivers/crypto/omap-aes.c  |7 +++
 drivers/crypto/omap-sham.c |7 +++
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index 6aa425f..158215c 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -1125,10 +1125,9 @@ static int omap_aes_probe(struct platform_device *pdev)
if (err)
goto err_res;
 
-   dd->io_base = devm_request_and_ioremap(dev, );
-   if (!dd->io_base) {
-   dev_err(dev, "can't ioremap\n");
-   err = -ENOMEM;
+   dd->io_base = devm_ioremap_resource(dev, );
+   if (IS_ERR(dd->io_base)) {
+   err = PTR_ERR(dd->io_base);
goto err_res;
}
dd->phys_base = res.start;
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index 3d1611f..4d9cca6 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1686,10 +1686,9 @@ static int omap_sham_probe(struct platform_device *pdev)
if (err)
goto res_err;
 
-   dd->io_base = devm_request_and_ioremap(dev, );
-   if (!dd->io_base) {
-   dev_err(dev, "can't ioremap\n");
-   err = -ENOMEM;
+   dd->io_base = devm_ioremap_resource(dev, );
+   if (IS_ERR(dd->io_base)) {
+   err = PTR_ERR(dd->io_base);
goto res_err;
}
dd->phys_base = res.start;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: imx-drm: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet 
---
 drivers/staging/imx-drm/imx-tve.c |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-tve.c 
b/drivers/staging/imx-drm/imx-tve.c
index ac16344..a6efa8f6 100644
--- a/drivers/staging/imx-drm/imx-tve.c
+++ b/drivers/staging/imx-drm/imx-tve.c
@@ -638,11 +638,9 @@ static int imx_tve_probe(struct platform_device *pdev)
return -ENOENT;
}
 
-   base = devm_request_and_ioremap(>dev, res);
-   if (!base) {
-   dev_err(>dev, "failed to remap memory region\n");
-   return -ENOENT;
-   }
+   base = devm_ioremap_resource(>dev, res);
+   if (IS_ERR(base))
+   return PTR_ERR(base);
 
tve_regmap_config.lock_arg = tve;
tve->regmap = devm_regmap_init_mmio_clk(>dev, "tve", base,
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: dwc2: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet 
---
 drivers/staging/dwc2/pci.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/dwc2/pci.c b/drivers/staging/dwc2/pci.c
index 69c65eb..407e021 100644
--- a/drivers/staging/dwc2/pci.c
+++ b/drivers/staging/dwc2/pci.c
@@ -134,9 +134,9 @@ static int dwc2_driver_probe(struct pci_dev *dev,
pci_set_power_state(dev, PCI_D0);
 
hsotg->dev = >dev;
-   hsotg->regs = devm_request_and_ioremap(>dev, >resource[0]);
-   if (!hsotg->regs)
-   return -ENOMEM;
+   hsotg->regs = devm_ioremap_resource(>dev, >resource[0]);
+   if (IS_ERR(hsotg->regs))
+   return PTR_ERR(hsotg->regs);
 
dev_dbg(>dev, "mapped PA %08lx to VA %p\n",
(unsigned long)pci_resource_start(dev, 0), hsotg->regs);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: dwc2: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/staging/dwc2/pci.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/dwc2/pci.c b/drivers/staging/dwc2/pci.c
index 69c65eb..407e021 100644
--- a/drivers/staging/dwc2/pci.c
+++ b/drivers/staging/dwc2/pci.c
@@ -134,9 +134,9 @@ static int dwc2_driver_probe(struct pci_dev *dev,
pci_set_power_state(dev, PCI_D0);
 
hsotg-dev = dev-dev;
-   hsotg-regs = devm_request_and_ioremap(dev-dev, dev-resource[0]);
-   if (!hsotg-regs)
-   return -ENOMEM;
+   hsotg-regs = devm_ioremap_resource(dev-dev, dev-resource[0]);
+   if (IS_ERR(hsotg-regs))
+   return PTR_ERR(hsotg-regs);
 
dev_dbg(dev-dev, mapped PA %08lx to VA %p\n,
(unsigned long)pci_resource_start(dev, 0), hsotg-regs);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: imx-drm: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/staging/imx-drm/imx-tve.c |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-tve.c 
b/drivers/staging/imx-drm/imx-tve.c
index ac16344..a6efa8f6 100644
--- a/drivers/staging/imx-drm/imx-tve.c
+++ b/drivers/staging/imx-drm/imx-tve.c
@@ -638,11 +638,9 @@ static int imx_tve_probe(struct platform_device *pdev)
return -ENOENT;
}
 
-   base = devm_request_and_ioremap(pdev-dev, res);
-   if (!base) {
-   dev_err(pdev-dev, failed to remap memory region\n);
-   return -ENOENT;
-   }
+   base = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(base))
+   return PTR_ERR(base);
 
tve_regmap_config.lock_arg = tve;
tve-regmap = devm_regmap_init_mmio_clk(pdev-dev, tve, base,
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: crypto: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace calls to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/crypto/omap-aes.c  |7 +++
 drivers/crypto/omap-sham.c |7 +++
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index 6aa425f..158215c 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -1125,10 +1125,9 @@ static int omap_aes_probe(struct platform_device *pdev)
if (err)
goto err_res;
 
-   dd-io_base = devm_request_and_ioremap(dev, res);
-   if (!dd-io_base) {
-   dev_err(dev, can't ioremap\n);
-   err = -ENOMEM;
+   dd-io_base = devm_ioremap_resource(dev, res);
+   if (IS_ERR(dd-io_base)) {
+   err = PTR_ERR(dd-io_base);
goto err_res;
}
dd-phys_base = res.start;
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index 3d1611f..4d9cca6 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1686,10 +1686,9 @@ static int omap_sham_probe(struct platform_device *pdev)
if (err)
goto res_err;
 
-   dd-io_base = devm_request_and_ioremap(dev, res);
-   if (!dd-io_base) {
-   dev_err(dev, can't ioremap\n);
-   err = -ENOMEM;
+   dd-io_base = devm_ioremap_resource(dev, res);
+   if (IS_ERR(dd-io_base)) {
+   err = PTR_ERR(dd-io_base);
goto res_err;
}
dd-phys_base = res.start;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: spi: bmc2835: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/spi/spi-bcm2835.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 89c0b50..a4185e4 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -331,10 +331,9 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
goto out_master_put;
}
 
-   bs-regs = devm_request_and_ioremap(pdev-dev, res);
-   if (!bs-regs) {
-   dev_err(pdev-dev, could not request/map memory region\n);
-   err = -ENODEV;
+   bs-regs = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(bs-regs)) {
+   err = PTR_ERR(bs-regs);
goto out_master_put;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: misc: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/misc/sram.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 437192e..4a93886 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -50,9 +50,10 @@ static int sram_probe(struct platform_device *pdev)
 
size = resource_size(res);
 
-   virt_base = devm_request_and_ioremap(pdev-dev, res);
-   if (!virt_base)
-   return -EADDRNOTAVAIL;
+   virt_base = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(virt_base))
+   return PTR_ERR(virt_base);
+
 
sram = devm_kzalloc(pdev-dev, sizeof(*sram), GFP_KERNEL);
if (!sram)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: mtd: nand: davinci: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/mtd/nand/davinci_nand.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 94e17af..4a96e58 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -623,11 +623,14 @@ static int __init nand_davinci_probe(struct 
platform_device *pdev)
goto err_nomem;
}
 
-   vaddr = devm_request_and_ioremap(pdev-dev, res1);
-   base = devm_request_and_ioremap(pdev-dev, res2);
-   if (!vaddr || !base) {
-   dev_err(pdev-dev, ioremap failed\n);
-   ret = -EADDRNOTAVAIL;
+   vaddr = devm_ioremap_resource(pdev-dev, res1);
+   base = devm_ioremap_resource(pdev-dev, res2);
+   if (IS_ERR(vaddr)) {
+   ret = PTR_ERR(vaddr);
+   goto err_ioremap;
+   }
+   if (IS_ERR(base)) {
+   ret = PTR_ERR(base);
goto err_ioremap;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] drivers: mtd: nand: davinci: use devm_ioremap_resource()

2013-05-02 Thread Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet laurent.na...@gmail.com
---
 drivers/mtd/nand/davinci_nand.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 94e17af..941f69a 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -623,11 +623,14 @@ static int __init nand_davinci_probe(struct 
platform_device *pdev)
goto err_nomem;
}
 
-   vaddr = devm_request_and_ioremap(pdev-dev, res1);
-   base = devm_request_and_ioremap(pdev-dev, res2);
-   if (!vaddr || !base) {
-   dev_err(pdev-dev, ioremap failed\n);
-   ret = -EADDRNOTAVAIL;
+   vaddr = devm_ioremap_resource(pdev-dev, res1);
+   if (IS_ERR(vaddr)) {
+   ret = PTR_ERR(vaddr);
+   goto err_ioremap;
+   }
+   base = devm_ioremap_resource(pdev-dev, res2);
+   if (IS_ERR(base)) {
+   ret = PTR_ERR(base);
goto err_ioremap;
}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   >