[PATCH] staging: android: Fixed missing blank line

2014-07-17 Thread sanjeev sharma
From: root r...@inndt291.inn.mentorg.com

This patch will add an blank line after
declaration reported by checkpatch.pl script.

Signed-off-by: Sanjeev Sharma sanjeev_sha...@mentor.com
---
 drivers/staging/android/sw_sync.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/android/sw_sync.c 
b/drivers/staging/android/sw_sync.c
index a76db3f..863d4b1 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -97,6 +97,7 @@ static void sw_sync_pt_value_str(struct sync_pt *sync_pt,
   char *str, int size)
 {
struct sw_sync_pt *pt = (struct sw_sync_pt *)sync_pt;
+
snprintf(str, size, %d, pt-value);
 }
 
@@ -156,6 +157,7 @@ static int sw_sync_open(struct inode *inode, struct file 
*file)
 static int sw_sync_release(struct inode *inode, struct file *file)
 {
struct sw_sync_timeline *obj = file-private_data;
+
sync_timeline_destroy(obj-obj);
return 0;
 }
-- 
1.7.11.7

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: android: Fixed missing blank line

2014-07-17 Thread Dan Carpenter
On Thu, Jul 17, 2014 at 12:48:44PM +0530, sanjeev sharma wrote:
 From: root r...@inndt291.inn.mentorg.com

You shouldn't be doing this stuff as root...  Also fix your From header
so that your name is capitalized on your emails.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/8] Drivers: scsi: storvsc: Filter WRITE_SAME_16

2014-07-17 Thread h...@infradead.org
On Wed, Jul 16, 2014 at 03:20:00PM -0400, Martin K. Petersen wrote:
 The block layer can only describe one contiguous block range in a
 request. My copy offload patches introduces the bi_special field that
 allows us to attach additional information to an I/O. I have
 experimented with doing that for discards to overcome the suck of DSM
 TRIM. Splitting and merging requests in MD/DM gets much more cumbersome,
 though.

I had a bunch of prototypes for this years ago that didn't really work
out.  I always made ranged didscards something that driver had to opt
in for.  In my case md and dm never opted in, although for mirroring or
multipath it should of course handle it fairly easily.

 It also wasn't evident that it was worth the hassle. While UNMAP allows
 us to express large regions, DSM TRIM on the SATA side is limited to 32
 MB per range. So in many cases we end up maxing out the payload capacity
 even with a single contiguous range.

That's mostly because we don't support larger than 512 byte TRIM payloads
yet..
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Thierry Reding
On Thu, Jul 17, 2014 at 09:27:58AM +0800, Chen Gang wrote:
[...]
 diff --git a/include/linux/device.h b/include/linux/device.h
 index c2421e0..a7500c3 100644
 --- a/include/linux/device.h
 +++ b/include/linux/device.h
 @@ -630,7 +630,16 @@ extern unsigned long devm_get_free_pages(struct device 
 *dev,
gfp_t gfp_mask, unsigned int order);
  extern void devm_free_pages(struct device *dev, unsigned long addr);
  
 +#ifdef CONFIG_HAS_IOMEM
  void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
 *res);
 +#elif defined(CONFIG_COMPILE_TEST)
 +static inline void __iomem *devm_ioremap_resource(struct device *dev,
 + struct resource *res)
 +{
 + pr_warn(no hardware io memory, only for COMPILE_TEST\n);

Maybe: Hardware doesn't support memory-mapped I/O? I'm not sure if
it's useful to include the reference to COMPILE_TEST, especially since
the #elif will be dropped in favour of a simple #else.

 + return (__force void __iomem *)ERR_PTR(-ENXIO);

There's apparently an IOMEM_ERR_PTR() for this nowadays...

 +}
 +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */
  
  /* allows to add/remove a custom action to devres stack */
  int devm_add_action(struct device *dev, void (*action)(void *), void *data);
 diff --git a/include/linux/io.h b/include/linux/io.h
 index b76e6e5..59128aa 100644
 --- a/include/linux/io.h
 +++ b/include/linux/io.h
 @@ -58,14 +58,42 @@ static inline void devm_ioport_unmap(struct device *dev, 
 void __iomem *addr)
  }
  #endif
  
 +#ifdef CONFIG_HAS_IOMEM
 +
  void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
   unsigned long size);
  void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t 
 offset,
   unsigned long size);
  void devm_iounmap(struct device *dev, void __iomem *addr);
 +void devm_ioremap_release(struct device *dev, void *res);
 +
 +#elif defined(CONFIG_COMPILE_TEST)
 +
 +static inline void __iomem *devm_ioremap(struct device *dev,
 + resource_size_t offset, unsigned long size)

For consistency with other functions above, please keep arguments on
subsequent lines aligned with the first argument on the first line, like
so:

static inline void __iomem *devm_ioremap(struct device *dev,
 resource_size_t offset,
 unsigned long size)

 +{
 + pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 + return NULL;
 +}
 +static inline void __iomem *devm_ioremap_nocache(struct device *dev,
 + resource_size_t offset, unsigned long size)
 +{
 + pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 + return NULL;
 +}

Perhaps this should call devm_ioremap() so we don't have to repeat the
same error message? Or maybe make it:

#define devm_ioremap_nocache devm_ioremap

?

Thierry


pgpd5bRIZqIRk.pgp
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Chen Gang


On 07/17/2014 04:37 PM, Thierry Reding wrote:
 On Thu, Jul 17, 2014 at 09:27:58AM +0800, Chen Gang wrote:
 [...]
 diff --git a/include/linux/device.h b/include/linux/device.h
 index c2421e0..a7500c3 100644
 --- a/include/linux/device.h
 +++ b/include/linux/device.h
 @@ -630,7 +630,16 @@ extern unsigned long devm_get_free_pages(struct device 
 *dev,
   gfp_t gfp_mask, unsigned int order);
  extern void devm_free_pages(struct device *dev, unsigned long addr);
  
 +#ifdef CONFIG_HAS_IOMEM
  void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
 *res);
 +#elif defined(CONFIG_COMPILE_TEST)
 +static inline void __iomem *devm_ioremap_resource(struct device *dev,
 +struct resource *res)
 +{
 +pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 
 Maybe: Hardware doesn't support memory-mapped I/O? I'm not sure if
 it's useful to include the reference to COMPILE_TEST, especially since
 the #elif will be dropped in favour of a simple #else.
 

OK, thanks. I will use the comments which you provide.

And also use #else instead of #elif, use 'dev_warn' instead of 'pr_warn'
which Guenter suggests.

 +return (__force void __iomem *)ERR_PTR(-ENXIO);
 
 There's apparently an IOMEM_ERR_PTR() for this nowadays...
 

IOMEM_ERR_PTR() is defined within lib/devres.c, not in ./include.
But may we move it from lib/devres.c to ./include/linux/err.h?

For me, I am not quite sure, it may need additional discussion, but at
least, that will be another patch.

 +}
 +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */
  
  /* allows to add/remove a custom action to devres stack */
  int devm_add_action(struct device *dev, void (*action)(void *), void *data);
 diff --git a/include/linux/io.h b/include/linux/io.h
 index b76e6e5..59128aa 100644
 --- a/include/linux/io.h
 +++ b/include/linux/io.h
 @@ -58,14 +58,42 @@ static inline void devm_ioport_unmap(struct device *dev, 
 void __iomem *addr)
  }
  #endif
  
 +#ifdef CONFIG_HAS_IOMEM
 +
  void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
  unsigned long size);
  void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t 
 offset,
  unsigned long size);
  void devm_iounmap(struct device *dev, void __iomem *addr);
 +void devm_ioremap_release(struct device *dev, void *res);
 +
 +#elif defined(CONFIG_COMPILE_TEST)
 +
 +static inline void __iomem *devm_ioremap(struct device *dev,
 +resource_size_t offset, unsigned long size)
 
 For consistency with other functions above, please keep arguments on
 subsequent lines aligned with the first argument on the first line, like
 so:
 
 static inline void __iomem *devm_ioremap(struct device *dev,
resource_size_t offset,
unsigned long size)
 

That sounds fine to me, thanks.

 +{
 +pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 +return NULL;
 +}
 +static inline void __iomem *devm_ioremap_nocache(struct device *dev,
 +resource_size_t offset, unsigned long size)
 +{
 +pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 +return NULL;
 +}
 
 Perhaps this should call devm_ioremap() so we don't have to repeat the
 same error message? Or maybe make it:
 
   #define devm_ioremap_nocache devm_ioremap
 

That sounds fine to me, thanks.

Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: android: Fixed missing blank line

2014-07-17 Thread sanjeev sharma
From: sanjeevs1 sanjeev_sha...@mentor.com

This patch will add an blank line after
declaration reported by checkpatch.pl script.

Signed-off-by: Sanjeev Sharma sanjeev_sha...@mentor.com
---
Changes in v2:
  - Fixed frm header

 drivers/staging/android/sw_sync.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/android/sw_sync.c 
b/drivers/staging/android/sw_sync.c
index a76db3f..863d4b1 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -97,6 +97,7 @@ static void sw_sync_pt_value_str(struct sync_pt *sync_pt,
   char *str, int size)
 {
struct sw_sync_pt *pt = (struct sw_sync_pt *)sync_pt;
+
snprintf(str, size, %d, pt-value);
 }
 
@@ -156,6 +157,7 @@ static int sw_sync_open(struct inode *inode, struct file 
*file)
 static int sw_sync_release(struct inode *inode, struct file *file)
 {
struct sw_sync_timeline *obj = file-private_data;
+
sync_timeline_destroy(obj-obj);
return 0;
 }
-- 
1.7.11.7

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: android: Fixed missing blank line

2014-07-17 Thread Dan Carpenter
On Thu, Jul 17, 2014 at 02:43:27PM +0530, sanjeev sharma wrote:
 From: sanjeevs1 sanjeev_sha...@mentor.com

Only use this if you are sending on behalf of someone else.

 
 This patch will add an blank line after
 declaration reported by checkpatch.pl script.
 
 Signed-off-by: Sanjeev Sharma sanjeev_sha...@mentor.com
 ---
 Changes in v2:
   - Fixed frm header

Send these to yourself to test.

Also look at your email.
Bad  - From: sanjeev sharma sanjeev_sha...@mentor.com
Good - From: Sanjeev Sharma sanjeev_sha...@mentor.com

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Dan Carpenter
On Thu, Jul 17, 2014 at 04:59:09PM +0800, Chen Gang wrote:
  +  return (__force void __iomem *)ERR_PTR(-ENXIO);
  
  There's apparently an IOMEM_ERR_PTR() for this nowadays...
  
 
 IOMEM_ERR_PTR() is defined within lib/devres.c, not in ./include.
 But may we move it from lib/devres.c to ./include/linux/err.h?
 
 For me, I am not quite sure, it may need additional discussion, but at
 least, that will be another patch.

Yes.  Move it there.  That is the right place.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Chen Gang


On 07/17/2014 05:16 PM, Dan Carpenter wrote:
 On Thu, Jul 17, 2014 at 04:59:09PM +0800, Chen Gang wrote:
 +  return (__force void __iomem *)ERR_PTR(-ENXIO);

 There's apparently an IOMEM_ERR_PTR() for this nowadays...


 IOMEM_ERR_PTR() is defined within lib/devres.c, not in ./include.
 But may we move it from lib/devres.c to ./include/linux/err.h?

 For me, I am not quite sure, it may need additional discussion, but at
 least, that will be another patch.
 
 Yes.  Move it there.  That is the right place.
 

OK, thanks, if no another objections within 2 days, I shall send another
related patch for it.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Arnd Bergmann
On Thursday 17 July 2014 09:27:58 Chen Gang wrote:
  gfp_t gfp_mask, unsigned int order);
  extern void devm_free_pages(struct device *dev, unsigned long addr);
  
 +#ifdef CONFIG_HAS_IOMEM
  void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
 *res);
 +#elif defined(CONFIG_COMPILE_TEST)
 +static inline void __iomem *devm_ioremap_resource(struct device *dev,
 +   struct resource *res)
 +{
 +   pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 +   return (__force void __iomem *)ERR_PTR(-ENXIO);
 +}
 +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */
  
  /* allows to add/remove a custom action to devres stack */

To be honest, I think it's a bad idea to introduce wrappers functions
that are only available when CONFIG_COMPILE_TEST is set.

COMPILE_TEST is a great tool in general, but it has its limits.
In particular, the case for !CONFIG_IOMEM is completely obscure
and we won't find any bugs by allowing more drivers to be built
in those configurations, but attempting to do it would cause
endless churn by changing each instance of 'depends on HAS_IOMEM'
to 'depends on HAS_IOMEM || COMPILE_TEST'.

Note that s390 no has gained support for IOMEM, tile has it most
of the time (when PCI is enabled, so you get it in half the
test builds already), score should set HAS_IOMEM and doesn't
even have public compilers, and uml doesn't even compile in
latest mainline. Nothing else ever sets NO_IOMEM.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Richard Weinberger
Am 17.07.2014 11:20, schrieb Arnd Bergmann:
 On Thursday 17 July 2014 09:27:58 Chen Gang wrote:
  gfp_t gfp_mask, unsigned int order);
  extern void devm_free_pages(struct device *dev, unsigned long addr);
  
 +#ifdef CONFIG_HAS_IOMEM
  void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
 *res);
 +#elif defined(CONFIG_COMPILE_TEST)
 +static inline void __iomem *devm_ioremap_resource(struct device *dev,
 +   struct resource *res)
 +{
 +   pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 +   return (__force void __iomem *)ERR_PTR(-ENXIO);
 +}
 +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */
  
  /* allows to add/remove a custom action to devres stack */
 
 To be honest, I think it's a bad idea to introduce wrappers functions
 that are only available when CONFIG_COMPILE_TEST is set.
 
 COMPILE_TEST is a great tool in general, but it has its limits.
 In particular, the case for !CONFIG_IOMEM is completely obscure
 and we won't find any bugs by allowing more drivers to be built
 in those configurations, but attempting to do it would cause
 endless churn by changing each instance of 'depends on HAS_IOMEM'
 to 'depends on HAS_IOMEM || COMPILE_TEST'.
 
 Note that s390 no has gained support for IOMEM, tile has it most
 of the time (when PCI is enabled, so you get it in half the
 test builds already), score should set HAS_IOMEM and doesn't
 even have public compilers, and uml doesn't even compile in
 latest mainline. Nothing else ever sets NO_IOMEM.

Huh? UML (v3.16-rc5-143-gb6603fe) builds fine here. What build issue are you 
facing?

Thanks,
//richard
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Chen Gang


On 07/17/2014 05:20 PM, Arnd Bergmann wrote:
 On Thursday 17 July 2014 09:27:58 Chen Gang wrote:
  gfp_t gfp_mask, unsigned int order);
  extern void devm_free_pages(struct device *dev, unsigned long addr);
  
 +#ifdef CONFIG_HAS_IOMEM
  void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
 *res);
 +#elif defined(CONFIG_COMPILE_TEST)
 +static inline void __iomem *devm_ioremap_resource(struct device *dev,
 +   struct resource *res)
 +{
 +   pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 +   return (__force void __iomem *)ERR_PTR(-ENXIO);
 +}
 +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */
  
  /* allows to add/remove a custom action to devres stack */
 
 To be honest, I think it's a bad idea to introduce wrappers functions
 that are only available when CONFIG_COMPILE_TEST is set.
 
 COMPILE_TEST is a great tool in general, but it has its limits.
 In particular, the case for !CONFIG_IOMEM is completely obscure
 and we won't find any bugs by allowing more drivers to be built
 in those configurations, but attempting to do it would cause
 endless churn by changing each instance of 'depends on HAS_IOMEM'
 to 'depends on HAS_IOMEM || COMPILE_TEST'.


Architecture members and driver members really have different tastes,
they are different roles. It really need additional discussion.

For me, I only want to change devm_io*map*, not touch so much.

Welcome any other members' idea or suggestions.

 Note that s390 no has gained support for IOMEM, tile has it most
 of the time (when PCI is enabled, so you get it in half the
 test builds already), score should set HAS_IOMEM and doesn't
 even have public compilers, and uml doesn't even compile in
 latest mainline. Nothing else ever sets NO_IOMEM.
 

In latest gcc and binutils, can compile score cross compiler
successfully for building kernel (but I am not quite sure whether the
compiling result are really OK, but I guess so).

And next (maybe after finish allmodconfig for microblaze), I shall try
to let uml pass allmodconfig for linux-next tree.

Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Thierry Reding
On Thu, Jul 17, 2014 at 05:29:31PM +0800, Chen Gang wrote:
 
 
 On 07/17/2014 05:20 PM, Arnd Bergmann wrote:
  On Thursday 17 July 2014 09:27:58 Chen Gang wrote:
   gfp_t gfp_mask, unsigned int 
  order);
   extern void devm_free_pages(struct device *dev, unsigned long addr);
   
  +#ifdef CONFIG_HAS_IOMEM
   void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
  *res);
  +#elif defined(CONFIG_COMPILE_TEST)
  +static inline void __iomem *devm_ioremap_resource(struct device *dev,
  +   struct resource *res)
  +{
  +   pr_warn(no hardware io memory, only for COMPILE_TEST\n);
  +   return (__force void __iomem *)ERR_PTR(-ENXIO);
  +}
  +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */
   
   /* allows to add/remove a custom action to devres stack */
  
  To be honest, I think it's a bad idea to introduce wrappers functions
  that are only available when CONFIG_COMPILE_TEST is set.
  
  COMPILE_TEST is a great tool in general, but it has its limits.
  In particular, the case for !CONFIG_IOMEM is completely obscure
  and we won't find any bugs by allowing more drivers to be built
  in those configurations, but attempting to do it would cause
  endless churn by changing each instance of 'depends on HAS_IOMEM'
  to 'depends on HAS_IOMEM || COMPILE_TEST'.
 
 
 Architecture members and driver members really have different tastes,
 they are different roles. It really need additional discussion.
 
 For me, I only want to change devm_io*map*, not touch so much.
 
 Welcome any other members' idea or suggestions.
 
  Note that s390 no has gained support for IOMEM, tile has it most
  of the time (when PCI is enabled, so you get it in half the
  test builds already), score should set HAS_IOMEM and doesn't
  even have public compilers, and uml doesn't even compile in
  latest mainline. Nothing else ever sets NO_IOMEM.
  
 
 In latest gcc and binutils, can compile score cross compiler
 successfully for building kernel (but I am not quite sure whether the
 compiling result are really OK, but I guess so).

I was only able to ever build a partial bare-metal toolchain for score.
There's no uClibc, glibc or newlib support, so it becomes rather useless
as a Linux architecture.

Also when I run the cross-compiler on a score defconfig build, I get a
bunch of these:

score-unknown-elf-gcc-4.9.0: internal compiler error: Segmentation 
fault (program as)

Thierry


pgpwGF6puxSqC.pgp
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Thierry Reding
On Thu, Jul 17, 2014 at 11:20:36AM +0200, Arnd Bergmann wrote:
[...]
   score should set HAS_IOMEM and doesn't
 even have public compilers

This begs an interesting question. Should it be made a requirement to
have publicly available compilers for new architectures so that they can
at least be compile-tested? Preferably this would of course be in source
form so that there aren't any dependencies on the distribution.

Thierry


pgpL5cRJmfsX7.pgp
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Arnd Bergmann
On Thursday 17 July 2014 11:26:57 Richard Weinberger wrote:
 Am 17.07.2014 11:20, schrieb Arnd Bergmann:
  On Thursday 17 July 2014 09:27:58 Chen Gang wrote:
   gfp_t gfp_mask, unsigned int 
  order);
   extern void devm_free_pages(struct device *dev, unsigned long addr);
   
  +#ifdef CONFIG_HAS_IOMEM
   void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
  *res);
  +#elif defined(CONFIG_COMPILE_TEST)
  +static inline void __iomem *devm_ioremap_resource(struct device *dev,
  +   struct resource *res)
  +{
  +   pr_warn(no hardware io memory, only for COMPILE_TEST\n);
  +   return (__force void __iomem *)ERR_PTR(-ENXIO);
  +}
  +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */
   
   /* allows to add/remove a custom action to devres stack */
  
  To be honest, I think it's a bad idea to introduce wrappers functions
  that are only available when CONFIG_COMPILE_TEST is set.
  
  COMPILE_TEST is a great tool in general, but it has its limits.
  In particular, the case for !CONFIG_IOMEM is completely obscure
  and we won't find any bugs by allowing more drivers to be built
  in those configurations, but attempting to do it would cause
  endless churn by changing each instance of 'depends on HAS_IOMEM'
  to 'depends on HAS_IOMEM || COMPILE_TEST'.
  
  Note that s390 no has gained support for IOMEM, tile has it most
  of the time (when PCI is enabled, so you get it in half the
  test builds already), score should set HAS_IOMEM and doesn't
  even have public compilers, and uml doesn't even compile in
  latest mainline. Nothing else ever sets NO_IOMEM.
 
 Huh? UML (v3.16-rc5-143-gb6603fe) builds fine here. What build issue are you 
 facing?

This is what I got upon trying earlier. I have not attempted to look into
why this is happening. Note this is on linux-next from yesterday,
not mainline as I incorrectly stated above.

In file included from ../arch/um/include/asm/fixmap.h:58:0,
 from ../arch/um/include/asm/pgtable.h:11,
 from ../include/linux/mm.h:51,
 from ../kernel/uid16.c:6:
../include/asm-generic/fixmap.h: In function 'fix_to_virt':
../include/asm-generic/fixmap.h:31:2: error: size of unnamed array is negative
  BUILD_BUG_ON(idx = __end_of_fixed_addresses);


Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Arnd Bergmann
On Thursday 17 July 2014 11:56:58 Thierry Reding wrote:
 On Thu, Jul 17, 2014 at 11:20:36AM +0200, Arnd Bergmann wrote:
 [...]
score should set HAS_IOMEM and doesn't
  even have public compilers
 
 This begs an interesting question. Should it be made a requirement to
 have publicly available compilers for new architectures so that they can
 at least be compile-tested? Preferably this would of course be in source
 form so that there aren't any dependencies on the distribution.

The question has come up a few times. I wouldn't mandate that the port
has an upstream gcc (you've got to start mainlining one of them first
after all), but having compilers available for download should probably be
required. It's hard to ask for a particular quality of that gcc port
though, or to expect it to stay available online.

Where did you find the gcc port for score?

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Arnd Bergmann
On Thursday 17 July 2014 17:29:31 Chen Gang wrote:
  
  COMPILE_TEST is a great tool in general, but it has its limits.
  In particular, the case for !CONFIG_IOMEM is completely obscure
  and we won't find any bugs by allowing more drivers to be built
  in those configurations, but attempting to do it would cause
  endless churn by changing each instance of 'depends on HAS_IOMEM'
  to 'depends on HAS_IOMEM || COMPILE_TEST'.
 
 
 Architecture members and driver members really have different tastes,
 they are different roles. It really need additional discussion.
 
 For me, I only want to change devm_io*map*, not touch so much.

But what do you gain from that? All drivers that need these
functions should already 'depends on HAS_IOMEM' and if they don't,
we should fix /that/ instead. I don't see this dependency as any
different from a lot of others (PCI, DMAENGINE, HAVE_CLK, ...)
that we use to intentionally annotate drivers that need a particular
feature to be present for compilation. Do you want to do the
same hack to those?

 Welcome any other members' idea or suggestions.

  Note that s390 no has gained support for IOMEM, tile has it most
  of the time (when PCI is enabled, so you get it in half the
  test builds already), score should set HAS_IOMEM and doesn't
  even have public compilers, and uml doesn't even compile in
  latest mainline. Nothing else ever sets NO_IOMEM.
  
 
 In latest gcc and binutils, can compile score cross compiler
 successfully for building kernel (but I am not quite sure whether the
 compiling result are really OK, but I guess so).

Ok. Would you mind sending a patch that enables HAS_IOMEM on
score?
 
 And next (maybe after finish allmodconfig for microblaze), I shall try
 to let uml pass allmodconfig for linux-next tree.

That is a fair goal, but it seems better to do that by ensuring
we don't build any code that tries to call the MMIO functions
rather than trying to make them build.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Lars-Peter Clausen

On 07/17/2014 11:20 AM, Arnd Bergmann wrote:

On Thursday 17 July 2014 09:27:58 Chen Gang wrote:

  gfp_t gfp_mask, unsigned int order);
  extern void devm_free_pages(struct device *dev, unsigned long addr);

+#ifdef CONFIG_HAS_IOMEM
  void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
+#elif defined(CONFIG_COMPILE_TEST)
+static inline void __iomem *devm_ioremap_resource(struct device *dev,
+   struct resource *res)
+{
+   pr_warn(no hardware io memory, only for COMPILE_TEST\n);
+   return (__force void __iomem *)ERR_PTR(-ENXIO);
+}
+#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */

  /* allows to add/remove a custom action to devres stack */


To be honest, I think it's a bad idea to introduce wrappers functions
that are only available when CONFIG_COMPILE_TEST is set.

COMPILE_TEST is a great tool in general, but it has its limits.
In particular, the case for !CONFIG_IOMEM is completely obscure
and we won't find any bugs by allowing more drivers to be built
in those configurations, but attempting to do it would cause
endless churn by changing each instance of 'depends on HAS_IOMEM'
to 'depends on HAS_IOMEM || COMPILE_TEST'.


The point of this exercise is that we do not have to replace a good chunk of 
'depends on COMPILE_TEST' with 'depends on COMPILE_TEST  HAS_IOMEM'


E.g. the typical Kconfig entry for your random SoC peripheral driver looks like

config ARCH_FOOBAR_DRIVER
depends on ARCH_FOOBAR || COMPILE_TEST
...

Now when COMPILE_TEST is not set there is a implicit dependency on HAS_IOMEM 
since the architecture will provide it. If COMPILE_TEST is selected the 
driver will also be build-able on architectures that do no have HAS_IOMEM 
and hence linking the driver fails. One way to fix this is of course to 
replace the COMPILE_TEST with (COMPILE_TEST  HAS_IOMEM). But this is very 
often overlooked and only noticed later on when somebody actually builds a 
allyesconfig on an architecture that does not provide HAS_IOMEM. To avoid 
these kinds of build errors and tedious fixup patches the idea is to provide 
a stub function when HAS_IOMEM is not enabled, but COMPILE_TEST is enabled.


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Arnd Bergmann
On Thursday 17 July 2014 12:40:25 Lars-Peter Clausen wrote:
 On 07/17/2014 11:20 AM, Arnd Bergmann wrote:
  On Thursday 17 July 2014 09:27:58 Chen Gang wrote:
gfp_t gfp_mask, unsigned int 
  order);
extern void devm_free_pages(struct device *dev, unsigned long addr);
 
  +#ifdef CONFIG_HAS_IOMEM
void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
  *res);
  +#elif defined(CONFIG_COMPILE_TEST)
  +static inline void __iomem *devm_ioremap_resource(struct device *dev,
  +   struct resource *res)
  +{
  +   pr_warn(no hardware io memory, only for COMPILE_TEST\n);
  +   return (__force void __iomem *)ERR_PTR(-ENXIO);
  +}
  +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */
 
/* allows to add/remove a custom action to devres stack */
 
  To be honest, I think it's a bad idea to introduce wrappers functions
  that are only available when CONFIG_COMPILE_TEST is set.
 
  COMPILE_TEST is a great tool in general, but it has its limits.
  In particular, the case for !CONFIG_IOMEM is completely obscure
  and we won't find any bugs by allowing more drivers to be built
  in those configurations, but attempting to do it would cause
  endless churn by changing each instance of 'depends on HAS_IOMEM'
  to 'depends on HAS_IOMEM || COMPILE_TEST'.
 
 The point of this exercise is that we do not have to replace a good chunk of 
 'depends on COMPILE_TEST' with 'depends on COMPILE_TEST  HAS_IOMEM'

Ok, I see.

 E.g. the typical Kconfig entry for your random SoC peripheral driver looks 
 like
 
 config ARCH_FOOBAR_DRIVER
 depends on ARCH_FOOBAR || COMPILE_TEST
 ...
 
 Now when COMPILE_TEST is not set there is a implicit dependency on HAS_IOMEM 
 since the architecture will provide it. If COMPILE_TEST is selected the 
 driver will also be build-able on architectures that do no have HAS_IOMEM 
 and hence linking the driver fails. One way to fix this is of course to 
 replace the COMPILE_TEST with (COMPILE_TEST  HAS_IOMEM). But this is very 
 often overlooked and only noticed later on when somebody actually builds a 
 allyesconfig on an architecture that does not provide HAS_IOMEM. To avoid 
 these kinds of build errors and tedious fixup patches the idea is to provide 
 a stub function when HAS_IOMEM is not enabled, but COMPILE_TEST is enabled.

AFAICT, NO_IOMEM only has a real purpose on UML these days. Could we take
a shortcut here and make COMPILE_TEST depend on !UML? Getting random stuff
to build on UML seems pointless to me and we special-case it in a number of
places already.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Thierry Reding
On Thu, Jul 17, 2014 at 12:33:32PM +0200, Arnd Bergmann wrote:
 On Thursday 17 July 2014 11:56:58 Thierry Reding wrote:
  On Thu, Jul 17, 2014 at 11:20:36AM +0200, Arnd Bergmann wrote:
  [...]
 score should set HAS_IOMEM and doesn't
   even have public compilers
  
  This begs an interesting question. Should it be made a requirement to
  have publicly available compilers for new architectures so that they can
  at least be compile-tested? Preferably this would of course be in source
  form so that there aren't any dependencies on the distribution.
 
 The question has come up a few times. I wouldn't mandate that the port
 has an upstream gcc (you've got to start mainlining one of them first
 after all), but having compilers available for download should probably be
 required. It's hard to ask for a particular quality of that gcc port
 though, or to expect it to stay available online.
 
 Where did you find the gcc port for score?

It's upstream, though marked obsolete and to be removed in the next
release... =)

Thierry


pgp2_qLMI3Awb.pgp
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Richard Weinberger
Am 17.07.2014 12:28, schrieb Arnd Bergmann:
 On Thursday 17 July 2014 11:26:57 Richard Weinberger wrote:
 Am 17.07.2014 11:20, schrieb Arnd Bergmann:
 On Thursday 17 July 2014 09:27:58 Chen Gang wrote:
  gfp_t gfp_mask, unsigned int 
 order);
  extern void devm_free_pages(struct device *dev, unsigned long addr);
  
 +#ifdef CONFIG_HAS_IOMEM
  void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
 *res);
 +#elif defined(CONFIG_COMPILE_TEST)
 +static inline void __iomem *devm_ioremap_resource(struct device *dev,
 +   struct resource *res)
 +{
 +   pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 +   return (__force void __iomem *)ERR_PTR(-ENXIO);
 +}
 +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */
  
  /* allows to add/remove a custom action to devres stack */

 To be honest, I think it's a bad idea to introduce wrappers functions
 that are only available when CONFIG_COMPILE_TEST is set.

 COMPILE_TEST is a great tool in general, but it has its limits.
 In particular, the case for !CONFIG_IOMEM is completely obscure
 and we won't find any bugs by allowing more drivers to be built
 in those configurations, but attempting to do it would cause
 endless churn by changing each instance of 'depends on HAS_IOMEM'
 to 'depends on HAS_IOMEM || COMPILE_TEST'.

 Note that s390 no has gained support for IOMEM, tile has it most
 of the time (when PCI is enabled, so you get it in half the
 test builds already), score should set HAS_IOMEM and doesn't
 even have public compilers, and uml doesn't even compile in
 latest mainline. Nothing else ever sets NO_IOMEM.

 Huh? UML (v3.16-rc5-143-gb6603fe) builds fine here. What build issue are you 
 facing?
 
 This is what I got upon trying earlier. I have not attempted to look into
 why this is happening. Note this is on linux-next from yesterday,
 not mainline as I incorrectly stated above.
 
 In file included from ../arch/um/include/asm/fixmap.h:58:0,
  from ../arch/um/include/asm/pgtable.h:11,
  from ../include/linux/mm.h:51,
  from ../kernel/uid16.c:6:
 ../include/asm-generic/fixmap.h: In function 'fix_to_virt':
 ../include/asm-generic/fixmap.h:31:2: error: size of unnamed array is negative
   BUILD_BUG_ON(idx = __end_of_fixed_addresses);

So, this is next-20140716?
I don't see the fixmap issue you're reporting, also not on the most recent next.

All I see is the known ext4 issue with CONFIG_SMP=n:

fs/ext4/super.c: In function ‘ext4_commit_super’:
fs/ext4/super.c:4547:41: error: ‘struct percpu_counter’ has no member named 
‘counters’
  if (EXT4_SB(sb)-s_freeclusters_counter.counters)
 ^
fs/ext4/super.c:4551:39: error: ‘struct percpu_counter’ has no member named 
‘counters’
  if (EXT4_SB(sb)-s_freeinodes_counter.counters)

Thanks,
//richard
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Chen Gang


On 07/17/2014 06:55 PM, Thierry Reding wrote:
 On Thu, Jul 17, 2014 at 12:33:32PM +0200, Arnd Bergmann wrote:
 On Thursday 17 July 2014 11:56:58 Thierry Reding wrote:
 On Thu, Jul 17, 2014 at 11:20:36AM +0200, Arnd Bergmann wrote:
 [...]
   score should set HAS_IOMEM and doesn't
 even have public compilers

 This begs an interesting question. Should it be made a requirement to
 have publicly available compilers for new architectures so that they can
 at least be compile-tested? Preferably this would of course be in source
 form so that there aren't any dependencies on the distribution.

 The question has come up a few times. I wouldn't mandate that the port
 has an upstream gcc (you've got to start mainlining one of them first
 after all), but having compilers available for download should probably be
 required. It's hard to ask for a particular quality of that gcc port
 though, or to expect it to stay available online.

 Where did you find the gcc port for score?
 
 It's upstream, though marked obsolete and to be removed in the next
 release... =)
 

For me, I get the latest gcc version and binutils source code, and fix 2
bugs (one for gas, which always generate core dump, the other for gcc
c-decl, fix it together with the other gcc members).

And I only finish compiling raw cross-compiler (--without-headers),
after make some patches, can let score pass allmodconfig.

At present, it seems the score cross-compiler still contents some issue
which I shall try to analyse (it is about link symbols), and maybe need
communicate with gcc/binutils members.


At present, the related score maintainers are still active in upstream
kernel, so we also need the related maintainers' ideas and suggestions.


Thanks
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Arnd Bergmann
On Thursday 17 July 2014 12:58:55 Richard Weinberger wrote:
  This is what I got upon trying earlier. I have not attempted to look into
  why this is happening. Note this is on linux-next from yesterday,
  not mainline as I incorrectly stated above.
  
  In file included from ../arch/um/include/asm/fixmap.h:58:0,
   from ../arch/um/include/asm/pgtable.h:11,
   from ../include/linux/mm.h:51,
   from ../kernel/uid16.c:6:
  ../include/asm-generic/fixmap.h: In function 'fix_to_virt':
  ../include/asm-generic/fixmap.h:31:2: error: size of unnamed array is 
  negative
BUILD_BUG_ON(idx = __end_of_fixed_addresses);
 
 So, this is next-20140716?
 I don't see the fixmap issue you're reporting, also not on the most recent 
 next.

Sorry, nevermind. I had a workaround for a gcc-4.9 bug applied that
turned off optimization for uid16.c, which fixed the build for ARM for
me but happened to break x86 including uml.

Without that patch, I don't see this problem.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Chen Gang
On 07/17/2014 06:48 PM, Arnd Bergmann wrote:
 On Thursday 17 July 2014 12:40:25 Lars-Peter Clausen wrote:
 On 07/17/2014 11:20 AM, Arnd Bergmann wrote:
 On Thursday 17 July 2014 09:27:58 Chen Gang wrote:
   gfp_t gfp_mask, unsigned int 
 order);
   extern void devm_free_pages(struct device *dev, unsigned long addr);

 +#ifdef CONFIG_HAS_IOMEM
   void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
 *res);
 +#elif defined(CONFIG_COMPILE_TEST)
 +static inline void __iomem *devm_ioremap_resource(struct device *dev,
 +   struct resource *res)
 +{
 +   pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 +   return (__force void __iomem *)ERR_PTR(-ENXIO);
 +}
 +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */

   /* allows to add/remove a custom action to devres stack */

 To be honest, I think it's a bad idea to introduce wrappers functions
 that are only available when CONFIG_COMPILE_TEST is set.

 COMPILE_TEST is a great tool in general, but it has its limits.
 In particular, the case for !CONFIG_IOMEM is completely obscure
 and we won't find any bugs by allowing more drivers to be built
 in those configurations, but attempting to do it would cause
 endless churn by changing each instance of 'depends on HAS_IOMEM'
 to 'depends on HAS_IOMEM || COMPILE_TEST'.

 The point of this exercise is that we do not have to replace a good chunk of 
 'depends on COMPILE_TEST' with 'depends on COMPILE_TEST  HAS_IOMEM'
 
 Ok, I see.
 
 E.g. the typical Kconfig entry for your random SoC peripheral driver looks 
 like

 config ARCH_FOOBAR_DRIVER
 depends on ARCH_FOOBAR || COMPILE_TEST
 ...

 Now when COMPILE_TEST is not set there is a implicit dependency on HAS_IOMEM 
 since the architecture will provide it. If COMPILE_TEST is selected the 
 driver will also be build-able on architectures that do no have HAS_IOMEM 
 and hence linking the driver fails. One way to fix this is of course to 
 replace the COMPILE_TEST with (COMPILE_TEST  HAS_IOMEM). But this is very 
 often overlooked and only noticed later on when somebody actually builds a 
 allyesconfig on an architecture that does not provide HAS_IOMEM. To avoid 
 these kinds of build errors and tedious fixup patches the idea is to provide 
 a stub function when HAS_IOMEM is not enabled, but COMPILE_TEST is enabled.
 
 AFAICT, NO_IOMEM only has a real purpose on UML these days. Could we take
 a shortcut here and make COMPILE_TEST depend on !UML? Getting random stuff
 to build on UML seems pointless to me and we special-case it in a number of
 places already.
 

According to current source code, tile still has chance to choose
NO_IOMEM, for me, welcome the tile's maintainer's ideas or suggestions.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Chen Gang


On 07/17/2014 06:58 PM, Richard Weinberger wrote:
 Am 17.07.2014 12:28, schrieb Arnd Bergmann:
 On Thursday 17 July 2014 11:26:57 Richard Weinberger wrote:
 Am 17.07.2014 11:20, schrieb Arnd Bergmann:
 On Thursday 17 July 2014 09:27:58 Chen Gang wrote:
  gfp_t gfp_mask, unsigned int 
 order);
  extern void devm_free_pages(struct device *dev, unsigned long addr);
  
 +#ifdef CONFIG_HAS_IOMEM
  void __iomem *devm_ioremap_resource(struct device *dev, struct resource 
 *res);
 +#elif defined(CONFIG_COMPILE_TEST)
 +static inline void __iomem *devm_ioremap_resource(struct device *dev,
 +   struct resource *res)
 +{
 +   pr_warn(no hardware io memory, only for COMPILE_TEST\n);
 +   return (__force void __iomem *)ERR_PTR(-ENXIO);
 +}
 +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */
  
  /* allows to add/remove a custom action to devres stack */

 To be honest, I think it's a bad idea to introduce wrappers functions
 that are only available when CONFIG_COMPILE_TEST is set.

 COMPILE_TEST is a great tool in general, but it has its limits.
 In particular, the case for !CONFIG_IOMEM is completely obscure
 and we won't find any bugs by allowing more drivers to be built
 in those configurations, but attempting to do it would cause
 endless churn by changing each instance of 'depends on HAS_IOMEM'
 to 'depends on HAS_IOMEM || COMPILE_TEST'.

 Note that s390 no has gained support for IOMEM, tile has it most
 of the time (when PCI is enabled, so you get it in half the
 test builds already), score should set HAS_IOMEM and doesn't
 even have public compilers, and uml doesn't even compile in
 latest mainline. Nothing else ever sets NO_IOMEM.

 Huh? UML (v3.16-rc5-143-gb6603fe) builds fine here. What build issue are 
 you facing?

 This is what I got upon trying earlier. I have not attempted to look into
 why this is happening. Note this is on linux-next from yesterday,
 not mainline as I incorrectly stated above.

 In file included from ../arch/um/include/asm/fixmap.h:58:0,
  from ../arch/um/include/asm/pgtable.h:11,
  from ../include/linux/mm.h:51,
  from ../kernel/uid16.c:6:
 ../include/asm-generic/fixmap.h: In function 'fix_to_virt':
 ../include/asm-generic/fixmap.h:31:2: error: size of unnamed array is 
 negative
   BUILD_BUG_ON(idx = __end_of_fixed_addresses);
 
 So, this is next-20140716?
 I don't see the fixmap issue you're reporting, also not on the most recent 
 next.
 
 All I see is the known ext4 issue with CONFIG_SMP=n:
 
 fs/ext4/super.c: In function ‘ext4_commit_super’:
 fs/ext4/super.c:4547:41: error: ‘struct percpu_counter’ has no member named 
 ‘counters’
   if (EXT4_SB(sb)-s_freeclusters_counter.counters)
  ^
 fs/ext4/super.c:4551:39: error: ‘struct percpu_counter’ has no member named 
 ‘counters’
   if (EXT4_SB(sb)-s_freeinodes_counter.counters)
 

Yeah, and I have notified to ext4 related maintainer, yesterday, and he
has already send fix patch for it, I guess it will be integrated into
main line soon.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Chen Gang


On 07/17/2014 06:38 PM, Arnd Bergmann wrote:
 On Thursday 17 July 2014 17:29:31 Chen Gang wrote:

 COMPILE_TEST is a great tool in general, but it has its limits.
 In particular, the case for !CONFIG_IOMEM is completely obscure
 and we won't find any bugs by allowing more drivers to be built
 in those configurations, but attempting to do it would cause
 endless churn by changing each instance of 'depends on HAS_IOMEM'
 to 'depends on HAS_IOMEM || COMPILE_TEST'.


 Architecture members and driver members really have different tastes,
 they are different roles. It really need additional discussion.

 For me, I only want to change devm_io*map*, not touch so much.
 
 But what do you gain from that? All drivers that need these
 functions should already 'depends on HAS_IOMEM' and if they don't,
 we should fix /that/ instead. I don't see this dependency as any
 different from a lot of others (PCI, DMAENGINE, HAVE_CLK, ...)
 that we use to intentionally annotate drivers that need a particular
 feature to be present for compilation. Do you want to do the
 same hack to those?
 
 Welcome any other members' idea or suggestions.
 
 Note that s390 no has gained support for IOMEM, tile has it most
 of the time (when PCI is enabled, so you get it in half the
 test builds already), score should set HAS_IOMEM and doesn't
 even have public compilers, and uml doesn't even compile in
 latest mainline. Nothing else ever sets NO_IOMEM.



I guess, we are just discussing about them in another threads, so I skip
them. If it is still necessary to reply (e.g. I misunderstand), please
let me know, thanks.

 In latest gcc and binutils, can compile score cross compiler
 successfully for building kernel (but I am not quite sure whether the
 compiling result are really OK, but I guess so).
 
 Ok. Would you mind sending a patch that enables HAS_IOMEM on
 score?
  

For me, welcome the score related maintainers' idea and suggestions.

 And next (maybe after finish allmodconfig for microblaze), I shall try
 to let uml pass allmodconfig for linux-next tree.
 
 That is a fair goal, but it seems better to do that by ensuring
 we don't build any code that tries to call the MMIO functions
 rather than trying to make them build.
 

When I am performing uml, I will try and also communicate with the
related maintainers for it (their suggestions and ideas are valuable).

Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 00/28] staging: comedi: ni_mio_common: more cleanup

2014-07-17 Thread Ian Abbott

On 2014-07-16 17:36, Hartley Sweeten wrote:

On Wednesday, July 16, 2014 3:54 AM, Ian Abbott wrote:

On 2014-07-14 20:23, H Hartley Sweeten wrote:

The ni_mio_common.c file is included by a number of National Instruments
drivers to provide the common driver support. This series does some
more cleanup to get the file closer to being changed into a module instead
of including it in the drivers.


Jolly good!

One thing you missed is simplifying ni_ao_config_chanlist(),
ni_old_ao_config_chanlist() and ni_m_series_ao_config_chanlist() a
little more by changing them to return 'void' and removing the 'invert'
variable from ni_old_ao_config_chanlist().


The ni_mio_common stuff still needs additional cleanup. I'll get
around to tidying up the config_chanlist stuff eventually. ;-)


Okay.  I just thought I'd mention it because your patches were changing 
those functions anyway!


--
-=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 6/8 V2] staging: dgap: remove unneeded dgap_err()

2014-07-17 Thread Mark Hounschell

On 07/16/2014 08:42 PM, DaeSeok Youn wrote:

2014-07-16 23:17 GMT+09:00 Mark Hounschell ma...@compro.net:

On 07/16/2014 05:26 AM, DaeSeok Youn wrote:


2014-07-16 8:50 GMT+09:00 Greg KH gre...@linuxfoundation.org:


On Wed, Jul 16, 2014 at 08:21:30AM +0900, DaeSeok Youn wrote:


Hi,

2014-07-16 0:29 GMT+09:00 Greg KH gre...@linuxfoundation.org:


On Tue, Jul 15, 2014 at 06:11:44PM +0900, Daeseok Youn wrote:


The dgap_err() is printing a message with pr_err(),
so all those are replaced.

Use definition pr_fmt and then all of dgap: in
the beginning of print messages are removed.

And also removed out of memory message because
the kernel has own message for that.

Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
---
V2: use pr_fmt dgap: prefix on print message on dgap.
  remove out of memory message.

  Adds Mark to TO list and CC list for checking send
  this email properly to him.

   drivers/staging/dgap/dgap.c |  306
+++
   1 files changed, 133 insertions(+), 173 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 06c55cb..9e750fb 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -41,6 +41,8 @@
*/
   #undef DIGI_CONCENTRATORS_SUPPORTED

+#define pr_fmt(fmt) dgap:  fmt
+
   #include linux/kernel.h
   #include linux/module.h
   #include linux/pci.h
@@ -153,7 +155,6 @@ static void dgap_firmware_reset_port(struct
channel_t *ch);
   static int dgap_gettok(char **in);
   static char *dgap_getword(char **in);
   static int dgap_checknode(struct cnode *p);
-static void dgap_err(char *s);

   /*
* Function prototypes from dgap_sysfs.h
@@ -815,7 +816,7 @@ static struct board_t *dgap_found_board(struct
pci_dev *pdev, int id,
if (ret)
goto free_brd;

- pr_info(dgap: board %d: %s (rev %d), irq %ld\n,
+ pr_info(board %d: %s (rev %d), irq %ld\n,
boardnum, brd-name, brd-rev, brd-irq);



Almost all of the pr_*() calls in this driver should be converted over
to use dev_*() calls instead.  And some of them, like this one, should
be removed entirely (no need for a driver to be noisy when a device
for it is found, it should be quiet if at all possible, unless
something
went wrong.)

So can you do that here instead?  I've applied the earlier patches in
this series, and stopped here.


OK. I can. pr_*() calls are replaced with dev_*() calls.
And also removes some of print message which are useless like out
of memory



Yes, please do that, that would be great.


I have been working to change pr_*() to dev_*(), but dgap_parse() has no

struct device for using dev_*(). If dgap_parse still need for this
driver,
it need to take a parameter for using dev_*(), it may be pdev but
configuration
file doesn't need to parse in kernel at all, dgap_parse() will be removed.

So I will wait to verify by Mark about parsing configuration file.

Thanks.

regards,
Daeseok Youn.



Hi Daeseok,

I would wait on that one for now. I know that code has to be removed
eventually. I'm just not sure if we are quite ready. That is actually a LOT
of lines of code also. I think a couple of things need done first.

Here is a sample config file created by one of DIGI's user land applications
(mpi). These entries are only for 2 different cards. There are others cards
that may have other things to consider. I only have these 2 cards types now.
I had a third type which is just a 2 port but that one is gone now.

config_begin
board   Digi_AccelePort_8r_920_PCI
 io 0x000
 mem 0x00
 start 1
 nports 8
 ttyname ttya
altpin 0
useintr 0
board   Digi_AccelePort_4r_920_PCI
 io 0x000
 mem 0x00
 start 1
 nports 4
 ttyname ttyb
altpin 0
useintr 0
board   Digi_AccelePort_8r_920_PCI
 io 0x000
 mem 0x00
 start 1
 nports 8
 ttyname ttyc
altpin 0
useintr 0
config_end


oh.. I couldn't find a sample of config file for dgap module in web. Thanks.



The altpin and useintr parameters need to be converted to module parameters.
I found references in the code somewhere that the nports may not be reliably
known using the device id for at least one card type. All the other stuff in
this particular config file is pretty much useless. Well, sort of. The
ttyname parameter is used by the driver to populate a sys file with a
custom device name that is then used by a userland script and udev to allow
a user  to define his own device names. Custom links are created. Perhaps
this also would be nice to have as a module param?


I'm not sure about using module param and udev. I think config file
used when firmware
is loaded.


The config file has nothing to do with the actual firmware loading or 
which firmware file is to be loaded for a given board. There are a 
couple of things done to the board either before or after firmware loads 
that probably still require that the config file had 

Re: [PATCH 4/8] Drivers: scsi: storvsc: Filter WRITE_SAME_16

2014-07-17 Thread Martin K. Petersen
 Christoph == hch@infradead org h...@infradead.org writes:

Christoph That's mostly because we don't support larger than 512 byte
Christoph TRIM payloads yet..

I did add support for that a few years back but all hell broke loose and
we had to revert it. There were several drives that failed with more
than 512 bytes of payload despite advertising support for 4K.

It's the same problem that we have now with queued TRIM. There are
several vendors that have implemented it but until we added support in
Linux they had no way of testing it. And as a result their
implementations are buggy. Even with a Linux implementation readily
available it's hard to get them to test since Linux is not a tier 1
platform in the consumer segment. For enterprise drives it's an entirely
different matter, of course...

-- 
Martin K. Petersen  Oracle Linux Engineering
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgap: introduce dgap_cleanup_nodes()

2014-07-17 Thread Mark Hounschell
On 07/16/2014 09:35 PM, Daeseok Youn wrote:
 When a configration file is parsed with dgap_parsefile(),
 makes nodes for saving configrations for board.
 
 Making a node will allocate node memory and strings for saving
 configrations with kstrdup().
 
 So these are freed when dgap is unloaded or failed to initialize.
 
 Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
 ---
 Mark, please review this patch.
 Thanks.
 
   drivers/staging/dgap/dgap.c |   47 
 +++
   1 files changed, 47 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
 index 06c55cb..e9df2ea 100644
 --- a/drivers/staging/dgap/dgap.c
 +++ b/drivers/staging/dgap/dgap.c
 @@ -201,6 +201,7 @@ static int dgap_test_fep(struct board_t *brd);
   static int dgap_tty_register_ports(struct board_t *brd);
   static int dgap_firmware_load(struct pci_dev *pdev, int card_type,
 struct board_t *brd);
 +static void dgap_cleanup_nodes(void);
   
   static void dgap_cleanup_module(void);
   
 @@ -619,6 +620,7 @@ unregister_tty:
   free_flipbuf:
   dgap_free_flipbuf(brd);
   cleanup_brd:
 + dgap_cleanup_nodes();
   dgap_release_remap(brd);
   kfree(brd);
   
 @@ -659,6 +661,8 @@ static void dgap_cleanup_module(void)
   dgap_cleanup_board(dgap_board[i]);
   }
   
 + dgap_cleanup_nodes();
 +
   if (dgap_numboards)
   pci_unregister_driver(dgap_driver);
   }
 @@ -6323,6 +6327,49 @@ static void dgap_remove_tty_sysfs(struct device *c)
   sysfs_remove_group(c-kobj, dgap_tty_attribute_group);
   }
   
 +static void dgap_cleanup_nodes(void)
 +{
 + struct cnode *p;
 +
 + p = dgap_head;
 +
 + while (p) {
 + struct cnode *tmp = p-next;
 +
 + switch (p-type) {
 + case BNODE:
 + kfree(p-u.board.portstr);
 + kfree(p-u.board.addrstr);
 + kfree(p-u.board.pcibusstr);
 + kfree(p-u.board.pcislotstr);
 + kfree(p-u.board.method);
 + break;
 + case CNODE:
 + kfree(p-u.conc.id);
 + kfree(p-u.conc.connect);
 + break;
 + case MNODE:
 + kfree(p-u.module.id);
 + break;
 + case TNODE:
 + kfree(p-u.ttyname);
 + break;
 + case CUNODE:
 + kfree(p-u.cuname);
 + break;
 + case LNODE:
 + kfree(p-u.line.cable);
 + break;
 + case PNODE:
 + kfree(p-u.printname);
 + break;
 + }
 +
 + kfree(p-u.board.status);
 + kfree(p);
 + p = tmp;
 + }
 +}
   /*
* Parse a configuration file read into memory as a string.
*/
 

I get a kernel oops when unloading the driver with this patch.

2014-07-17T09:22:12.666987-04:00 harley kernel: [60216.979134] task: 
8801037846b0 ti: 880149256000 task.ti: 880149256000
2014-07-17T09:22:12.666988-04:00 harley kernel: [60216.979136] RIP: 
0010:[8034d5ff]  [8034d5ff] kfree+0x17f/0x190
2014-07-17T09:22:12.666989-04:00 harley kernel: [60216.979143] RSP: 
0018:880149257e78  EFLAGS: 00010246
2014-07-17T09:22:12.666991-04:00 harley kernel: [60216.979144] RAX: 
40080068 RBX: a0428d20 RCX: 038eb895
2014-07-17T09:22:12.666992-04:00 harley kernel: [60216.979146] RDX: 
40080068 RSI: ea0004131e00 RDI: a0428d20
2014-07-17T09:22:12.666993-04:00 harley kernel: [60216.979147] RBP: 
880149257e90 R08: 00015b60 R09: 88014fd55b60
2014-07-17T09:22:12.666994-04:00 harley kernel: [60216.979149] R10: 
ea810a00 R11: a0424ffd R12: 88005a3d2a80
2014-07-17T09:22:12.666995-04:00 harley kernel: [60216.979150] R13: 
a041c155 R14: 0002 R15: 0bc0
2014-07-17T09:22:12.666996-04:00 harley kernel: [60216.979152] FS:  
7fb7d51d2700() GS:88014fd4() knlGS:
2014-07-17T09:22:12.666997-04:00 harley kernel: [60216.979154] CS:  0010 DS: 
 ES:  CR0: 8005003b
2014-07-17T09:22:12.666998-04:00 harley kernel: [60216.979155] CR2: 
7fe66ee4e000 CR3: 0001497af000 CR4: 000407e0
2014-07-17T09:22:12.666999-04:00 harley kernel: [60216.979156] Stack:
2014-07-17T09:22:12.667000-04:00 harley kernel: [60216.979157]  
a0428d20 88005a3d2a80 8801259dd330 880149257eb0
2014-07-17T09:22:12.667001-04:00 harley kernel: [60216.979161]  
a041c155 0700 8801259dd000 880149257ee8
2014-07-17T09:22:12.667002-04:00 harley kernel: [60216.979164]  
a0424ee8  80c92700 a04289e0
2014-07-17T09:22:12.667002-04:00 harley kernel: 

[PATCH 1/2] staging: xillybus: Fix if-else coding style errors

2014-07-17 Thread Eli Billauer
According to Documentation/CodingStyle, when one branch of an if-else
statement has multiple statements, both branches should be enclosed in curly
brackets.

Signed-off-by: Eli Billauer eli.billa...@gmail.com
---
 drivers/staging/xillybus/xillybus_core.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/xillybus/xillybus_core.c 
b/drivers/staging/xillybus/xillybus_core.c
index 2d59734..0214009 100644
--- a/drivers/staging/xillybus/xillybus_core.c
+++ b/drivers/staging/xillybus/xillybus_core.c
@@ -158,10 +158,10 @@ irqreturn_t xillybus_isr(int irq, void *data)
ep-msg_counter,
i/2);
 
-   if (++ep-failed_messages  10)
+   if (++ep-failed_messages  10) {
dev_err(ep-dev,
Lost sync with interrupt messages. 
Stopping.\n);
-   else {
+   } else {
ep-ephw-hw_sync_sgl_for_device(
ep,
ep-msgbuf_dma_addr,
@@ -532,8 +532,9 @@ static int xilly_setupchannels(struct xilly_endpoint *ep,
 
if (!buffers)
goto memfail;
-   } else
+   } else {
bytebufsize = bufsize  2;
+   }
 
if (!is_writebuf) {
channel-num_rd_buffers = bufnum;
-- 
1.7.2.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: xillybus: Removed outdated part in README

2014-07-17 Thread Eli Billauer
The dedicated memory management routines have been replaced with devres API,
so the related part is removed from the doc.

Signed-off-by: Eli Billauer eli.billa...@gmail.com
---
 drivers/staging/xillybus/README |   23 ---
 1 files changed, 0 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/xillybus/README b/drivers/staging/xillybus/README
index d2d848a..81d111b 100644
--- a/drivers/staging/xillybus/README
+++ b/drivers/staging/xillybus/README
@@ -26,7 +26,6 @@ Contents:
   -- Data granularity
   -- Probing
   -- Buffer allocation
-  -- Memory management
   -- The nonempty message (supporting poll)
 
 
@@ -365,28 +364,6 @@ Or, if there already is a partially used page at hand, the 
buffer is packed
 into that page. It can be shown that all pages requested from the kernel
 (except possibly for the last) are 100% utilized this way.
 
-Memory management
--
-
-The tricky part about the buffer allocation procedure described above is
-freeing and unmapping the buffers, in particular if something goes wrong in
-the middle, and the allocations need to be rolled back. The three-stage
-probing procedure makes this even more crucial, since temporary buffers are
-set up and mapped in the first of its two stages.
-
-To keep the code clean from complicated and bug-prone memory release routines,
-there are special routines for allocating memory. For example, instead of
-calling kzalloc, there's
-
-void *xilly_malloc(struct xilly_cleanup *mem, size_t size)
-
-which effectively allocates a zeroed buffer of size size. Its first
-argument, mem, is where this allocation is enlisted, so that it's released
-when xillybus_do_cleanup() is called with the same mem structure.
-
-Two other functions enlist allocations in this structure: xilly_pagealloc()
-for page allocations and xilly_map_single_*() for DMA mapping.
-
 The nonempty message (supporting poll)
 ---
 
-- 
1.7.2.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: gdm72xx: replace print_hex_dump_debug() with dev_dbg()

2014-07-17 Thread Michalis Pappas
Signed-off-by: Michalis Pappas mpap...@fastmail.fm
---
 drivers/staging/gdm72xx/gdm_sdio.c | 15 +++
 drivers/staging/gdm72xx/gdm_usb.c  | 10 ++
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/gdm72xx/gdm_sdio.c 
b/drivers/staging/gdm72xx/gdm_sdio.c
index 6a23bef..a741c31 100644
--- a/drivers/staging/gdm72xx/gdm_sdio.c
+++ b/drivers/staging/gdm72xx/gdm_sdio.c
@@ -278,9 +278,8 @@ static void send_sdu(struct sdio_func *func, struct tx_cxt 
*tx)
 
spin_unlock_irqrestore(tx-lock, flags);
 
-   print_hex_dump_debug(sdio_send: , DUMP_PREFIX_NONE, 16, 1,
-tx-sdu_buf + TYPE_A_HEADER_SIZE,
-aggr_len - TYPE_A_HEADER_SIZE, false);
+   dev_dbg(func-dev, sdio_send: %*ph\n, aggr_len - TYPE_A_HEADER_SIZE,
+   tx-sdu_buf + TYPE_A_HEADER_SIZE);
 
for (pos = TYPE_A_HEADER_SIZE; pos  aggr_len; pos += TX_CHUNK_SIZE) {
len = aggr_len - pos;
@@ -315,9 +314,9 @@ static void send_hci(struct sdio_func *func, struct tx_cxt 
*tx,
 {
unsigned long flags;
 
-   print_hex_dump_debug(sdio_send: , DUMP_PREFIX_NONE, 16, 1,
-t-buf + TYPE_A_HEADER_SIZE,
-t-len - TYPE_A_HEADER_SIZE, false);
+   dev_dbg(func-dev, sdio_send: %*ph\n, t-len - TYPE_A_HEADER_SIZE,
+   t-buf + TYPE_A_HEADER_SIZE);
+
send_sdio_pkt(func, t-buf, t-len);
 
spin_lock_irqsave(tx-lock, flags);
@@ -549,8 +548,8 @@ static void gdm_sdio_irq(struct sdio_func *func)
}
 
 end_io:
-   print_hex_dump_debug(sdio_receive: , DUMP_PREFIX_NONE, 16, 1,
-rx-rx_buf, len, false);
+   dev_dbg(func-dev, sdio_receive: %*ph\n, len, rx-rx_buf);
+
len = control_sdu_tx_flow(sdev, rx-rx_buf, len);
 
spin_lock_irqsave(rx-lock, flags);
diff --git a/drivers/staging/gdm72xx/gdm_usb.c 
b/drivers/staging/gdm72xx/gdm_usb.c
index 45b3dda..eac2f34 100644
--- a/drivers/staging/gdm72xx/gdm_usb.c
+++ b/drivers/staging/gdm72xx/gdm_usb.c
@@ -341,8 +341,8 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,
usb_fill_bulk_urb(t-urb, usbdev, usb_sndbulkpipe(usbdev, 1), t-buf,
  len + padding, gdm_usb_send_complete, t);
 
-   print_hex_dump_debug(usb_send: , DUMP_PREFIX_NONE, 16, 1, t-buf,
-len + padding, false);
+   dev_dbg(usbdev-dev, usb_send: %*ph\n, len + padding, t-buf);
+
 #ifdef CONFIG_WIMAX_GDM72XX_USB_PM
if (usbdev-state  USB_STATE_SUSPENDED) {
list_add_tail(t-p_list, tx-pending_list);
@@ -420,8 +420,10 @@ static void gdm_usb_rcv_complete(struct urb *urb)
 
if (!urb-status) {
cmd_evt = (r-buf[0]  8) | (r-buf[1]);
-   print_hex_dump_debug(usb_receive: , DUMP_PREFIX_NONE, 16, 1,
-r-buf, urb-actual_length, false);
+
+   dev_dbg(dev-dev, usb_receive: %*ph\n, urb-actual_length,
+   r-buf);
+
if (cmd_evt == WIMAX_SDU_TX_FLOW) {
if (r-buf[4] == 0) {
dev_dbg(dev-dev, WIMAX == STOP SDU TX\n);
-- 
1.8.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: gdm72xx: remove debug code

2014-07-17 Thread Michalis Pappas
Removed dump_eth_packet() and helper functions called upon packet tx/rx.

Signed-off-by: Michalis Pappas mpap...@fastmail.fm
---
 drivers/staging/gdm72xx/gdm_wimax.c | 106 
 1 file changed, 106 deletions(-)

diff --git a/drivers/staging/gdm72xx/gdm_wimax.c 
b/drivers/staging/gdm72xx/gdm_wimax.c
index 726c943..6754463 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -52,108 +52,6 @@ static struct {
 
 static u8 gdm_wimax_macaddr[6] = {0x00, 0x0a, 0x3b, 0xf0, 0x01, 0x30};
 
-static const char *get_protocol_name(u16 protocol)
-{
-   static char buf[32];
-   const char *name = -;
-
-   switch (protocol) {
-   case ETH_P_ARP:
-   name = ARP;
-   break;
-   case ETH_P_IP:
-   name = IP;
-   break;
-   case ETH_P_IPV6:
-   name = IPv6;
-   break;
-   }
-
-   sprintf(buf, 0x%04x(%s), protocol, name);
-   return buf;
-}
-
-static const char *get_ip_protocol_name(u8 ip_protocol)
-{
-   static char buf[32];
-   const char *name = -;
-
-   switch (ip_protocol) {
-   case IPPROTO_TCP:
-   name = TCP;
-   break;
-   case IPPROTO_UDP:
-   name = UDP;
-   break;
-   case IPPROTO_ICMP:
-   name = ICMP;
-   break;
-   }
-
-   sprintf(buf, %u(%s), ip_protocol, name);
-   return buf;
-}
-
-static const char *get_port_name(u16 port)
-{
-   static char buf[32];
-   const char *name = -;
-
-   switch (port) {
-   case 67:
-   name = DHCP-Server;
-   break;
-   case 68:
-   name = DHCP-Client;
-   break;
-   case 69:
-   name = TFTP;
-   break;
-   }
-
-   sprintf(buf, %u(%s), port, name);
-   return buf;
-}
-
-static void dump_eth_packet(struct net_device *dev, const char *title,
-   u8 *data, int len)
-{
-   struct iphdr *ih = NULL;
-   struct udphdr *uh = NULL;
-   u16 protocol = 0;
-   u8 ip_protocol = 0;
-   u16 port = 0;
-
-   protocol = (data[12]8) | data[13];
-   ih = (struct iphdr *)(data+ETH_HLEN);
-
-   if (protocol == ETH_P_IP) {
-   uh = (struct udphdr *)((char *)ih + sizeof(struct iphdr));
-   ip_protocol = ih-protocol;
-   port = ntohs(uh-dest);
-   } else if (protocol == ETH_P_IPV6) {
-   struct ipv6hdr *i6h = (struct ipv6hdr *)data;
-
-   uh = (struct udphdr *)((char *)i6h + sizeof(struct ipv6hdr));
-   ip_protocol = i6h-nexthdr;
-   port = ntohs(uh-dest);
-   }
-
-   netdev_dbg(dev, [%s] len=%d, %s, %s, %s\n, title, len,
-  get_protocol_name(protocol),
-  get_ip_protocol_name(ip_protocol),
-  get_port_name(port));
-
-   if (!(data[0] == 0xff  data[1] == 0xff)) {
-   if (protocol == ETH_P_IP)
-   netdev_dbg(dev,  src=%pI4\n, ih-saddr);
-   else if (protocol == ETH_P_IPV6)
-   netdev_dbg(dev,  src=%pI6\n, ih-saddr);
-   }
-
-   print_hex_dump_debug(, DUMP_PREFIX_NONE, 16, 1, data, len, false);
-}
-
 static inline int gdm_wimax_header(struct sk_buff **pskb)
 {
u16 buf[HCI_HEADER_SIZE / sizeof(u16)];
@@ -361,8 +259,6 @@ static int gdm_wimax_tx(struct sk_buff *skb, struct 
net_device *dev)
 {
int ret = 0;
 
-   dump_eth_packet(dev, TX, skb-data, skb-len);
-
ret = gdm_wimax_header(skb);
if (ret  0) {
skb_pull(skb, HCI_HEADER_SIZE);
@@ -708,8 +604,6 @@ static void gdm_wimax_netif_rx(struct net_device *dev, char 
*buf, int len)
struct sk_buff *skb;
int ret;
 
-   dump_eth_packet(dev, RX, buf, len);
-
skb = dev_alloc_skb(len + 2);
if (!skb) {
netdev_err(dev, %s: dev_alloc_skb failed!\n, __func__);
-- 
1.8.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] drivers/staging/media/davinci_vpfe/dm365_ipipeif.c: fix negativity check

2014-07-17 Thread Andrey Utkin
[linux-3.16-rc5/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c:210]:
(style) Checking if unsigned variable 'val' is less than zero.

val = get_oneshot_mode(ipipeif-input);
if (val  0) {
pr_err(ipipeif: links setup required);
return -EINVAL;
}

but

static int get_oneshot_mode(enum ipipeif_input_entity input)

Introduced temporary variable for negativity check.
val is afterwards used in a lot of bitwise operations, so changing its type
to signed is not safe, according to CERT C Secure Coding Standards chapter
INT13-C: Use bitwise operators only on unsigned operands
https://www.securecoding.cert.org/confluence/display/seccode/INT13-C.+Use+bitwise+operators+only+on+unsigned+operands

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80521
Reported-by: David Binderman dcb...@hotmail.com
Signed-off-by: Andrey Utkin andrey.krieger.ut...@gmail.com
---
 drivers/staging/media/davinci_vpfe/dm365_ipipeif.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c 
b/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
index 59540cd..6d4893b 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
@@ -196,6 +196,7 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)
int data_shift;
int pack_mode;
int source1;
+   int tmp;
 
ipipeif_base_addr = ipipeif-ipipeif_base_addr;
 
@@ -206,8 +207,8 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)
outformat = ipipeif-formats[IPIPEIF_PAD_SOURCE];
 
/* Combine all the fields to make CFG1 register of IPIPEIF */
-   val = get_oneshot_mode(ipipeif-input);
-   if (val  0) {
+   tmp = val = get_oneshot_mode(ipipeif-input);
+   if (tmp  0) {
pr_err(ipipeif: links setup required);
return -EINVAL;
}
-- 
1.8.5.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c: drop incorrect checks

2014-07-17 Thread Andrey Utkin
Dropped some  0 and = 0 checks on unsigned int values.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80501
Reported-by: David Binderman dcb...@hotmail.com
Signed-off-by: Andrey Utkin andrey.krieger.ut...@gmail.com
---
 .../comedi/drivers/addi-data/hwdrv_apci3200.c| 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c 
b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c
index a3026a2..3a215ac 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c
@@ -1750,34 +1750,34 @@ static int apci3200_ai_config(struct comedi_device *dev,
/* END JK 06.07.04: Management of sevrals boards */
 
if (data[5] == 0) {
-   if (ui_ChannelNo  0 || ui_ChannelNo  15) {
+   if (ui_ChannelNo  15) {
printk(\nThe Selection of the channel is in error\n);
i_err++;
-   }   /*  if(ui_ChannelNo0 || ui_ChannelNo15) */
+   }   /*  if(ui_ChannelNo15) */
}   /* if(data[5]==0) */
else {
if (data[14] == 2) {
-   if (ui_ChannelNo  0 || ui_ChannelNo  3) {
+   if (ui_ChannelNo  3) {
printk(\nThe Selection of the channel is in 
error\n);
i_err++;
-   }   /*  if(ui_ChannelNo0 || ui_ChannelNo3) */
+   }   /*  if(ui_ChannelNo3) */
}   /* if(data[14]==2) */
else {
-   if (ui_ChannelNo  0 || ui_ChannelNo  7) {
+   if (ui_ChannelNo  7) {
printk(\nThe Selection of the channel is in 
error\n);
i_err++;
-   }   /*  if(ui_ChannelNo0 || ui_ChannelNo7) */
+   }   /*  if(ui_ChannelNo7) */
}   /* elseif(data[14]==2) */
}   /* elseif(data[5]==0) */
if (data[12] == 0 || data[12] == 1) {
switch (data[5]) {
case 0:
-   if (ui_ChannelNo = 0  ui_ChannelNo = 3) {
+   if (ui_ChannelNo = 3) {
/* BEGIN JK 06.07.04: Management of sevrals 
boards */
/* i_Offset=0; */
s_BoardInfos[dev-minor].i_Offset = 0;
/* END JK 06.07.04: Management of sevrals 
boards */
-   }   /* if(ui_ChannelNo =0  ui_ChannelNo =3) */
+   }   /* if(ui_ChannelNo =3) */
if (ui_ChannelNo = 4  ui_ChannelNo = 7) {
/* BEGIN JK 06.07.04: Management of sevrals 
boards */
/* i_Offset=64; */
@@ -1831,12 +1831,12 @@ static int apci3200_ai_config(struct comedi_device *dev,
ui_ChannelNo = 0;
break;
}   /* if(data[14]==2) */
-   if (ui_ChannelNo = 0  ui_ChannelNo = 1) {
+   if (ui_ChannelNo = 1) {
/* BEGIN JK 06.07.04: Management of sevrals 
boards */
/* i_Offset=0; */
s_BoardInfos[dev-minor].i_Offset = 0;
/* END JK 06.07.04: Management of sevrals 
boards */
-   }   /* if(ui_ChannelNo =0  ui_ChannelNo =1) */
+   }   /* if(ui_ChannelNo =1) */
if (ui_ChannelNo = 2  ui_ChannelNo = 3) {
/* BEGIN JK 06.07.04: Management of sevrals 
boards */
/* i_ChannelNo=i_ChannelNo-2; */
-- 
1.8.5.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: unisys: simplify controlvm channel address function

2014-07-17 Thread Benjamin Romer
There is no reason to have controlvm_get_channel_address() defined in a
separate file. Move it to visorchipset_main.c, remove the no-op functions
controlvm_init() and controlvm_deinit() from visorchipset_main.c, and remove
the controlvm.h and controlvm_direct.c files from the module.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/visorchipset/Makefile   |  3 +-
 drivers/staging/unisys/visorchipset/controlvm.h| 27 --
 .../staging/unisys/visorchipset/controlvm_direct.c | 62 --
 .../unisys/visorchipset/visorchipset_main.c| 17 --
 4 files changed, 15 insertions(+), 94 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorchipset/controlvm.h
 delete mode 100644 drivers/staging/unisys/visorchipset/controlvm_direct.c

diff --git a/drivers/staging/unisys/visorchipset/Makefile 
b/drivers/staging/unisys/visorchipset/Makefile
index 5071878..1268690 100644
--- a/drivers/staging/unisys/visorchipset/Makefile
+++ b/drivers/staging/unisys/visorchipset/Makefile
@@ -4,8 +4,7 @@
 
 obj-$(CONFIG_UNISYS_VISORCHIPSET)  += visorchipset.o
 
-visorchipset-y := visorchipset_main.o controlvm_direct.o file.o \
-   parser.o
+visorchipset-y := visorchipset_main.o file.o parser.o
 
 ccflags-y += -Idrivers/staging/unisys/include
 ccflags-y += -Idrivers/staging/unisys/uislib
diff --git a/drivers/staging/unisys/visorchipset/controlvm.h 
b/drivers/staging/unisys/visorchipset/controlvm.h
deleted file mode 100644
index 012891c..000
--- a/drivers/staging/unisys/visorchipset/controlvm.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* controlvm.h
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#ifndef __CONTROLVM_H__
-#define __CONTROLVM_H__
-
-#include timskmod.h
-
-int controlvm_init(void);
-voidcontrolvm_deinit(void);
-HOSTADDRESS controlvm_get_channel_address(void);
-
-#endif
diff --git a/drivers/staging/unisys/visorchipset/controlvm_direct.c 
b/drivers/staging/unisys/visorchipset/controlvm_direct.c
deleted file mode 100644
index cd10e3a..000
--- a/drivers/staging/unisys/visorchipset/controlvm_direct.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* controlvm_direct.c
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/* This is a controlvm-related code that is dependent upon firmware running
- * on a virtual partition.
- */
-
-#include globals.h
-#include uisutils.h
-#include controlvm.h
-#define CURRENT_FILE_PC VISOR_CHIPSET_PC_controlvm_direct_c
-
-
-/* We can fill in this code when we learn how to make vmcalls... */
-
-
-
-int controlvm_init(void)
-{
-   return 0;
-}
-
-
-
-void controlvm_deinit(void)
-{
-}
-
-
-
-HOSTADDRESS controlvm_get_channel_address(void)
-{
-   static BOOL warned = FALSE;
-   U64 addr = 0;
-
-   U32 size = 0;
-
-   if (!VMCALL_SUCCESSFUL(Issue_VMCALL_IO_CONTROLVM_ADDR(addr, size))) {
-   if (!warned) {
-   ERRDRV(%s - vmcall to determine controlvm channel addr 
failed,
-  __func__);
-   warned = TRUE;
-   }
-   return 0;
-   }
-   INFODRV(controlvm addr=%Lx, addr);
-   return addr;
-}
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index ecbeaec..ea0fb64 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -16,7 +16,6 @@
  */
 
 #include globals.h
-#include controlvm.h
 #include visorchipset.h
 #include procobjecttree.h
 #include visorchannel.h
@@ -1837,6 +1836,20 @@ handle_command(CONTROLVM_MESSAGE inmsg, HOSTADDRESS 
channel_addr)
return TRUE;
 }
 
+HOSTADDRESS controlvm_get_channel_address(void)
+{
+   U64 addr = 0;
+   U32 size = 0;
+
+

[PATCH 0/2] staging: unisys: ControlVM channel fixes

2014-07-17 Thread Benjamin Romer
These patches simplify the code in the visorchipset module, in preparation for
moving the module's proc entries to sysfs.

Benjamin Romer (2):
  staging: unisys: simplify controlvm channel address function
  staging: unisys: detect controlvm channel on module load

 drivers/staging/unisys/visorchipset/Makefile   |   3 +-
 drivers/staging/unisys/visorchipset/controlvm.h|  27 ---
 .../staging/unisys/visorchipset/controlvm_direct.c |  62 ---
 .../unisys/visorchipset/visorchipset_main.c| 203 -
 4 files changed, 80 insertions(+), 215 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorchipset/controlvm.h
 delete mode 100644 drivers/staging/unisys/visorchipset/controlvm_direct.c

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: comedi: ni_670x: fix compile on ARCH=arm

2014-07-17 Thread H Hartley Sweeten
The kbuild test robot reported a build error on ARCH=arm about
implicit declaration of the functions 'kmalloc' and 'kfree'.

On ARCH=x86 the slab.h header is indirectly included by pci.h,
this does not occur on ARCH=arm.

Include slab.h directly instead of relying on some other header
to include it.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: kbuild test robot fengguang...@intel.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/ni_670x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/comedi/drivers/ni_670x.c 
b/drivers/staging/comedi/drivers/ni_670x.c
index 709119c..a054bd5 100644
--- a/drivers/staging/comedi/drivers/ni_670x.c
+++ b/drivers/staging/comedi/drivers/ni_670x.c
@@ -39,6 +39,7 @@ Commands are not supported.
 #include linux/module.h
 #include linux/pci.h
 #include linux/interrupt.h
+#include linux/slab.h
 
 #include ../comedidev.h
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Richard Weinberger
Am 17.07.2014 12:48, schrieb Arnd Bergmann:
 AFAICT, NO_IOMEM only has a real purpose on UML these days. Could we take
 a shortcut here and make COMPILE_TEST depend on !UML? Getting random stuff
 to build on UML seems pointless to me and we special-case it in a number of
 places already.

If UML is the only arch without io memory the dependency on !UML seems
reasonable to me. :-)

Thanks,
//richard
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


This requires a private arrangement

2014-07-17 Thread Ms.Sarah C.Davis


Good Day,

It is my desire to introduce this business to you and hoping you will take
the opportunity for our mutual benefits. I contact you through this medium
now in order to provide the link for detail discussion. I will provide
more information with my personal resume for your acquaintance and
confidence for serious involvement.

I am Mrs Sarah Chanda Davis, a bank senior auditor and I need your
services in a confidential matter regarding money transfer.This requires a
private arrangement that will be disclosed as you indicate interest in the
proposal. I have all the enabling documents and privilege of my office to
achieve success in the program within a very short time as we start the
process. Besides, I have worked out the modalities to ensure a quick and
risk free transfer.

I'm willing to offer you 50% of the money in question. Looking forward to
your earnest response so that I can make available more information to
help your decision on the matter. Include a phone number I can call you
upon your positive response, I need your reply through my private email
address ( sarahch...@hotmail.com ).


Kind regards,
Mrs Sarah Chanda Davis
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 23/29] staging: comedi: adv_pci1724: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/adv_pci1724.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c 
b/drivers/staging/comedi/drivers/adv_pci1724.c
index af670ac..bc3c349 100644
--- a/drivers/staging/comedi/drivers/adv_pci1724.c
+++ b/drivers/staging/comedi/drivers/adv_pci1724.c
@@ -143,7 +143,8 @@ static int wait_for_dac_idle(struct comedi_device *dev)
udelay(1);
}
if (i == timeout) {
-   comedi_error(dev, Timed out waiting for dac to become idle.);
+   dev_err(dev-class_dev,
+   Timed out waiting for dac to become idle\n);
return -EIO;
}
return 0;
@@ -195,8 +196,8 @@ static int ao_readback_insn(struct comedi_device *dev,
int i;
 
if (devpriv-ao_value[channel]  0) {
-   comedi_error(dev,
-Cannot read back channels which have not yet been 
written to.);
+   dev_err(dev-class_dev,
+   Cannot read back channels which have not yet been 
written to\n);
return -EIO;
}
for (i = 0; i  insn-n; i++)
@@ -236,8 +237,8 @@ static int offset_read_insn(struct comedi_device *dev,
int i;
 
if (devpriv-offset_value[channel]  0) {
-   comedi_error(dev,
-Cannot read back channels which have not yet been 
written to.);
+   dev_err(dev-class_dev,
+   Cannot read back channels which have not yet been 
written to\n);
return -EIO;
}
for (i = 0; i  insn-n; i++)
@@ -277,8 +278,8 @@ static int gain_read_insn(struct comedi_device *dev,
int i;
 
if (devpriv-gain_value[channel]  0) {
-   comedi_error(dev,
-Cannot read back channels which have not yet been 
written to.);
+   dev_err(dev-class_dev,
+   Cannot read back channels which have not yet been 
written to\n);
return -EIO;
}
for (i = 0; i  insn-n; i++)
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/29] staging: comedi: ni_labpc: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/ni_labpc.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_labpc.c 
b/drivers/staging/comedi/drivers/ni_labpc.c
index 34ffa2e..6fb405e 100644
--- a/drivers/staging/comedi/drivers/ni_labpc.c
+++ b/drivers/staging/comedi/drivers/ni_labpc.c
@@ -895,7 +895,7 @@ static int labpc_drain_fifo(struct comedi_device *dev)
devpriv-stat1 = devpriv-read_byte(dev-iobase + STAT1_REG);
}
if (i == timeout) {
-   comedi_error(dev, ai timeout, fifo never empties);
+   dev_err(dev-class_dev, ai timeout, fifo never empties\n);
async-events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
return -1;
}
@@ -926,7 +926,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d)
struct comedi_cmd *cmd;
 
if (!dev-attached) {
-   comedi_error(dev, premature interrupt);
+   dev_err(dev-class_dev, premature interrupt\n);
return IRQ_HANDLED;
}
 
@@ -950,7 +950,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d)
devpriv-write_byte(0x1, dev-iobase + ADC_FIFO_CLEAR_REG);
async-events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
cfc_handle_events(dev, s);
-   comedi_error(dev, overrun);
+   dev_err(dev-class_dev, overrun\n);
return IRQ_HANDLED;
}
 
@@ -960,7 +960,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d)
labpc_drain_fifo(dev);
 
if (devpriv-stat1  STAT1_CNTINT) {
-   comedi_error(dev, handled timer interrupt?);
+   dev_err(dev-class_dev, handled timer interrupt?\n);
/*  clear it */
devpriv-write_byte(0x1, dev-iobase + TIMER_CLEAR_REG);
}
@@ -970,7 +970,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d)
devpriv-write_byte(0x1, dev-iobase + ADC_FIFO_CLEAR_REG);
async-events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
cfc_handle_events(dev, s);
-   comedi_error(dev, overflow);
+   dev_err(dev-class_dev, overflow\n);
return IRQ_HANDLED;
}
/*  handle external stop trigger */
@@ -1186,7 +1186,7 @@ static int labpc_eeprom_write(struct comedi_device *dev,
break;
}
if (i == timeout) {
-   comedi_error(dev, eeprom write timed out);
+   dev_err(dev-class_dev, eeprom write timed out\n);
return -ETIME;
}
/*  update software copy of eeprom */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 20/29] staging: comedi: amplc_pci230: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/amplc_pci230.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c 
b/drivers/staging/comedi/drivers/amplc_pci230.c
index f003449..2c318fc 100644
--- a/drivers/staging/comedi/drivers/amplc_pci230.c
+++ b/drivers/staging/comedi/drivers/amplc_pci230.c
@@ -1167,7 +1167,7 @@ static void pci230_handle_ao_nofifo(struct comedi_device 
*dev,
if (ret == 0) {
s-async-events |= COMEDI_CB_OVERFLOW;
pci230_ao_stop(dev, s);
-   comedi_error(dev, AO buffer underrun);
+   dev_err(dev-class_dev, AO buffer underrun\n);
return;
}
/* Write value to DAC. */
@@ -1215,7 +1215,7 @@ static int pci230_handle_ao_fifo(struct comedi_device 
*dev,
if (events == 0) {
/* Check for FIFO underrun. */
if ((dacstat  PCI230P2_DAC_FIFO_UNDERRUN_LATCHED) != 0) {
-   comedi_error(dev, AO FIFO underrun);
+   dev_err(dev-class_dev, AO FIFO underrun\n);
events |= COMEDI_CB_OVERFLOW | COMEDI_CB_ERROR;
}
/* Check for buffer underrun if FIFO less than half full
@@ -1223,7 +1223,7 @@ static int pci230_handle_ao_fifo(struct comedi_device 
*dev,
 * interrupts). */
if ((num_scans == 0)
 ((dacstat  PCI230P2_DAC_FIFO_HALF) == 0)) {
-   comedi_error(dev, AO buffer underrun);
+   dev_err(dev-class_dev, AO buffer underrun\n);
events |= COMEDI_CB_OVERFLOW | COMEDI_CB_ERROR;
}
}
@@ -1270,7 +1270,7 @@ static int pci230_handle_ao_fifo(struct comedi_device 
*dev,
/* Check if FIFO underrun occurred while writing to FIFO. */
dacstat = inw(dev-iobase + PCI230_DACCON);
if ((dacstat  PCI230P2_DAC_FIFO_UNDERRUN_LATCHED) != 0) {
-   comedi_error(dev, AO FIFO underrun);
+   dev_err(dev-class_dev, AO FIFO underrun\n);
events |= COMEDI_CB_OVERFLOW | COMEDI_CB_ERROR;
}
}
@@ -2181,7 +2181,7 @@ static void pci230_handle_ai(struct comedi_device *dev,
if ((status_fifo  PCI230_ADC_FIFO_FULL_LATCHED) != 0) {
/* Report error otherwise FIFO overruns will go
 * unnoticed by the caller. */
-   comedi_error(dev, AI FIFO overrun);
+   dev_err(dev-class_dev, AI FIFO overrun\n);
events |= COMEDI_CB_OVERFLOW | COMEDI_CB_ERROR;
break;
} else if ((status_fifo  PCI230_ADC_FIFO_EMPTY) != 0) {
@@ -2208,7 +2208,7 @@ static void pci230_handle_ai(struct comedi_device *dev,
/* Read sample and store in Comedi's circular buffer. */
if (comedi_buf_put(s, pci230_ai_read(dev)) == 0) {
events |= COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW;
-   comedi_error(dev, AI buffer overflow);
+   dev_err(dev-class_dev, AI buffer overflow\n);
break;
}
fifoamount--;
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 18/29] staging: comedi: comedi_test: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/comedi_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_test.c 
b/drivers/staging/comedi/drivers/comedi_test.c
index 1e2fb91..845a679 100644
--- a/drivers/staging/comedi/drivers/comedi_test.c
+++ b/drivers/staging/comedi/drivers/comedi_test.c
@@ -303,8 +303,8 @@ static int waveform_ai_cmd(struct comedi_device *dev,
struct comedi_cmd *cmd = s-async-cmd;
 
if (cmd-flags  TRIG_RT) {
-   comedi_error(dev,
-commands at RT priority not supported in this 
driver);
+   dev_err(dev-class_dev,
+   commands at RT priority not supported in this 
driver\n);
return -1;
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/29] staging: comedi: cb_pcidas64: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/cb_pcidas64.c | 33 +++-
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c 
b/drivers/staging/comedi/drivers/cb_pcidas64.c
index 0fd73e7..1e69c82 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -1160,7 +1160,7 @@ static unsigned int ai_range_bits_6xxx(const struct 
comedi_device *dev,
bits = 0x700;
break;
default:
-   comedi_error(dev, bug! in ai_range_bits_6xxx);
+   dev_err(dev-class_dev, bug! in %s\n, __func__);
break;
}
if (range-min == 0)
@@ -1187,9 +1187,9 @@ static void set_dac_range_bits(struct comedi_device *dev,
unsigned int code = thisboard-ao_range_code[range];
 
if (channel  1)
-   comedi_error(dev, bug! bad channel?);
+   dev_err(dev-class_dev, bug! bad channel?\n);
if (code  ~0x3)
-   comedi_error(dev, bug! bad range code?);
+   dev_err(dev-class_dev, bug! bad range code?\n);
 
*bits = ~(0x3  (2 * channel));
*bits |= code  (2 * channel);
@@ -1531,10 +1531,10 @@ static int alloc_and_init_dma_members(struct 
comedi_device *dev)
 
 static inline void warn_external_queue(struct comedi_device *dev)
 {
-   comedi_error(dev,
-AO command and AI external channel queue cannot be used 
simultaneously.);
-   comedi_error(dev,
-Use internal AI channel queue (channels must be 
consecutive and use same range/aref));
+   dev_err(dev-class_dev,
+   AO command and AI external channel queue cannot be used 
simultaneously\n);
+   dev_err(dev-class_dev,
+   Use internal AI channel queue (channels must be consecutive 
and use same range/aref)\n);
 }
 
 /* Their i2c requires a huge delay on setting clock or data high for some 
reason */
@@ -1648,7 +1648,8 @@ static void i2c_write(struct comedi_device *dev, unsigned 
int address,
 
/*  get acknowledge */
if (i2c_read_ack(dev) != 0) {
-   comedi_error(dev, i2c write failed: no acknowledge);
+   dev_err(dev-class_dev, %s failed: no acknowledge\n,
+   __func__);
i2c_stop(dev);
return;
}
@@ -1656,7 +1657,8 @@ static void i2c_write(struct comedi_device *dev, unsigned 
int address,
for (i = 0; i  length; i++) {
i2c_write_byte(dev, data[i]);
if (i2c_read_ack(dev) != 0) {
-   comedi_error(dev, i2c write failed: no acknowledge);
+   dev_err(dev-class_dev, %s failed: no acknowledge\n,
+   __func__);
i2c_stop(dev);
return;
}
@@ -2234,7 +2236,7 @@ static uint32_t ai_convert_counter_4020(struct 
comedi_device *dev,
divisor = devpriv-ext_clock.divisor;
break;
default:/*  should never happen */
-   comedi_error(dev, bug! failed to set ai pacing!);
+   dev_err(dev-class_dev, bug! failed to set ai pacing!\n);
divisor = 1000;
break;
}
@@ -2767,7 +2769,7 @@ static void handle_ai_interrupt(struct comedi_device *dev,
 
/*  check for fifo overrun */
if (status  ADC_OVERRUN_BIT) {
-   comedi_error(dev, fifo overrun);
+   dev_err(dev-class_dev, fifo overrun\n);
async-events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
}
/*  spin lock makes sure no one else changes plx dma control reg */
@@ -3130,7 +3132,8 @@ static void set_dac_select_reg(struct comedi_device *dev,
first_channel = CR_CHAN(cmd-chanlist[0]);
last_channel = CR_CHAN(cmd-chanlist[cmd-chanlist_len - 1]);
if (last_channel  first_channel)
-   comedi_error(dev, bug! last ao channel  first ao channel);
+   dev_err(dev-class_dev,
+   bug! last ao channel  first ao channel\n);
 
bits = (first_channel  0x7) | (last_channel  0x7)  3;
 
@@ -3153,7 +3156,7 @@ static void set_dac_interval_regs(struct comedi_device 
*dev,
 
divisor = get_ao_divisor(cmd-scan_begin_arg, cmd-flags);
if 

[PATCH 21/29] staging: comedi: amplc_dio_common: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/amplc_dio200_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c 
b/drivers/staging/comedi/drivers/amplc_dio200_common.c
index 2996b1a..78700e8 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
@@ -327,7 +327,7 @@ static void dio200_read_scan_intr(struct comedi_device *dev,
/* Error!  Stop acquisition.  */
dio200_stop_intr(dev, s);
s-async-events |= COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW;
-   comedi_error(dev, buffer overflow);
+   dev_err(dev-class_dev, buffer overflow\n);
}
 
/* Check for end of acquisition. */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/29] staging: comedi: ni_mio_common: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 56 ++
 1 file changed, 30 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index f00290a..751a1f4 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -771,8 +771,8 @@ static int ni_request_ai_mite_channel(struct comedi_device 
*dev)
mite_request_channel(devpriv-mite, devpriv-ai_mite_ring);
if (devpriv-ai_mite_chan == NULL) {
spin_unlock_irqrestore(devpriv-mite_channel_lock, flags);
-   comedi_error(dev,
-failed to reserve mite dma channel for analog 
input.);
+   dev_err(dev-class_dev,
+   failed to reserve mite dma channel for analog 
input\n);
return -EBUSY;
}
devpriv-ai_mite_chan-dir = COMEDI_INPUT;
@@ -792,8 +792,8 @@ static int ni_request_ao_mite_channel(struct comedi_device 
*dev)
mite_request_channel(devpriv-mite, devpriv-ao_mite_ring);
if (devpriv-ao_mite_chan == NULL) {
spin_unlock_irqrestore(devpriv-mite_channel_lock, flags);
-   comedi_error(dev,
-failed to reserve mite dma channel for analog 
outut.);
+   dev_err(dev-class_dev,
+   failed to reserve mite dma channel for analog 
outut\n);
return -EBUSY;
}
devpriv-ao_mite_chan-dir = COMEDI_OUTPUT;
@@ -818,8 +818,8 @@ static int ni_request_gpct_mite_channel(struct 
comedi_device *dev,
 devpriv-gpct_mite_ring[gpct_index]);
if (mite_chan == NULL) {
spin_unlock_irqrestore(devpriv-mite_channel_lock, flags);
-   comedi_error(dev,
-failed to reserve mite dma channel for counter.);
+   dev_err(dev-class_dev,
+   failed to reserve mite dma channel for counter\n);
return -EBUSY;
}
mite_chan-dir = direction;
@@ -844,8 +844,8 @@ static int ni_request_cdo_mite_channel(struct comedi_device 
*dev)
mite_request_channel(devpriv-mite, devpriv-cdo_mite_ring);
if (devpriv-cdo_mite_chan == NULL) {
spin_unlock_irqrestore(devpriv-mite_channel_lock, flags);
-   comedi_error(dev,
-failed to reserve mite dma channel for correlated 
digital outut.);
+   dev_err(dev-class_dev,
+   failed to reserve mite dma channel for correlated 
digital output\n);
return -EBUSY;
}
devpriv-cdo_mite_chan-dir = COMEDI_OUTPUT;
@@ -971,7 +971,7 @@ static void ni_clear_ai_fifo(struct comedi_device *dev)
udelay(1);
}
if (i == timeout)
-   comedi_error(dev, FIFO flush timeout.);
+   dev_err(dev-class_dev, FIFO flush timeout\n);
} else {
ni_stc_writew(dev, 1, ADC_FIFO_Clear);
if (devpriv-is_625x) {
@@ -1126,7 +1126,7 @@ static int ni_ao_wait_for_dma_load(struct comedi_device 
*dev)
udelay(10);
}
if (i == timeout) {
-   comedi_error(dev, timed out waiting for dma load);
+   dev_err(dev-class_dev, timed out waiting for dma load\n);
return -EPIPE;
}
return 0;
@@ -1291,7 +1291,8 @@ static void ni_ai_fifo_read(struct comedi_device *dev,
} else {
if (n  sizeof(devpriv-ai_fifo_buffer) /
sizeof(devpriv-ai_fifo_buffer[0])) {
-   comedi_error(dev, bug! ai_fifo_buffer too small);
+   dev_err(dev-class_dev,
+   bug! ai_fifo_buffer too small\n);
async-events |= COMEDI_CB_ERROR;
return;
}
@@ -2438,7 +2439,7 @@ static int ni_ai_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
int interrupt_a_enable = 0;
 
if (dev-irq == 0) {
-   comedi_error(dev, cannot run command without an irq);
+   dev_err(dev-class_dev, cannot run command without an irq\n);
return -EIO;
}
 

[PATCH 28/29] staging: comedi: hwdrv_apci1500: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c 
b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c
index a633957..1e2fe66 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c
@@ -872,7 +872,8 @@ static int apci1500_do_write(struct comedi_device *dev,
break;
 
default:
-   comedi_error(dev,  chan spec wrong);
+   dev_err(dev-class_dev,
+   chan spec wrong\n);
return -EINVAL; /*  sorry channel spec 
wrong  */
 
}   /* switch(ui_NoOfChannels) */
@@ -950,8 +951,8 @@ static int apci1500_do_write(struct comedi_device *dev,
break;
 
default:
-   comedi_error(dev,
-chan spec wrong);
+   dev_err(dev-class_dev,
+   chan spec wrong\n);
return -EINVAL; /*  sorry 
channel spec wrong  */
 
}   /* switch(ui_NoOfChannels) */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 26/29] staging: comedi: hwdrv_apci3120: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 .../comedi/drivers/addi-data/hwdrv_apci3120.c  | 27 +++---
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c 
b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
index bfa154d..6e61226 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
@@ -318,7 +318,8 @@ static int apci3120_setup_chan_list(struct comedi_device 
*dev,
/* correct channel and range number check itself comedi/range.c */
if (n_chan  1) {
if (!check)
-   comedi_error(dev, range/channel list is empty!);
+   dev_err(dev-class_dev,
+   range/channel list is empty!\n);
return 0;
}
/*  All is ok, so we can setup channel/range list */
@@ -1373,10 +1374,10 @@ static void apci3120_interrupt_dma(int irq, void *d)
 
if (samplesinbuf 
devpriv-ui_DmaBufferUsesize[devpriv-ui_DmaActualBuffer]) {
-   comedi_error(dev, Interrupted DMA transfer!);
+   dev_err(dev-class_dev, Interrupted DMA transfer!\n);
}
if (samplesinbuf  1) {
-   comedi_error(dev, Odd count of bytes in DMA ring!);
+   dev_err(dev-class_dev, Odd count of bytes in DMA ring!\n);
apci3120_cancel(dev, s);
return;
}
@@ -1548,7 +1549,7 @@ static void apci3120_interrupt(int irq, void *d)
int_amcc = inl(devpriv-i_IobaseAmcc + AMCC_OP_REG_INTCSR); /*  get 
AMCC int register */
 
if ((!int_daq)  (!(int_amcc  ANY_S593X_INT))) {
-   comedi_error(dev, IRQ from unknown source);
+   dev_err(dev-class_dev, IRQ from unknown source\n);
return;
}
 
@@ -1565,9 +1566,9 @@ static void apci3120_interrupt(int irq, void *d)
inb(devpriv-i_IobaseAmcc + APCI3120_TIMER_STATUS_REGISTER);
 
if (int_amcc  MASTER_ABORT_INT)
-   comedi_error(dev, AMCC IRQ - MASTER DMA ABORT!);
+   dev_err(dev-class_dev, AMCC IRQ - MASTER DMA ABORT!\n);
if (int_amcc  TARGET_ABORT_INT)
-   comedi_error(dev, AMCC IRQ - TARGET DMA ABORT!);
+   dev_err(dev-class_dev, AMCC IRQ - TARGET DMA ABORT!\n);
 
/*  Ckeck if EOC interrupt */
if (((int_daq  0x8) == 0)
@@ -1740,7 +1741,7 @@ static int apci3120_config_insn_timer(struct 
comedi_device *dev,
unsigned char b_Tmp;
 
if (!data[1])
-   comedi_error(dev, config:No timer constant !);
+   dev_err(dev-class_dev, No timer constant!\n);
 
devpriv-b_Timer2Interrupt = (unsigned char) data[2];   /*  save info 
whether to enable or disable interrupt */
 
@@ -1886,14 +1887,14 @@ static int apci3120_write_insn_timer(struct 
comedi_device *dev,
 
if ((devpriv-b_Timer2Mode != APCI3120_WATCHDOG)
 (devpriv-b_Timer2Mode != APCI3120_TIMER)) {
-   comedi_error(dev, \nwrite:timer2  not configured );
+   dev_err(dev-class_dev, timer2 not configured\n);
return -EINVAL;
}
 
if (data[0] == 2) { /*  write new value */
if (devpriv-b_Timer2Mode != APCI3120_TIMER) {
-   comedi_error(dev,
-   write :timer2  not configured  in TIMER MODE);
+   dev_err(dev-class_dev,
+   timer2 not configured in TIMER MODE\n);
return -EINVAL;
}
 
@@ -1991,8 +1992,8 @@ static int apci3120_write_insn_timer(struct comedi_device 
*dev,
 
case 2: /* write new value to Timer */
if (devpriv-b_Timer2Mode != APCI3120_TIMER) {
-   comedi_error(dev,
-   write :timer2  not configured  in TIMER MODE);
+   dev_err(dev-class_dev,
+   timer2 not configured in TIMER MODE\n);
return -EINVAL;
}
/*  ui_Timervalue2=data[1]; // passed as argument */
@@ -2056,7 +2057,7 @@ static int apci3120_read_insn_timer(struct comedi_device 
*dev,
 
if ((devpriv-b_Timer2Mode != APCI3120_WATCHDOG)
 (devpriv-b_Timer2Mode != 

[PATCH 11/29] staging: comedi: icp_multi: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/icp_multi.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/icp_multi.c 
b/drivers/staging/comedi/drivers/icp_multi.c
index 0b8b216..acc80e2 100644
--- a/drivers/staging/comedi/drivers/icp_multi.c
+++ b/drivers/staging/comedi/drivers/icp_multi.c
@@ -420,7 +420,7 @@ static int check_channel_list(struct comedi_device *dev,
 
/*  Check that we at least have one channel to check */
if (n_chan  1) {
-   comedi_error(dev, range/channel list is empty!);
+   dev_err(dev-class_dev, range/channel list is empty!\n);
return 0;
}
/*  Check all channels */
@@ -428,14 +428,14 @@ static int check_channel_list(struct comedi_device *dev,
/*  Check that channel number is  maximum */
if (CR_AREF(chanlist[i]) == AREF_DIFF) {
if (CR_CHAN(chanlist[i])  (s-nchan / 2)) {
-   comedi_error(dev,
-Incorrect differential ai ch-nr);
+   dev_err(dev-class_dev,
+   Incorrect differential ai ch-nr\n);
return 0;
}
} else {
if (CR_CHAN(chanlist[i])  s-n_chan) {
-   comedi_error(dev,
-Incorrect ai channel number);
+   dev_err(dev-class_dev,
+   Incorrect ai channel number\n);
return 0;
}
}
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 29/29] staging: comedi: remove comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character.

All of the users of this function have been converted to use dev_err()
directly. Remove the now unused function.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/comedi_fops.c | 6 --
 drivers/staging/comedi/comedidev.h   | 1 -
 drivers/staging/comedi/drivers.c | 2 --
 3 files changed, 9 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index 3686296..630ef1f 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2401,12 +2401,6 @@ static const struct file_operations comedi_fops = {
.llseek = noop_llseek,
 };
 
-void comedi_error(const struct comedi_device *dev, const char *s)
-{
-   dev_err(dev-class_dev, %s: %s\n, dev-driver-driver_name, s);
-}
-EXPORT_SYMBOL_GPL(comedi_error);
-
 void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s)
 {
struct comedi_async *async = s-async;
diff --git a/drivers/staging/comedi/comedidev.h 
b/drivers/staging/comedi/comedidev.h
index a7f24a9..67cc882 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -280,7 +280,6 @@ static inline const void *comedi_board(const struct 
comedi_device *dev)
  */
 
 void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s);
-void comedi_error(const struct comedi_device *dev, const char *s);
 
 /* we can expand the number of bits used to encode devices/subdevices into
  the minor number soon, after more distros support  8 bit minor numbers
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 299726f..9bfd05b 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -591,8 +591,6 @@ int comedi_device_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
ret = -ENOSYS;
goto out;
}
-   /* initialize dev-driver here so
-* comedi_error() can be called from attach */
dev-driver = driv;
dev-board_name = dev-board_ptr ? *(const char **)dev-board_ptr
 : dev-driver-driver_name;
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 19/29] staging: comedi: cb_pcidas: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/cb_pcidas.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c 
b/drivers/staging/comedi/drivers/cb_pcidas.c
index 9badd19..8e82383 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
@@ -621,7 +621,7 @@ static int caldac_8800_write(struct comedi_device *dev, 
unsigned int address,
static const int caldac_8800_udelay = 1;
 
if (address = num_caldac_channels) {
-   comedi_error(dev, illegal caldac channel);
+   dev_err(dev-class_dev, illegal caldac channel\n);
return -1;
}
 
@@ -773,7 +773,7 @@ static int cb_pcidas_trimpot_write(struct comedi_device 
*dev,
trimpot_8402_write(dev, channel, value);
break;
default:
-   comedi_error(dev, driver bug?);
+   dev_err(dev-class_dev, driver bug?\n);
return -1;
}
 
@@ -1249,7 +1249,7 @@ static int cb_pcidas_ao_cmd(struct comedi_device *dev,
break;
default:
spin_unlock_irqrestore(dev-spinlock, flags);
-   comedi_error(dev, error setting dac pacer source);
+   dev_err(dev-class_dev, error setting dac pacer source\n);
return -1;
}
spin_unlock_irqrestore(dev-spinlock, flags);
@@ -1300,7 +1300,7 @@ static void handle_ao_interrupt(struct comedi_device 
*dev, unsigned int status)
if (cmd-stop_src == TRIG_NONE ||
(cmd-stop_src == TRIG_COUNT
  devpriv-ao_count)) {
-   comedi_error(dev, dac fifo underflow);
+   dev_err(dev-class_dev, dac fifo underflow\n);
async-events |= COMEDI_CB_ERROR;
}
async-events |= COMEDI_CB_EOA;
@@ -1411,8 +1411,8 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
 devpriv-control_status + INT_ADCFIFO);
spin_unlock_irqrestore(dev-spinlock, flags);
} else if (status  EOAI) {
-   comedi_error(dev,
-bug! encountered end of acquisition interrupt?);
+   dev_err(dev-class_dev,
+   bug! encountered end of acquisition interrupt?\n);
/*  clear EOA interrupt latch */
spin_lock_irqsave(dev-spinlock, flags);
outw(devpriv-adc_fifo_bits | EOAI,
@@ -1421,7 +1421,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
}
/* check for fifo overflow */
if (status  LADFUL) {
-   comedi_error(dev, fifo overflow);
+   dev_err(dev-class_dev, fifo overflow\n);
/*  clear overflow interrupt latch */
spin_lock_irqsave(dev-spinlock, flags);
outw(devpriv-adc_fifo_bits | LADFUL,
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/29] staging: comedi: das1800: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/das1800.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das1800.c 
b/drivers/staging/comedi/drivers/das1800.c
index e9c24d0..e423429 100644
--- a/drivers/staging/comedi/drivers/das1800.c
+++ b/drivers/staging/comedi/drivers/das1800.c
@@ -654,7 +654,7 @@ static void das1800_ai_handler(struct comedi_device *dev)
if (status  OVF) {
/*  clear OVF interrupt bit */
outb(CLEAR_INTR_MASK  ~OVF, dev-iobase + DAS1800_STATUS);
-   comedi_error(dev, DAS1800 FIFO overflow);
+   dev_err(dev-class_dev, FIFO overflow\n);
async-events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
cfc_handle_events(dev, s);
return;
@@ -696,7 +696,7 @@ static irqreturn_t das1800_interrupt(int irq, void *d)
unsigned int status;
 
if (!dev-attached) {
-   comedi_error(dev, premature interrupt);
+   dev_err(dev-class_dev, premature interrupt\n);
return IRQ_HANDLED;
}
 
@@ -1179,7 +1179,7 @@ static int das1800_ai_rinsn(struct comedi_device *dev,
break;
}
if (i == timeout) {
-   comedi_error(dev, timeout);
+   dev_err(dev-class_dev, timeout\n);
n = -ETIME;
goto exit;
}
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/29] staging: comedi: dt282x: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/dt282x.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index cacb4f4..5de2674 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -438,7 +438,8 @@ static void dt282x_munge(struct comedi_device *dev,
int i;
 
if (nbytes % 2)
-   comedi_error(dev, bug! odd number of bytes from dma xfer);
+   dev_err(dev-class_dev,
+   bug! odd number of bytes from dma xfer\n);
 
for (i = 0; i  nbytes / 2; i++) {
val = buf[i];
@@ -528,7 +529,7 @@ static irqreturn_t dt282x_interrupt(int irq, void *d)
int handled = 0;
 
if (!dev-attached) {
-   comedi_error(dev, spurious interrupt);
+   dev_err(dev-class_dev, spurious interrupt\n);
return IRQ_HANDLED;
}
 
@@ -544,13 +545,13 @@ static irqreturn_t dt282x_interrupt(int irq, void *d)
}
if (adcsr  DT2821_ADCSR_ADERR) {
if (devpriv-nread != 0) {
-   comedi_error(dev, A/D error);
+   dev_err(dev-class_dev, A/D error\n);
s-async-events |= COMEDI_CB_ERROR;
}
handled = 1;
}
if (dacsr  DT2821_DACSR_DAERR) {
-   comedi_error(dev, D/A error);
+   dev_err(dev-class_dev, D/A error\n);
s_ao-async-events |= COMEDI_CB_ERROR;
handled = 1;
}
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/29] staging: comedi: pcl816: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/pcl816.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c 
b/drivers/staging/comedi/drivers/pcl816.c
index eda9986..7cd5435 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -552,7 +552,7 @@ check_channel_list(struct comedi_device *dev,
 
/*  correct channel and range number check itself comedi/range.c */
if (chanlen  1) {
-   comedi_error(dev, range/channel list is empty!);
+   dev_err(dev-class_dev, range/channel list is empty!\n);
return 0;
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/29] staging: comedi: pcl818: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/pcl818.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 7d00ae6..000dbf8 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -551,7 +551,7 @@ static void pcl818_handle_eoc(struct comedi_device *dev,
unsigned int val;
 
if (pcl818_ai_eoc(dev, s, NULL, 0)) {
-   comedi_error(dev, A/D mode1/3 IRQ without DRDY!);
+   dev_err(dev-class_dev, A/D mode1/3 IRQ without DRDY!\n);
s-async-events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
return;
}
@@ -608,13 +608,14 @@ static void pcl818_handle_fifo(struct comedi_device *dev,
status = inb(dev-iobase + PCL818_FI_STATUS);
 
if (status  4) {
-   comedi_error(dev, A/D mode1/3 FIFO overflow!);
+   dev_err(dev-class_dev, A/D mode1/3 FIFO overflow!\n);
s-async-events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
return;
}
 
if (status  1) {
-   comedi_error(dev, A/D mode1/3 FIFO interrupt without data!);
+   dev_err(dev-class_dev,
+   A/D mode1/3 FIFO interrupt without data!\n);
s-async-events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
return;
}
@@ -682,7 +683,7 @@ static int check_channel_list(struct comedi_device *dev,
 
/* correct channel and range number check itself comedi/range.c */
if (n_chan  1) {
-   comedi_error(dev, range/channel list is empty!);
+   dev_err(dev-class_dev, range/channel list is empty!\n);
return 0;
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/29] staging: comedi: ni_pcidio: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/ni_pcidio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c 
b/drivers/staging/comedi/drivers/ni_pcidio.c
index ac800da..7bc4b9f 100644
--- a/drivers/staging/comedi/drivers/ni_pcidio.c
+++ b/drivers/staging/comedi/drivers/ni_pcidio.c
@@ -319,7 +319,7 @@ static int ni_pcidio_request_di_mite_channel(struct 
comedi_device *dev)
  devpriv-di_mite_ring, 1, 2);
if (devpriv-di_mite_chan == NULL) {
spin_unlock_irqrestore(devpriv-mite_channel_lock, flags);
-   comedi_error(dev, failed to reserve mite dma channel.);
+   dev_err(dev-class_dev, failed to reserve mite dma channel\n);
return -EBUSY;
}
devpriv-di_mite_chan-dir = COMEDI_INPUT;
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/29] staging: comedi: s626: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/s626.c | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/s626.c 
b/drivers/staging/comedi/drivers/s626.c
index b276ce4..b7c5d81 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -174,8 +174,8 @@ static void s626_debi_transfer(struct comedi_device *dev)
udelay(1);
}
if (i == timeout)
-   comedi_error(dev,
-   Timeout while uploading to DEBI control register.);
+   dev_err(dev-class_dev,
+   Timeout while uploading to DEBI control register\n);
 
/* Wait until DEBI transfer is done */
for (i = 0; i  timeout; i++) {
@@ -184,7 +184,7 @@ static void s626_debi_transfer(struct comedi_device *dev)
udelay(1);
}
if (i == timeout)
-   comedi_error(dev, DEBI transfer timeout.);
+   dev_err(dev-class_dev, DEBI transfer timeout\n);
 }
 
 /*
@@ -427,7 +427,7 @@ static int s626_send_dac(struct comedi_device *dev, 
uint32_t val)
ret = comedi_timeout(dev, NULL, NULL, s626_send_dac_eoc,
 s626_send_dac_wait_not_mc1_a2out);
if (ret) {
-   comedi_error(dev, DMA transfer timeout.);
+   dev_err(dev-class_dev, DMA transfer timeout\n);
return ret;
}
 
@@ -452,7 +452,8 @@ static int s626_send_dac(struct comedi_device *dev, 
uint32_t val)
ret = comedi_timeout(dev, NULL, NULL, s626_send_dac_eoc,
 s626_send_dac_wait_ssr_af2_out);
if (ret) {
-   comedi_error(dev, TSL timeout waiting for slot 1 to execute.);
+   dev_err(dev-class_dev,
+   TSL timeout waiting for slot 1 to execute\n);
return ret;
}
 
@@ -497,8 +498,8 @@ static int s626_send_dac(struct comedi_device *dev, 
uint32_t val)
ret = comedi_timeout(dev, NULL, NULL, s626_send_dac_eoc,
 s626_send_dac_wait_fb_buffer2_msb_00);
if (ret) {
-   comedi_error(dev,
-   TSL timeout waiting for slot 0 to execute.);
+   dev_err(dev-class_dev,
+   TSL timeout waiting for slot 0 to execute\n);
return ret;
}
}
@@ -522,7 +523,8 @@ static int s626_send_dac(struct comedi_device *dev, 
uint32_t val)
ret = comedi_timeout(dev, NULL, NULL, s626_send_dac_eoc,
 s626_send_dac_wait_fb_buffer2_msb_ff);
if (ret) {
-   comedi_error(dev, TSL timeout waiting for slot 0 to execute.);
+   dev_err(dev-class_dev,
+   TSL timeout waiting for slot 0 to execute\n);
return ret;
}
return 0;
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 27/29] staging: comedi: hwdrv_apci1564: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c 
b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
index 7326f3a..a1730e9 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
@@ -102,8 +102,7 @@ static int apci1564_do_config(struct comedi_device *dev,
unsigned int ul_Command = 0;
 
if ((data[0] != 0)  (data[0] != 1)) {
-   comedi_error(dev,
-   Not a valid Data !!! ,Data should be 1 or 0\n);
+   dev_err(dev-class_dev, Data should be 1 or 0\n);
return -EINVAL;
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/29] staging: comedi: das08: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/das08.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/das08.c 
b/drivers/staging/comedi/drivers/das08.c
index 6e55ba5..fcf916a 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -273,7 +273,7 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct 
comedi_subdevice *s,
else
data[n] = (1  15) - (lsb | (msb  0x7f)  8);
} else {
-   comedi_error(dev, bug! unknown ai encoding);
+   dev_err(dev-class_dev, bug! unknown ai encoding\n);
return -1;
}
}
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 16/29] staging: comedi: das16m1: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/das16m1.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das16m1.c 
b/drivers/staging/comedi/drivers/das16m1.c
index 40365b0..2e9cbec 100644
--- a/drivers/staging/comedi/drivers/das16m1.c
+++ b/drivers/staging/comedi/drivers/das16m1.c
@@ -460,7 +460,7 @@ static void das16m1_handler(struct comedi_device *dev, 
unsigned int status)
 * overrun interrupts, but we might as well try */
if (status  OVRUN) {
async-events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
-   comedi_error(dev, fifo overflow);
+   dev_err(dev-class_dev, fifo overflow\n);
}
 
cfc_handle_events(dev, s);
@@ -486,7 +486,7 @@ static irqreturn_t das16m1_interrupt(int irq, void *d)
struct comedi_device *dev = d;
 
if (!dev-attached) {
-   comedi_error(dev, premature interrupt);
+   dev_err(dev-class_dev, premature interrupt\n);
return IRQ_HANDLED;
}
/*  prevent race with comedi_poll() */
@@ -495,7 +495,7 @@ static irqreturn_t das16m1_interrupt(int irq, void *d)
status = inb(dev-iobase + DAS16M1_CS);
 
if ((status  (IRQDATA | OVRUN)) == 0) {
-   comedi_error(dev, spurious interrupt);
+   dev_err(dev-class_dev, spurious interrupt\n);
spin_unlock(dev-spinlock);
return IRQ_NONE;
}
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/29] staging: comedi: dt2814: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/dt2814.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/dt2814.c 
b/drivers/staging/comedi/drivers/dt2814.c
index 904c9f0..4d53253 100644
--- a/drivers/staging/comedi/drivers/dt2814.c
+++ b/drivers/staging/comedi/drivers/dt2814.c
@@ -209,7 +209,7 @@ static irqreturn_t dt2814_interrupt(int irq, void *d)
int data;
 
if (!dev-attached) {
-   comedi_error(dev, spurious interrupt);
+   dev_err(dev-class_dev, spurious interrupt\n);
return IRQ_HANDLED;
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 22/29] staging: comedi: adv_pci_dio: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/adv_pci_dio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci_dio.c 
b/drivers/staging/comedi/drivers/adv_pci_dio.c
index f3742cc..b8c7d914 100644
--- a/drivers/staging/comedi/drivers/adv_pci_dio.c
+++ b/drivers/staging/comedi/drivers/adv_pci_dio.c
@@ -592,7 +592,7 @@ static int pci1760_unchecked_mbxrequest(struct 
comedi_device *dev,
return 0;
}
 
-   comedi_error(dev, PCI-1760 mailbox request timeout!);
+   dev_err(dev-class_dev, PCI-1760 mailbox request timeout!\n);
return -ETIME;
 }
 
@@ -610,8 +610,8 @@ static int pci1760_mbxrequest(struct comedi_device *dev,
  unsigned char *omb, unsigned char *imb)
 {
if (omb[2] == CMD_ClearIMB2) {
-   comedi_error(dev,
-bug! this function should not be used for 
CMD_ClearIMB2 command);
+   dev_err(dev-class_dev,
+   bug! this function should not be used for 
CMD_ClearIMB2 command\n);
return -EINVAL;
}
if (inb(dev-iobase + IMB2) == omb[2]) {
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/29] staging: comedi: ni_660x: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/ni_660x.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_660x.c 
b/drivers/staging/comedi/drivers/ni_660x.c
index 673fa52..f058056 100644
--- a/drivers/staging/comedi/drivers/ni_660x.c
+++ b/drivers/staging/comedi/drivers/ni_660x.c
@@ -710,8 +710,8 @@ static int ni_660x_request_mite_channel(struct 
comedi_device *dev,
 mite_ring(devpriv, counter));
if (mite_chan == NULL) {
spin_unlock_irqrestore(devpriv-mite_channel_lock, flags);
-   comedi_error(dev,
-failed to reserve mite dma channel for counter.);
+   dev_err(dev-class_dev,
+   failed to reserve mite dma channel for counter\n);
return -EBUSY;
}
mite_chan-dir = direction;
@@ -745,8 +745,8 @@ static int ni_660x_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
 
retval = ni_660x_request_mite_channel(dev, counter, COMEDI_INPUT);
if (retval) {
-   comedi_error(dev,
-no dma channel available for use by counter);
+   dev_err(dev-class_dev,
+   no dma channel available for use by counter\n);
return retval;
}
ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/29] staging: comedi: ni_at_a2150: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/ni_at_a2150.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c 
b/drivers/staging/comedi/drivers/ni_at_a2150.c
index 465c729..86c05e3 100644
--- a/drivers/staging/comedi/drivers/ni_at_a2150.c
+++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
@@ -179,7 +179,7 @@ static irqreturn_t a2150_interrupt(int irq, void *d)
static const int sample_size = sizeof(devpriv-dma_buffer[0]);
 
if (!dev-attached) {
-   comedi_error(dev, premature interrupt);
+   dev_err(dev-class_dev, premature interrupt\n);
return IRQ_HANDLED;
}
/*  initialize async here to make sure s is not NULL */
@@ -189,18 +189,19 @@ static irqreturn_t a2150_interrupt(int irq, void *d)
status = inw(dev-iobase + STATUS_REG);
 
if ((status  INTR_BIT) == 0) {
-   comedi_error(dev, spurious interrupt);
+   dev_err(dev-class_dev, spurious interrupt\n);
return IRQ_NONE;
}
 
if (status  OVFL_BIT) {
-   comedi_error(dev, fifo overflow);
+   dev_err(dev-class_dev, fifo overflow\n);
async-events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
cfc_handle_events(dev, s);
}
 
if ((status  DMA_TC_BIT) == 0) {
-   comedi_error(dev, caught non-dma interrupt?  Aborting.);
+   dev_err(dev-class_dev,
+   caught non-dma interrupt?  Aborting.\n);
async-events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
cfc_handle_events(dev, s);
return IRQ_HANDLED;
@@ -408,8 +409,8 @@ static int a2150_ai_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
unsigned int trigger_bits;
 
if (cmd-flags  TRIG_RT) {
-   comedi_error(dev,
- dma incompatible with hard real-time interrupt 
(TRIG_RT), aborting);
+   dev_err(dev-class_dev,
+   dma incompatible with hard real-time interrupt 
(TRIG_RT), aborting\n);
return -1;
}
/*  clear fifo and reset triggering circuitry */
@@ -490,7 +491,7 @@ static int a2150_ai_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
trigger_bits |= HW_TRIG_EN;
} else if (cmd-start_src == TRIG_OTHER) {
/*  XXX add support for level/slope start trigger using 
TRIG_OTHER */
-   comedi_error(dev, you shouldn't see this?);
+   dev_err(dev-class_dev, you shouldn't see this?\n);
}
/*  send trigger config bits */
outw(trigger_bits, dev-iobase + TRIGGER_REG);
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 25/29] staging: comedi: addi_apci_3501: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/addi_apci_3501.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_3501.c 
b/drivers/staging/comedi/drivers/addi_apci_3501.c
index 49bf1fb..d9594f4 100644
--- a/drivers/staging/comedi/drivers/addi_apci_3501.c
+++ b/drivers/staging/comedi/drivers/addi_apci_3501.c
@@ -274,7 +274,7 @@ static irqreturn_t apci3501_interrupt(int irq, void *d)
 
ui_Timer_AOWatchdog = inl(dev-iobase + APCI3501_TIMER_IRQ_REG)  0x1;
if ((!ui_Timer_AOWatchdog)) {
-   comedi_error(dev, IRQ from unknown source);
+   dev_err(dev-class_dev, IRQ from unknown source\n);
return IRQ_NONE;
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/29] staging: comedi: pcl711: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/pcl711.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/pcl711.c 
b/drivers/staging/comedi/drivers/pcl711.c
index c38d97a..40f9136 100644
--- a/drivers/staging/comedi/drivers/pcl711.c
+++ b/drivers/staging/comedi/drivers/pcl711.c
@@ -206,7 +206,7 @@ static irqreturn_t pcl711_interrupt(int irq, void *d)
unsigned int data;
 
if (!dev-attached) {
-   comedi_error(dev, spurious interrupt);
+   dev_err(dev-class_dev, spurious interrupt\n);
return IRQ_HANDLED;
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/29] staging: comedi: dmm32at: remove use of comedi_error()

2014-07-17 Thread H Hartley Sweeten
The comedi_error() function is just a wrapper around dev_err() that adds
the dev-driver-driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/dmm32at.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/dmm32at.c 
b/drivers/staging/comedi/drivers/dmm32at.c
index ad7a5d5..181c344 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -491,7 +491,7 @@ static irqreturn_t dmm32at_isr(int irq, void *d)
int i;
 
if (!dev-attached) {
-   comedi_error(dev, spurious interrupt);
+   dev_err(dev-class_dev, spurious interrupt\n);
return IRQ_HANDLED;
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/5] staging: comedi: cleanup pr_{level} messages

2014-07-17 Thread H Hartley Sweeten
Where possible, convert all the pr_{level} messages to dev_{level}.

H Hartley Sweeten (5):
  staging: comedi: usbduxfast: convert pr_err() to dev_err()
  staging: comedi: usbduxfast: convert pr_warn() to dev_warn()
  staging: comedi: cb_pcidas64: remove unused pr_fmt() macro
  staging: comedi: ni_labpc: tidy up labpc_ai_scan_mode()
  staging: comedi: comedi_fops: use pr_fmt()

 drivers/staging/comedi/comedi_fops.c | 19 ++-
 drivers/staging/comedi/drivers/cb_pcidas64.c |  2 --
 drivers/staging/comedi/drivers/ni_labpc.c| 16 +---
 drivers/staging/comedi/drivers/ni_pcimio.c   |  2 +-
 drivers/staging/comedi/drivers/usbduxfast.c  |  7 +++
 5 files changed, 23 insertions(+), 23 deletions(-)

-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/5] staging: comedi: ni_labpc: tidy up labpc_ai_scan_mode()

2014-07-17 Thread H Hartley Sweeten
This function checks the cmd-chanlist to determine the scan mode
used to sample the analog inputs. All possible modes are checked
so the final pr_err() and return 0 can never be reached.

Tidy up the function a bit and remove the unreachable code.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/ni_labpc.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_labpc.c 
b/drivers/staging/comedi/drivers/ni_labpc.c
index 6fb405e..8b41813 100644
--- a/drivers/staging/comedi/drivers/ni_labpc.c
+++ b/drivers/staging/comedi/drivers/ni_labpc.c
@@ -531,24 +531,26 @@ static void labpc_adc_timing(struct comedi_device *dev, 
struct comedi_cmd *cmd,
 
 static enum scan_mode labpc_ai_scan_mode(const struct comedi_cmd *cmd)
 {
+   unsigned int chan0;
+   unsigned int chan1;
+
if (cmd-chanlist_len == 1)
return MODE_SINGLE_CHAN;
 
-   /* chanlist may be NULL during cmdtest. */
+   /* chanlist may be NULL during cmdtest */
if (cmd-chanlist == NULL)
return MODE_MULT_CHAN_UP;
 
-   if (CR_CHAN(cmd-chanlist[0]) == CR_CHAN(cmd-chanlist[1]))
-   return MODE_SINGLE_CHAN_INTERVAL;
+   chan0 = CR_CHAN(cmd-chanlist[0]);
+   chan1 = CR_CHAN(cmd-chanlist[1]);
 
-   if (CR_CHAN(cmd-chanlist[0])  CR_CHAN(cmd-chanlist[1]))
+   if (chan0  chan1)
return MODE_MULT_CHAN_UP;
 
-   if (CR_CHAN(cmd-chanlist[0])  CR_CHAN(cmd-chanlist[1]))
+   if (chan0  chan1)
return MODE_MULT_CHAN_DOWN;
 
-   pr_err(ni_labpc: bug! cannot determine AI scan mode\n);
-   return 0;
+   return MODE_SINGLE_CHAN_INTERVAL;
 }
 
 static int labpc_ai_check_chanlist(struct comedi_device *dev,
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/5] staging: comedi: usbduxfast: convert pr_warn() to dev_warn()

2014-07-17 Thread H Hartley Sweeten
Use dev_warn() to output the warning message.

Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
Cc: Ian Abbott abbo...@mev.co.uk
Cc: Greg Kroah-Hartman gr...@linuxfoundation.org
---
 drivers/staging/comedi/drivers/ni_pcimio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c 
b/drivers/staging/comedi/drivers/ni_pcimio.c
index 1532fac..a902a38 100644
--- a/drivers/staging/comedi/drivers/ni_pcimio.c
+++ b/drivers/staging/comedi/drivers/ni_pcimio.c
@@ -1183,7 +1183,7 @@ static int pcimio_auto_attach(struct comedi_device *dev,
 
ret = mite_setup(devpriv-mite);
if (ret  0) {
-   pr_warn(error setting up mite\n);
+   dev_warn(dev-class_dev, error setting up mite\n);
return ret;
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: iio: adis16203: Use devm_iio_device_register

2014-07-17 Thread Himangi Saraogi
This patch introduces the use of iio_device_register and does away with
the call to the corressponding unregister function in the probe and
remove functions of the driver respectively.

Signed-off-by: Himangi Saraogi himangi...@gmail.com
Acked-by: Julia Lawall julia.law...@lip6.fr
---
 drivers/staging/iio/accel/adis16203_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/iio/accel/adis16203_core.c 
b/drivers/staging/iio/accel/adis16203_core.c
index 409a28e..509 100644
--- a/drivers/staging/iio/accel/adis16203_core.c
+++ b/drivers/staging/iio/accel/adis16203_core.c
@@ -175,7 +175,7 @@ static int adis16203_probe(struct spi_device *spi)
if (ret)
goto error_cleanup_buffer_trigger;
 
-   ret = iio_device_register(indio_dev);
+   ret = devm_iio_device_register(spi-dev, indio_dev);
if (ret)
goto error_cleanup_buffer_trigger;
 
@@ -191,7 +191,6 @@ static int adis16203_remove(struct spi_device *spi)
struct iio_dev *indio_dev = spi_get_drvdata(spi);
struct adis *st = iio_priv(indio_dev);
 
-   iio_device_unregister(indio_dev);
adis_cleanup_buffer_and_trigger(st, indio_dev);
 
return 0;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Chris Metcalf

On 7/17/2014 7:28 AM, Chen Gang wrote:

On 07/17/2014 06:48 PM, Arnd Bergmann wrote:

AFAICT, NO_IOMEM only has a real purpose on UML these days. Could we take
a shortcut here and make COMPILE_TEST depend on !UML? Getting random stuff
to build on UML seems pointless to me and we special-case it in a number of
places already.


According to current source code, tile still has chance to choose
NO_IOMEM, for me, welcome the tile's maintainer's ideas or suggestions.


I'm not really sure.  It's true that on tile, if you don't enable PCI
support there's no other I/O memory (or I/O port) space you can use.
We pretty much always enable PCI support in our kernel, though.  I'm
kind of surprised that other architectures don't also have the model
that IOMEM requires PCI, but perhaps most architectures just don't
encode that in the Kconfig file?

My observation is just that if I remove the NO_IOMEM if !PCI from
arch/tile/Kconfig, my build fails with ioremap() undefined.  No doubt I
could work around that, but my assumption was that NO_IOMEM was exactly the
right thing to express the fact that without PCI there is no I/O memory :-)

--
Chris Metcalf, Tilera Corp.
http://www.tilera.com

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



Re: [PATCH] staging: iio: adis16203: Use devm_iio_device_register

2014-07-17 Thread Lars-Peter Clausen

On 07/17/2014 10:40 PM, Himangi Saraogi wrote:

This patch introduces the use of iio_device_register and does away with
the call to the corressponding unregister function in the probe and
remove functions of the driver respectively.

Signed-off-by: Himangi Saraogi himangi...@gmail.com
Acked-by: Julia Lawall julia.law...@lip6.fr


No, you changed the relative order in which iio_device_unregister() and 
adis_cleanup_buffer_and_trigger() are called, this opens up the way for race 
conditions. Rule of thumb: Don't convert drivers to managed functions if 
this will change the order in which functions will called on device removal.


- Lars


---
  drivers/staging/iio/accel/adis16203_core.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/iio/accel/adis16203_core.c 
b/drivers/staging/iio/accel/adis16203_core.c
index 409a28e..509 100644
--- a/drivers/staging/iio/accel/adis16203_core.c
+++ b/drivers/staging/iio/accel/adis16203_core.c
@@ -175,7 +175,7 @@ static int adis16203_probe(struct spi_device *spi)
if (ret)
goto error_cleanup_buffer_trigger;

-   ret = iio_device_register(indio_dev);
+   ret = devm_iio_device_register(spi-dev, indio_dev);
if (ret)
goto error_cleanup_buffer_trigger;

@@ -191,7 +191,6 @@ static int adis16203_remove(struct spi_device *spi)
struct iio_dev *indio_dev = spi_get_drvdata(spi);
struct adis *st = iio_priv(indio_dev);

-   iio_device_unregister(indio_dev);
adis_cleanup_buffer_and_trigger(st, indio_dev);

return 0;



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/13] staging: rtl8723au: rtl8723a_InitBeaconParameters(): Remove unused variable

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index 5c4751c..8523908 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -893,8 +893,6 @@ void SetBcnCtrlReg23a(struct rtw_adapter *padapter, u8 
SetBits, u8 ClearBits)
 
 void rtl8723a_InitBeaconParameters(struct rtw_adapter *padapter)
 {
-   struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
-
rtl8723au_write16(padapter, REG_BCN_CTRL, 0x1010);
 
/*  TODO: Remove these magic number */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/13] staging: rtl8723au: ODM_IC_11N_SERIES is always true for SupportICType

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/hal/odm.c   | 142 +++---
 drivers/staging/rtl8723au/include/odm.h   |   4 -
 drivers/staging/rtl8723au/include/odm_interface.h |  11 +-
 3 files changed, 75 insertions(+), 82 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/odm.c 
b/drivers/staging/rtl8723au/hal/odm.c
index e15ebfe..f21861e 100644
--- a/drivers/staging/rtl8723au/hal/odm.c
+++ b/drivers/staging/rtl8723au/hal/odm.c
@@ -274,18 +274,16 @@ void ODM23a_DMInit(struct dm_odm_t *pDM_Odm)
odm_DIG23aInit(pDM_Odm);
odm_RateAdaptiveMaskInit23a(pDM_Odm);
 
-   if (pDM_Odm-SupportICType  ODM_IC_11N_SERIES) {
-   odm23a_DynBBPSInit(pDM_Odm);
-   odm_DynamicTxPower23aInit(pDM_Odm);
-   odm_TXPowerTrackingInit23a(pDM_Odm);
-   ODM_EdcaTurboInit23a(pDM_Odm);
-   if ((pDM_Odm-AntDivType == CG_TRX_HW_ANTDIV)   ||
-   (pDM_Odm-AntDivType == CGCS_RX_HW_ANTDIV)  ||
-   (pDM_Odm-AntDivType == CG_TRX_SMART_ANTDIV))
-   odm_InitHybridAntDiv23a(pDM_Odm);
-   else if (pDM_Odm-AntDivType == CGCS_RX_SW_ANTDIV)
-   odm_SwAntDivInit(pDM_Odm);
-   }
+   odm23a_DynBBPSInit(pDM_Odm);
+   odm_DynamicTxPower23aInit(pDM_Odm);
+   odm_TXPowerTrackingInit23a(pDM_Odm);
+   ODM_EdcaTurboInit23a(pDM_Odm);
+   if ((pDM_Odm-AntDivType == CG_TRX_HW_ANTDIV)   ||
+   (pDM_Odm-AntDivType == CGCS_RX_HW_ANTDIV)  ||
+   (pDM_Odm-AntDivType == CG_TRX_SMART_ANTDIV))
+   odm_InitHybridAntDiv23a(pDM_Odm);
+   else if (pDM_Odm-AntDivType == CGCS_RX_SW_ANTDIV)
+   odm_SwAntDivInit(pDM_Odm);
 }
 
 /*  2011/09/20 MH This is the entry pointer for all team to execute HW out 
source DM. */
@@ -304,7 +302,7 @@ void ODM_DMWatchdog23a(struct dm_odm_t *pDM_Odm)
/* NeilChen--2012--08--24-- */
/* Fix Leave LPS issue */
if ((pDM_Odm-Adapter-pwrctrlpriv.pwr_mode != PS_MODE_ACTIVE) /*  in 
LPS mode */
-   (pDM_Odm-SupportICType  (ODM_RTL8723A))) {
+   (pDM_Odm-SupportICType  ODM_RTL8723A)) {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, 
(Step1: odm_DIG23a is in LPS mode\n));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, 
(---Step2: 8723AS is in LPS mode\n));
odm_DIG23abyRSSI_LPS(pDM_Odm);
@@ -327,10 +325,8 @@ void ODM_DMWatchdog23a(struct dm_odm_t *pDM_Odm)
else if (pDM_Odm-AntDivType == CGCS_RX_SW_ANTDIV)
odm_SwAntDivChkAntSwitch(pDM_Odm, SWAW_STEP_PEAK);
 
-   if (pDM_Odm-SupportICType  ODM_IC_11N_SERIES) {
-   ODM_TXPowerTrackingCheck23a(pDM_Odm);
- odm_EdcaTurboCheck23a(pDM_Odm);
-   }
+   ODM_TXPowerTrackingCheck23a(pDM_Odm);
+   odm_EdcaTurboCheck23a(pDM_Odm);
 
odm_dtc(pDM_Odm);
 }
@@ -551,7 +547,7 @@ void odm_CommonInfoSelfInit23a(struct dm_odm_t *pDM_Odm
 {
pDM_Odm-bCckHighPower = (bool) ODM_GetBBReg(pDM_Odm, 0x824, BIT(9));
pDM_Odm-RFPathRxEnable = (u8) ODM_GetBBReg(pDM_Odm, 0xc04, 0x0F);
-   if (pDM_Odm-SupportICType  (ODM_RTL8723A))
+   if (pDM_Odm-SupportICType  ODM_RTL8723A)
pDM_Odm-AntDivType = CGCS_RX_SW_ANTDIV;
 
ODM_InitDebugSetting23a(pDM_Odm);
@@ -655,7 +651,7 @@ void odm_DIG23abyRSSI_LPS(struct dm_odm_t *pDM_Odm)
u8 bFwCurrentInPSMode = false;
u8 CurrentIGI = pDM_Odm-RSSI_Min;
 
-   if (!(pDM_Odm-SupportICType  (ODM_RTL8723A)))
+   if (!(pDM_Odm-SupportICType  ODM_RTL8723A))
return;
 
CurrentIGI = CurrentIGI+RSSI_OFFSET_DIG;
@@ -764,7 +760,7 @@ void odm_DIG23a(struct dm_odm_t *pDM_Odm)
FirstDisConnect = (!pDM_Odm-bLinked)  
(pDM_DigTable-bMediaConnect_0);
 
/* 1 Boundary Decision */
-   if ((pDM_Odm-SupportICType  (ODM_RTL8723A)) 
+   if ((pDM_Odm-SupportICType  ODM_RTL8723A) 
((pDM_Odm-BoardType == ODM_BOARD_HIGHPWR) || pDM_Odm-ExtLNA)) {
dm_dig_max = DM_DIG_MAX_NIC_HP;
dm_dig_min = DM_DIG_MIN_NIC_HP;
@@ -777,7 +773,7 @@ void odm_DIG23a(struct dm_odm_t *pDM_Odm)
 
if (pDM_Odm-bLinked) {
  /* 2 8723A Series, offset need to be 10 */
-   if (pDM_Odm-SupportICType == (ODM_RTL8723A)) {
+   if (pDM_Odm-SupportICType == ODM_RTL8723A) {
/* 2 Upper Bound */
if ((pDM_Odm-RSSI_Min + 10)  DM_DIG_MAX_NIC)
pDM_DigTable-rx_gain_range_max = 
DM_DIG_MAX_NIC;
@@ -925,32 +921,36 @@ void odm_FalseAlarmCounterStatistics23a(struct dm_odm_t 
*pDM_Odm)
if (!(pDM_Odm-SupportAbility  ODM_BB_FA_CNT))
return;
 
-   if (pDM_Odm-SupportICType  ODM_IC_11N_SERIES) {
-   /* hold ofdm counter */
-   

[PATCH 00/13] staging: rtl8723au: Remove more code obfuscation

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Greg,

Another round of code obfuscation removal, mostly getting rid of no-op
and unncessary wrappers.

Cheers,
Jes


Jes Sorensen (12):
  staging: rtl8723au: Eliminate Set_MSR() wrapper call
  staging: rtl8723au: Reduce number of duplicate defines for link state
  staging: rtl8723au: Use rtl8723au_set_media_status() to replace
_InitNetworkType()
  staging: rtl8723au: Remove write-only variable UsbRxHighSpeedMode
  staging: rtl8723au: Remove no-op usb_AggSetting*()
  staging: rtl88723au: Remove no-op _InitOperation_mode() function
  staging: rtl8723au: Remove RegBcnCtrlVal
  staging: rtl8723au: Use proper name REG_CAMCMD and remove wrapper
invalidate_cam_all23a()
  staging: rtl8723au: rtl8723a_InitBeaconParameters(): Remove unused
variable
  staging: rtl8723au: ODM_IC_11N_SERIES is always true for SupportICType
  staging: rtl8723au: Remove unused odm_RegDefine11AC.h
  staging: rtl8723au: Remove pointless IS_STA_VALID() macro

Raphael Silva (1):
  rtl8723au: Corrections in the coding style

 drivers/staging/rtl8723au/core/rtw_ap.c|   8 +-
 drivers/staging/rtl8723au/core/rtw_mlme_ext.c  | 116 
 drivers/staging/rtl8723au/core/rtw_sreset.c|   2 +-
 drivers/staging/rtl8723au/core/rtw_sta_mgt.c   |  42 +++---
 drivers/staging/rtl8723au/core/rtw_wlan_util.c |  17 +--
 drivers/staging/rtl8723au/hal/hal_com.c|  12 +-
 drivers/staging/rtl8723au/hal/odm.c| 150 ++---
 drivers/staging/rtl8723au/hal/odm_HWConfig.c   |   2 +-
 drivers/staging/rtl8723au/hal/rtl8723a_cmd.c   |   4 +-
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c  |  34 ++---
 drivers/staging/rtl8723au/hal/usb_halinit.c|  73 +-
 drivers/staging/rtl8723au/include/hal_com.h|   2 +-
 drivers/staging/rtl8723au/include/odm.h|   8 --
 .../staging/rtl8723au/include/odm_RegDefine11AC.h  |  49 ---
 drivers/staging/rtl8723au/include/odm_interface.h  |  11 +-
 drivers/staging/rtl8723au/include/odm_precomp.h|   1 -
 drivers/staging/rtl8723au/include/rtl8723a_hal.h   |   4 -
 drivers/staging/rtl8723au/include/rtl8723a_spec.h  |  10 --
 drivers/staging/rtl8723au/include/rtw_mlme_ext.h   |  12 --
 19 files changed, 195 insertions(+), 362 deletions(-)
 delete mode 100644 drivers/staging/rtl8723au/include/odm_RegDefine11AC.h

-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/13] staging: rtl8723au: Remove no-op usb_AggSetting*()

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 50 -
 1 file changed, 50 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 227a363..4161409 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -473,55 +473,6 @@ static void _InitRetryFunction(struct rtw_adapter *Adapter)
rtl8723au_write8(Adapter, REG_ACKTO, 0x40);
 }
 
-/*-
- * Function:   usb_AggSettingTxUpdate()
- *
- * Overview:   Seperate TX/RX parameters update independent for TP
- * detection and dynamic TX/RX aggreagtion parameters update.
- *
- * Input:  struct rtw_adapter *
- *
- * Output/Return:  NONE
- *
- * Revised History:
- * WhenWho Remark
- * 12/10/2010  MHC Seperate to smaller function.
- *
- *---*/
-static void usb_AggSettingTxUpdate(struct rtw_adapter *Adapter)
-{
-}  /*  usb_AggSettingTxUpdate */
-
-/*-
- * Function:   usb_AggSettingRxUpdate()
- *
- * Overview:   Seperate TX/RX parameters update independent for TP
- * detection and dynamic TX/RX aggreagtion parameters update.
- *
- * Input:  struct rtw_adapter *
- *
- * Output/Return:  NONE
- *
- * Revised History:
- * WhenWho Remark
- * 12/10/2010  MHC Seperate to smaller function.
- *
- *---*/
-static void usb_AggSettingRxUpdate(struct rtw_adapter *Adapter)
-{
-}  /*  usb_AggSettingRxUpdate */
-
-static void InitUsbAggregationSetting(struct rtw_adapter *Adapter)
-{
-   struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
-
-   /*  Tx aggregation setting */
-   usb_AggSettingTxUpdate(Adapter);
-
-   /*  Rx aggregation setting */
-   usb_AggSettingRxUpdate(Adapter);
-}
-
 static void _InitOperationMode(struct rtw_adapter *Adapter)
 {
 }
@@ -748,7 +699,6 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter)
_InitEDCA(Adapter);
_InitRateFallback(Adapter);
_InitRetryFunction(Adapter);
-   InitUsbAggregationSetting(Adapter);
_InitOperationMode(Adapter);/* todo */
rtl8723a_InitBeaconParameters(Adapter);
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/13] staging: rtl8723au: Eliminate Set_MSR() wrapper call

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/core/rtw_ap.c  |  2 +-
 drivers/staging/rtl8723au/core/rtw_mlme_ext.c| 18 +-
 drivers/staging/rtl8723au/core/rtw_sreset.c  |  2 +-
 drivers/staging/rtl8723au/core/rtw_wlan_util.c   |  5 -
 drivers/staging/rtl8723au/include/rtw_mlme_ext.h |  2 --
 5 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c 
b/drivers/staging/rtl8723au/core/rtw_ap.c
index ab9a66e..1ee8747 100644
--- a/drivers/staging/rtl8723au/core/rtw_ap.c
+++ b/drivers/staging/rtl8723au/core/rtw_ap.c
@@ -688,7 +688,7 @@ static void start_bss_network(struct rtw_adapter *padapter, 
u8 *pbuf)
}
 
/* set MSR to AP_Mode */
-   Set_MSR23a(padapter, _HW_STATE_AP_);
+   rtl8723a_set_media_status(padapter, _HW_STATE_AP_);
 
/* Set BSSID REG */
hw_var_set_bssid(padapter, pnetwork-MacAddress);
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
index 3655ee5..44f3cd9 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
@@ -4102,7 +4102,7 @@ static void rtw_site_survey(struct rtw_adapter *padapter)
/* val8 = 0; */
 
/* config MSR */
-   Set_MSR23a(padapter, (pmlmeinfo-state  0x3));
+   rtl8723a_set_media_status(padapter, pmlmeinfo-state  0x3);
 
/* restore RX GAIN */
rtl8723a_set_initial_gain(padapter, 0xff);
@@ -4339,7 +4339,7 @@ static void start_create_ibss(struct rtw_adapter* 
padapter)
 
/* set msr to WIFI_FW_ADHOC_STATE */
pmlmeinfo-state = WIFI_FW_ADHOC_STATE;
-   Set_MSR23a(padapter, (pmlmeinfo-state  0x3));
+   rtl8723a_set_media_status(padapter, pmlmeinfo-state  0x3);
 
/* issue beacon */
if (send_beacon23a(padapter) == _FAIL)
@@ -4387,7 +4387,7 @@ static void start_clnt_join(struct rtw_adapter* padapter)
/* switch channel */
set_channel_bwmode23a(padapter, pmlmeext-cur_channel, 
pmlmeext-cur_ch_offset, pmlmeext-cur_bwmode);
 
-   Set_MSR23a(padapter, WIFI_FW_STATION_STATE);
+   rtl8723a_set_media_status(padapter, WIFI_FW_STATION_STATE);
 
val8 = (pmlmeinfo-auth_algo == dot11AuthAlgrthm_8021X) ?
0xcc: 0xcf;
@@ -4405,7 +4405,7 @@ static void start_clnt_join(struct rtw_adapter* padapter)
  msecs_to_jiffies((REAUTH_TO * REAUTH_LIMIT) + 
(REASSOC_TO*REASSOC_LIMIT) + beacon_timeout));
pmlmeinfo-state = WIFI_FW_AUTH_NULL | WIFI_FW_STATION_STATE;
} else if (caps  WLAN_CAPABILITY_IBSS) {   /* adhoc client */
-   Set_MSR23a(padapter, WIFI_FW_ADHOC_STATE);
+   rtl8723a_set_media_status(padapter, WIFI_FW_ADHOC_STATE);
 
rtl8723a_set_sec_cfg(padapter, 0xcf);
 
@@ -5185,7 +5185,7 @@ void mlmeext_sta_del_event_callback23a(struct rtw_adapter 
*padapter)
pmlmeinfo-state = WIFI_FW_NULL_STATE;
 
/* set MSR to no link state - infra. mode */
-   Set_MSR23a(padapter, _HW_STATE_STATION_);
+   rtl8723a_set_media_status(padapter, _HW_STATE_STATION_);
 
del_timer_sync(pmlmeext-link_timer);
}
@@ -5584,8 +5584,8 @@ int join_cmd_hdl23a(struct rtw_adapter *padapter, const 
u8 *pbuf)
del_timer_sync(pmlmeext-link_timer);
 
/* set MSR to nolink - infra. mode */
-   /* Set_MSR23a(padapter, _HW_STATE_NOLINK_); */
-   Set_MSR23a(padapter, _HW_STATE_STATION_);
+   /* rtl8723a_set_media_status(padapter, _HW_STATE_NOLINK_); */
+   rtl8723a_set_media_status(padapter, _HW_STATE_STATION_);
 
hw_var_set_mlme_disconnect(padapter);
}
@@ -5704,7 +5704,7 @@ int disconnect_hdl23a(struct rtw_adapter *padapter, const 
u8 *pbuf)
rtl8723a_set_bcn_func(padapter, 0); /* Stop BCN */
 
/* set MSR to no link state - infra. mode */
-   Set_MSR23a(padapter, _HW_STATE_STATION_);
+   rtl8723a_set_media_status(padapter, _HW_STATE_STATION_);
 
pmlmeinfo-state = WIFI_FW_NULL_STATE;
 
@@ -5865,7 +5865,7 @@ int sitesurvey_cmd_hdl23a(struct rtw_adapter *padapter, 
const u8 *pbuf)
rtl8723a_set_initial_gain(padapter, initialgain);
 
/* set MSR to no link state */
-   Set_MSR23a(padapter, _HW_STATE_NOLINK_);
+   rtl8723a_set_media_status(padapter, _HW_STATE_NOLINK_);
 
rtl8723a_mlme_sitesurvey(padapter, 1);
 
diff --git a/drivers/staging/rtl8723au/core/rtw_sreset.c 
b/drivers/staging/rtl8723au/core/rtw_sreset.c
index c152aef..9a79e11 100644
--- a/drivers/staging/rtl8723au/core/rtw_sreset.c
+++ 

[PATCH 05/13] staging: rtl8723au: Remove write-only variable UsbRxHighSpeedMode

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/hal/usb_halinit.c  | 3 ---
 drivers/staging/rtl8723au/include/rtl8723a_hal.h | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index d8f9f27..227a363 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -520,9 +520,6 @@ static void InitUsbAggregationSetting(struct rtw_adapter 
*Adapter)
 
/*  Rx aggregation setting */
usb_AggSettingRxUpdate(Adapter);
-
-   /*  201/12/10 MH Add for USB agg mode dynamic switch. */
-   pHalData-UsbRxHighSpeedMode = false;
 }
 
 static void _InitOperationMode(struct rtw_adapter *Adapter)
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_hal.h 
b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
index 344b708..066dc9c 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_hal.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
@@ -384,9 +384,6 @@ struct hal_data_8723a {
u8  OutEpQueueSel;
u8  OutEpNumber;
 
-   /*  2010/12/10 MH Add for USB aggreation mode dynamic shceme. */
-   boolUsbRxHighSpeedMode;
-
/*  2010/11/22 MH Add for slim combo debug mode selective. */
/*  This is used for fix the drawback of CU TSMC-A/UMC-A cut. HW auto 
suspend ability. Close BT clock. */
boolSlimComboDbg;
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/13] staging: rtl8723au: Use rtl8723au_set_media_status() to replace _InitNetworkType()

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Reduce yet another duplicate implementation of set_media_status()

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/hal/usb_halinit.c   | 13 +
 drivers/staging/rtl8723au/include/rtl8723a_spec.h |  8 
 2 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 8a7e644..d8f9f27 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -338,17 +338,6 @@ static void _InitQueuePriority(struct rtw_adapter *Adapter)
_InitNormalChipQueuePriority(Adapter);
 }
 
-static void _InitNetworkType(struct rtw_adapter *Adapter)
-{
-   u32 value32;
-
-   value32 = rtl8723au_read32(Adapter, REG_CR);
-
-   /*  TODO: use the other function to set network type */
-   value32 = (value32  ~MASK_NETTYPE) | _NETTYPE(NT_LINK_AP);
-   rtl8723au_write32(Adapter, REG_CR, value32);
-}
-
 static void _InitTransferPageSize(struct rtw_adapter *Adapter)
 {
/*  Tx page size is always 128. */
@@ -756,7 +745,7 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter)
 
_InitInterrupt(Adapter);
hw_var_set_macaddr(Adapter, Adapter-eeprompriv.mac_addr);
-   _InitNetworkType(Adapter);/* set msr */
+   rtl8723a_set_media_status(Adapter, MSR_INFRA);
_InitWMACSetting(Adapter);
_InitAdaptiveCtrl(Adapter);
_InitEDCA(Adapter);
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_spec.h 
b/drivers/staging/rtl8723au/include/rtl8723a_spec.h
index b5d7123..8d19b28 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_spec.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_spec.h
@@ -1323,14 +1323,6 @@ Current IOREG MAP
 #define ENSWBCNBIT(8)
 #define ENSEC  BIT(9)
 
-/*  Network type */
-#define _NETTYPE(x)(((x)  0x3)  16)
-#define MASK_NETTYPE   0x3
-#define NT_NO_LINK 0x0
-#define NT_LINK_AD_HOC 0x1
-#define NT_LINK_AP 0x2
-#define NT_AS_AP   0x3
-
 #define _LBMODE(x) (((x)  0xF)  24)
 #define MASK_LBMODE0xF00
 #define LOOPBACK_NORMAL0x0
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/13] staging: rtl88723au: Remove no-op _InitOperation_mode() function

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 4161409..0c760e5 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -473,10 +473,6 @@ static void _InitRetryFunction(struct rtw_adapter *Adapter)
rtl8723au_write8(Adapter, REG_ACKTO, 0x40);
 }
 
-static void _InitOperationMode(struct rtw_adapter *Adapter)
-{
-}
-
 static void _InitRFType(struct rtw_adapter *Adapter)
 {
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
@@ -699,7 +695,6 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter)
_InitEDCA(Adapter);
_InitRateFallback(Adapter);
_InitRetryFunction(Adapter);
-   _InitOperationMode(Adapter);/* todo */
rtl8723a_InitBeaconParameters(Adapter);
 
_InitHWLed(Adapter);
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/13] staging: rtl8723au: Use proper name REG_CAMCMD and remove wrapper invalidate_cam_all23a()

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/core/rtw_wlan_util.c| 7 +--
 drivers/staging/rtl8723au/hal/hal_com.c   | 8 
 drivers/staging/rtl8723au/hal/usb_halinit.c   | 2 +-
 drivers/staging/rtl8723au/include/hal_com.h   | 2 +-
 drivers/staging/rtl8723au/include/rtl8723a_spec.h | 2 --
 5 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c 
b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
index 3228c59..32f3603 100644
--- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
@@ -445,11 +445,6 @@ unsigned int decide_wait_for_beacon_timeout23a(unsigned 
int bcn_interval)
return bcn_interval  2;
 }
 
-void invalidate_cam_all23a(struct rtw_adapter *padapter)
-{
-   rtl8723a_cam_invalid_all(padapter);
-}
-
 void clear_cam_entry23a(struct rtw_adapter *padapter, u8 entry)
 {
unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
@@ -483,7 +478,7 @@ void flush_all_cam_entry23a(struct rtw_adapter *padapter)
struct mlme_ext_priv *pmlmeext = padapter-mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = pmlmeext-mlmext_info;
 
-   rtl8723a_cam_invalid_all(padapter);
+   rtl8723a_cam_invalidate_all(padapter);
 
memset(pmlmeinfo-FW_sta_info, 0, sizeof(pmlmeinfo-FW_sta_info));
 }
diff --git a/drivers/staging/rtl8723au/hal/hal_com.c 
b/drivers/staging/rtl8723au/hal/hal_com.c
index 44fc37b..8718151 100644
--- a/drivers/staging/rtl8723au/hal/hal_com.c
+++ b/drivers/staging/rtl8723au/hal/hal_com.c
@@ -669,16 +669,16 @@ void rtl8723a_cam_empty_entry(struct rtw_adapter 
*padapter, u8 ucIndex)
   (rtl8723a_cam_empty_entry(): WRITE A4: %lx \n,
   ulContent));*/
/* delay_ms(40); */
-   rtl8723au_write32(padapter, RWCAM, ulCommand);
+   rtl8723au_write32(padapter, REG_CAMCMD, ulCommand);
/* RT_TRACE(COMP_SEC, DBG_LOUD,
   (rtl8723a_cam_empty_entry(): WRITE A0: %lx \n,
   ulCommand));*/
}
 }
 
-void rtl8723a_cam_invalid_all(struct rtw_adapter *padapter)
+void rtl8723a_cam_invalidate_all(struct rtw_adapter *padapter)
 {
-   rtl8723au_write32(padapter, RWCAM, BIT(31) | BIT(30));
+   rtl8723au_write32(padapter, REG_CAMCMD, CAM_POLLINIG | BIT(30));
 }
 
 void rtl8723a_cam_write(struct rtw_adapter *padapter,
@@ -708,7 +708,7 @@ void rtl8723a_cam_write(struct rtw_adapter *padapter,
 
rtl8723au_write32(padapter, WCAMI, val);
cmd = CAM_POLLINIG | CAM_WRITE | (addr + j);
-   rtl8723au_write32(padapter, RWCAM, cmd);
+   rtl8723au_write32(padapter, REG_CAMCMD, cmd);
 
/* DBG_8723A(%s = cam write: %x, %x\n, __func__, cmd, val);*/
}
diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 0c760e5..e09329b 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -702,7 +702,7 @@ static int rtl8723au_hal_init(struct rtw_adapter *Adapter)
_BBTurnOnBlock(Adapter);
/* NicIFSetMacAddress(padapter, padapter-PermanentAddress); */
 
-   invalidate_cam_all23a(Adapter);
+   rtl8723a_cam_invalidate_all(Adapter);
 
/*  2010/12/17 MH We need to set TX power according to EFUSE content at 
first. */
PHY_SetTxPowerLevel8723A(Adapter, pHalData-CurrentChannel);
diff --git a/drivers/staging/rtl8723au/include/hal_com.h 
b/drivers/staging/rtl8723au/include/hal_com.h
index 4a161e2..6c2ca4f 100644
--- a/drivers/staging/rtl8723au/include/hal_com.h
+++ b/drivers/staging/rtl8723au/include/hal_com.h
@@ -182,7 +182,7 @@ void rtl8723a_set_slot_time(struct rtw_adapter *padapter, 
u8 slottime);
 void rtl8723a_ack_preamble(struct rtw_adapter *padapter, u8 bShortPreamble);
 void rtl8723a_set_sec_cfg(struct rtw_adapter *padapter, u8 sec);
 void rtl8723a_cam_empty_entry(struct rtw_adapter *padapter, u8 ucIndex);
-void rtl8723a_cam_invalid_all(struct rtw_adapter *padapter);
+void rtl8723a_cam_invalidate_all(struct rtw_adapter *padapter);
 void rtl8723a_cam_write(struct rtw_adapter *padapter,
u8 entry, u16 ctrl, const u8 *mac, const u8 *key);
 void rtl8723a_fifo_cleanup(struct rtw_adapter *padapter);
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_spec.h 
b/drivers/staging/rtl8723au/include/rtl8723a_spec.h
index 8d19b28..59b545b 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_spec.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_spec.h
@@ -454,8 +454,6 @@
 /*  */
 /*  9. Security Control Registers  (Offset: ) */
 /*  */
-   /* IN 8190 Data Sheet is called CAMcmd */
-#defineRWCAM   REG_CAMCMD
/*  Software write CAM input content */
 #defineWCAMI 

[PATCH 12/13] staging: rtl8723au: Remove unused odm_RegDefine11AC.h

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 .../staging/rtl8723au/include/odm_RegDefine11AC.h  | 49 --
 drivers/staging/rtl8723au/include/odm_precomp.h|  1 -
 2 files changed, 50 deletions(-)
 delete mode 100644 drivers/staging/rtl8723au/include/odm_RegDefine11AC.h

diff --git a/drivers/staging/rtl8723au/include/odm_RegDefine11AC.h 
b/drivers/staging/rtl8723au/include/odm_RegDefine11AC.h
deleted file mode 100644
index 77b7ace..000
--- a/drivers/staging/rtl8723au/include/odm_RegDefine11AC.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- *
- * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- 
**/
-
-#ifndef__ODM_REGDEFINE11AC_H__
-#define __ODM_REGDEFINE11AC_H__
-
-/* 2 RF REG LIST */
-
-
-
-/* 2 BB REG LIST */
-/* PAGE 8 */
-/* PAGE 9 */
-#defineODM_REG_OFDM_FA_RST_11AC0x9A4
-/* PAGE A */
-#defineODM_REG_CCK_CCA_11AC0xA0A
-#defineODM_REG_CCK_FA_RST_11AC 0xA2C
-#defineODM_REG_CCK_FA_11AC 0xA5C
-/* PAGE C */
-#defineODM_REG_IGI_A_11AC  0xC50
-/* PAGE E */
-#defineODM_REG_IGI_B_11AC  0xE50
-/* PAGE F */
-#defineODM_REG_OFDM_FA_11AC0xF48
-
-
-/* 2 MAC REG LIST */
-
-
-
-
-/* DIG Related */
-#defineODM_BIT_IGI_11AC0x
-
-
-
-#endif
diff --git a/drivers/staging/rtl8723au/include/odm_precomp.h 
b/drivers/staging/rtl8723au/include/odm_precomp.h
index 69de888..fb793c8 100644
--- a/drivers/staging/rtl8723au/include/odm_precomp.h
+++ b/drivers/staging/rtl8723au/include/odm_precomp.h
@@ -32,7 +32,6 @@
 #include odm.h
 #include odm_HWConfig.h
 #include odm_debug.h
-#include odm_RegDefine11AC.h
 #include odm_RegDefine11N.h
 
 #include HalDMOutSrc8723A.h /* for IQK,LCK,Power-tracking */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/13] rtl8723au: Corrections in the coding style

2014-07-17 Thread Jes . Sorensen
From: Raphael Silva rapp...@gmail.com

Some corrections were made to the code in order to conform to the
Kernel Coding Style.

Jes: Fix build problem

Signed-off-by: Raphael Silva rapp...@gmail.com
Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/core/rtw_sta_mgt.c | 42 ++--
 1 file changed, 27 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_sta_mgt.c 
b/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
index 8db844b..d17998d 100644
--- a/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723au/core/rtw_sta_mgt.c
@@ -26,7 +26,7 @@ static const u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 
0xff, 0xff};
 
 static void _rtw_init_stainfo(struct sta_info *psta)
 {
-   memset((u8 *)psta, 0, sizeof (struct sta_info));
+   memset((u8 *)psta, 0, sizeof(struct sta_info));
spin_lock_init(psta-lock);
INIT_LIST_HEAD(psta-list);
INIT_LIST_HEAD(psta-hash_list);
@@ -71,8 +71,10 @@ int _rtw_init_sta_priv23a(struct sta_priv *pstapriv)
pstapriv-auth_list_cnt = 0;
pstapriv-auth_to = 3; /*  3*2 = 6 sec */
pstapriv-assoc_to = 3;
-   /* pstapriv-expire_to = 900;  900*2 = 1800 sec = 30 min, expire after 
no any traffic. */
-   /* pstapriv-expire_to = 30;  30*2 = 60 sec = 1 min, expire after no 
any traffic. */
+   /* pstapriv-expire_to = 900;  900*2 = 1800 sec = 30 min,
+   expire after no any traffic. */
+   /* pstapriv-expire_to = 30;  30*2 = 60 sec = 1 min,
+   expire after no any traffic. */
pstapriv-expire_to = 3; /*  3*2 = 6 sec */
pstapriv-max_num_sta = NUM_STA;
 #endif
@@ -94,6 +96,7 @@ int _rtw_free_sta_priv23a(struct sta_priv *pstapriv)
 
list_for_each_safe(plist, ptmp, phead) {
int i;
+
psta = container_of(plist, struct sta_info,
hash_list);
for (i = 0; i  16 ; i++) {
@@ -144,14 +147,17 @@ rtw_alloc_stainfo23a(struct sta_priv *pstapriv, const u8 
*hwaddr, gfp_t gfp)
 
list_add_tail(psta-hash_list, phash_list);
 
-   pstapriv-asoc_sta_count ++ ;
+   pstapriv-asoc_sta_count++;
 
-/*  For the SMC router, the sequence number of first packet of WPS handshake 
will be 0. */
-/*  In this case, this packet will be dropped by recv_decache function if we 
use the 0x00 as the default value for tid_rxseq variable. */
+/*  For the SMC router, the sequence number of first packet of WPS
+ handshake will be 0. */
+/*  In this case, this packet will be dropped by recv_decache function
+if we use the 0x00 as the default value for tid_rxseq variable. */
 /*  So, we initialize the tid_rxseq variable as the 0x. */
 
for (i = 0; i  16; i++)
-   memcpy(psta-sta_recvpriv.rxcache.tid_rxseq[i], 
wRxSeqInitialValue, 2);
+   memcpy(psta-sta_recvpriv.rxcache.tid_rxseq[i],
+   wRxSeqInitialValue, 2);
 
RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_,
 (alloc number_%d stainfo  with hwaddr = %pM\n,
@@ -242,8 +248,12 @@ int rtw_free_stainfo23a(struct rtw_adapter *padapter, 
struct sta_info *psta)
spin_unlock_bh(pxmitpriv-lock);
 
list_del_init(psta-hash_list);
-   RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, (\n free number_%d 
stainfo  with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n, 
pstapriv-asoc_sta_count, psta-hwaddr[0], psta-hwaddr[1], psta-hwaddr[2], 
psta-hwaddr[3], psta-hwaddr[4], psta-hwaddr[5]));
-   pstapriv-asoc_sta_count --;
+   RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_,
+   (\n free number_%d stainfo  with hwaddr = 0x%.2x 0x%.2x 0x%.2x 
0x%.2x 0x%.2x 0x%.2x\n,
+   pstapriv-asoc_sta_count, psta-hwaddr[0],
+   psta-hwaddr[1], psta-hwaddr[2], psta-hwaddr[3],
+   psta-hwaddr[4], psta-hwaddr[5]));
+   pstapriv-asoc_sta_count--;
 
/*  re-init sta_info; 20061114  will be init in alloc_stainfo */
/* _rtw_init_sta_xmit_priv23a(psta-sta_xmitpriv); */
@@ -251,7 +261,8 @@ int rtw_free_stainfo23a(struct rtw_adapter *padapter, 
struct sta_info *psta)
 
del_timer_sync(psta-addba_retry_timer);
 
-   /* for A-MPDU Rx reordering buffer control, cancel 
reordering_ctrl_timer */
+   /* for A-MPDU Rx reordering buffer control,
+  cancel reordering_ctrl_timer */
for (i = 0; i  16; i++) {
struct list_head*phead, *plist;
struct recv_frame *prframe;
@@ -261,7 +272,8 @@ int rtw_free_stainfo23a(struct rtw_adapter *padapter, 
struct sta_info *psta)
 
del_timer_sync(preorder_ctrl-reordering_ctrl_timer);
 
-   ppending_recvframe_queue = 
preorder_ctrl-pending_recvframe_queue;
+   ppending_recvframe_queue =
+   

[PATCH 08/13] staging: rtl8723au: Remove RegBcnCtrlVal

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

The value saved in RegBcnCtrlVal was never used. In addition the code
was highly endian broken, declaring it as a u32, then accessing it via
a u8 * later.

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 18 +-
 drivers/staging/rtl8723au/include/rtl8723a_hal.h  |  1 -
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index bc9e880..5c4751c 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -882,20 +882,13 @@ void rtl8723a_read_chip_version(struct rtw_adapter 
*padapter)
 /*  */
 void SetBcnCtrlReg23a(struct rtw_adapter *padapter, u8 SetBits, u8 ClearBits)
 {
-   struct hal_data_8723a *pHalData;
-   u32 addr;
-   u8 *pRegBcnCtrlVal;
-
-   pHalData = GET_HAL_DATA(padapter);
-   pRegBcnCtrlVal = (u8 *)pHalData-RegBcnCtrlVal;
-
-   addr = REG_BCN_CTRL;
+   u8 val8;
 
-   *pRegBcnCtrlVal = rtl8723au_read8(padapter, addr);
-   *pRegBcnCtrlVal |= SetBits;
-   *pRegBcnCtrlVal = ~ClearBits;
+   val8 = rtl8723au_read8(padapter, REG_BCN_CTRL);
+   val8 |= SetBits;
+   val8 = ~ClearBits;
 
-   rtl8723au_write8(padapter, addr, *pRegBcnCtrlVal);
+   rtl8723au_write8(padapter, REG_BCN_CTRL, val8);
 }
 
 void rtl8723a_InitBeaconParameters(struct rtw_adapter *padapter)
@@ -903,7 +896,6 @@ void rtl8723a_InitBeaconParameters(struct rtw_adapter 
*padapter)
struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
 
rtl8723au_write16(padapter, REG_BCN_CTRL, 0x1010);
-   pHalData-RegBcnCtrlVal = 0x1010;
 
/*  TODO: Remove these magic number */
rtl8723au_write16(padapter, REG_TBTT_PROHIBIT, 0x6404); /*  ms */
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_hal.h 
b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
index 066dc9c..1f63eb1 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_hal.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
@@ -356,7 +356,6 @@ struct hal_data_8723a {
u8  fw_ractrl;
u8  RegTxPause;
/*  Beacon function related global variable. */
-   u32 RegBcnCtrlVal;
u8  RegFwHwTxQCtrl;
u8  RegReg542;
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/13] staging: rtl8723au: Reduce number of duplicate defines for link state

2014-07-17 Thread Jes . Sorensen
From: Jes Sorensen jes.soren...@redhat.com

We use the MSR bits to define link state anyway, so no point having an
additional two sets of defines for the same thing.

Signed-off-by: Jes Sorensen jes.soren...@redhat.com
---
 drivers/staging/rtl8723au/core/rtw_ap.c   |   8 +-
 drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 112 +++---
 drivers/staging/rtl8723au/core/rtw_wlan_util.c|   5 +-
 drivers/staging/rtl8723au/hal/hal_com.c   |   4 +-
 drivers/staging/rtl8723au/hal/rtl8723a_cmd.c  |   4 +-
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c |  14 +--
 drivers/staging/rtl8723au/include/rtw_mlme_ext.h  |  10 --
 7 files changed, 72 insertions(+), 85 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c 
b/drivers/staging/rtl8723au/core/rtw_ap.c
index 1ee8747..14c8d4e 100644
--- a/drivers/staging/rtl8723au/core/rtw_ap.c
+++ b/drivers/staging/rtl8723au/core/rtw_ap.c
@@ -52,7 +52,7 @@ void free_mlme_ap_info23a(struct rtw_adapter *padapter)
 
rtw_sta_flush23a(padapter);
 
-   pmlmeinfo-state = _HW_STATE_NOLINK_;
+   pmlmeinfo-state = MSR_NOLINK;
 
/* free_assoc_sta_resources */
rtw_free_all_stainfo23a(padapter);
@@ -688,7 +688,7 @@ static void start_bss_network(struct rtw_adapter *padapter, 
u8 *pbuf)
}
 
/* set MSR to AP_Mode */
-   rtl8723a_set_media_status(padapter, _HW_STATE_AP_);
+   rtl8723a_set_media_status(padapter, MSR_AP);
 
/* Set BSSID REG */
hw_var_set_bssid(padapter, pnetwork-MacAddress);
@@ -1703,7 +1703,7 @@ int rtw_ap_inform_ch_switch23a (struct rtw_adapter 
*padapter, u8 new_ch, u8 ch_o
struct mlme_ext_info *pmlmeinfo = pmlmeext-mlmext_info;
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
-   if ((pmlmeinfo-state0x03) != WIFI_FW_AP_STATE)
+   if ((pmlmeinfo-state0x03) != MSR_AP)
return ret;
 
DBG_8723A(%s(%s): with ch:%u, offset:%u\n, __func__,
@@ -1740,7 +1740,7 @@ int rtw_sta_flush23a(struct rtw_adapter *padapter)
 
DBG_8723A(%s(%s)\n, __func__, padapter-pnetdev-name);
 
-   if ((pmlmeinfo-state0x03) != WIFI_FW_AP_STATE)
+   if ((pmlmeinfo-state0x03) != MSR_AP)
return ret;
 
spin_lock_bh(pstapriv-asoc_list_lock);
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
index 44f3cd9..18e4d24 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
@@ -393,7 +393,7 @@ static void init_mlme_ext_priv23a_value(struct rtw_adapter* 
padapter)
pmlmeext-sitesurvey_res.bss_cnt = 0;
pmlmeext-scan_abort = false;
 
-   pmlmeinfo-state = WIFI_FW_NULL_STATE;
+   pmlmeinfo-state = MSR_NOLINK;
pmlmeinfo-reauth_count = 0;
pmlmeinfo-reassoc_count = 0;
pmlmeinfo-link_count = 0;
@@ -849,7 +849,7 @@ OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame 
*precv_frame)
return _SUCCESS;
}
 
-   if (((pmlmeinfo-state  0x03) == WIFI_FW_STATION_STATE) 
+   if (((pmlmeinfo-state  0x03) == MSR_AP) 
(pmlmeinfo-state  WIFI_FW_ASSOC_SUCCESS)) {
psta = rtw_get_stainfo23a(pstapriv, mgmt-sa);
if (psta) {
@@ -869,7 +869,7 @@ OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame 
*precv_frame)
  pkt_len, psta);
}
}
-   } else if ((pmlmeinfo-state0x03) == WIFI_FW_ADHOC_STATE) {
+   } else if ((pmlmeinfo-state0x03) == MSR_ADHOC) {
psta = rtw_get_stainfo23a(pstapriv, mgmt-sa);
if (psta) {
/* update WMM, ERP in the beacon */
@@ -925,7 +925,7 @@ OnAuth23a(struct rtw_adapter *padapter, struct recv_frame 
*precv_frame)
u16 auth_mode, seq, algorithm;
int status, len = skb-len;
 
-   if ((pmlmeinfo-state  0x03) != WIFI_FW_AP_STATE)
+   if ((pmlmeinfo-state  0x03) != MSR_AP)
return _FAIL;
 
DBG_8723A(+OnAuth23a\n);
@@ -1344,7 +1344,7 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct 
recv_frame *precv_frame)
uint pkt_len = skb-len;
int r;
 
-   if ((pmlmeinfo-state  0x03) != WIFI_FW_AP_STATE)
+   if ((pmlmeinfo-state  0x03) != MSR_AP)
return _FAIL;
 
left = pkt_len - sizeof(struct ieee80211_hdr_3addr);
@@ -1801,7 +1801,7 @@ OnAssocRsp23a(struct rtw_adapter *padapter, struct 
recv_frame *precv_frame)
status = le16_to_cpu(pmgmt-u.assoc_resp.status_code);
if (status  0) {
DBG_8723A(assoc reject, status code: %d\n, status);
-   pmlmeinfo-state = WIFI_FW_NULL_STATE;
+   pmlmeinfo-state = MSR_NOLINK;
res = -4;
goto report_assoc_result;
}
@@ -2033,7 +2033,7 @@ static int OnAction23a_back23a(struct rtw_adapter 
*padapter,
 

Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Arnd Bergmann
On Thursday 17 July 2014 16:41:14 Chris Metcalf wrote:
 On 7/17/2014 7:28 AM, Chen Gang wrote:
  On 07/17/2014 06:48 PM, Arnd Bergmann wrote:
  AFAICT, NO_IOMEM only has a real purpose on UML these days. Could we take
  a shortcut here and make COMPILE_TEST depend on !UML? Getting random stuff
  to build on UML seems pointless to me and we special-case it in a number of
  places already.
 
  According to current source code, tile still has chance to choose
  NO_IOMEM, for me, welcome the tile's maintainer's ideas or suggestions.
 
 I'm not really sure.  It's true that on tile, if you don't enable PCI
 support there's no other I/O memory (or I/O port) space you can use.
 We pretty much always enable PCI support in our kernel, though.  I'm
 kind of surprised that other architectures don't also have the model
 that IOMEM requires PCI, but perhaps most architectures just don't
 encode that in the Kconfig file?

Only s390 as far as I know. Most architectures have integrated
peripherals that use MMIO without PCI.

 My observation is just that if I remove the NO_IOMEM if !PCI from
 arch/tile/Kconfig, my build fails with ioremap() undefined.  No doubt I
 could work around that, but my assumption was that NO_IOMEM was exactly the
 right thing to express the fact that without PCI there is no I/O memory 

Your assumption is correct.

For tile by itself it would certainly be best to leave this
dependency, it makes no sense to enable IOMEM without PCI.

That doesn't solve the problem of COMPILE_TEST enabling drivers
that require IOMEM though. An easy hack for that would be to
make COMPILE_TEST depend on HAS_IOMEM, but it gets into hacky territory
there, and it's not clear if this is any better than the original patch
to provide fallbacks for ioremap and friends. Definitely simpler
though.

Arnd
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: iio: adis16203: Use devm_iio_device_register

2014-07-17 Thread Julia Lawall


On Thu, 17 Jul 2014, Lars-Peter Clausen wrote:

 On 07/17/2014 10:40 PM, Himangi Saraogi wrote:
  This patch introduces the use of iio_device_register and does away with
  the call to the corressponding unregister function in the probe and
  remove functions of the driver respectively.
  
  Signed-off-by: Himangi Saraogi himangi...@gmail.com
  Acked-by: Julia Lawall julia.law...@lip6.fr
 
 No, you changed the relative order in which iio_device_unregister() and
 adis_cleanup_buffer_and_trigger() are called, this opens up the way for race
 conditions. Rule of thumb: Don't convert drivers to managed functions if this
 will change the order in which functions will called on device removal.

Thanks for the information.  I was indeed not sure about this.

Unfortunately, removal code is not always perfectly written, and the 
operations are not always done in the right order...

julia

 - Lars
 
  ---
drivers/staging/iio/accel/adis16203_core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
  
  diff --git a/drivers/staging/iio/accel/adis16203_core.c
  b/drivers/staging/iio/accel/adis16203_core.c
  index 409a28e..509 100644
  --- a/drivers/staging/iio/accel/adis16203_core.c
  +++ b/drivers/staging/iio/accel/adis16203_core.c
  @@ -175,7 +175,7 @@ static int adis16203_probe(struct spi_device *spi)
  if (ret)
  goto error_cleanup_buffer_trigger;
  
  -   ret = iio_device_register(indio_dev);
  +   ret = devm_iio_device_register(spi-dev, indio_dev);
  if (ret)
  goto error_cleanup_buffer_trigger;
  
  @@ -191,7 +191,6 @@ static int adis16203_remove(struct spi_device *spi)
  struct iio_dev *indio_dev = spi_get_drvdata(spi);
  struct adis *st = iio_priv(indio_dev);
  
  -   iio_device_unregister(indio_dev);
  adis_cleanup_buffer_and_trigger(st, indio_dev);
  
  return 0;
  
 
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: question regarding drivers/staging/iio/adc/ad7280a.c

2014-07-17 Thread Greg Kroah-Hartman
On Thu, Jul 17, 2014 at 11:40:04PM +0530, Himangi Saraogi wrote:
 Hi,
 
 I have sent in a patch for adding devm_kasprintf https://lkml.org/lkml/2014/7/
 16/667.
 I will be updating this file and send in a patch once it is accepted. Was it
 the right thing
 to do to send the devm_kasprintf patch separately from the patch on the file 
 to
 use it for,
 because the person applying the later may not see the dependency?

Well, you should have told me there was a dependancy :)

As I'll end up taking both of these patches in the end, I'll queue your
devm_kasprintf patch up in my staging-next tree so that it will work
properly with your patch.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 1/1] [SCSI] Fix a bug in deriving the FLUSH_TIMEOUT from the basic I/O timeout

2014-07-17 Thread KY Srinivasan


 -Original Message-
 From: driverdev-devel-boun...@linuxdriverproject.org [mailto:driverdev-
 devel-boun...@linuxdriverproject.org] On Behalf Of KY Srinivasan
 Sent: Friday, June 20, 2014 2:37 PM
 To: Jens Axboe; James Bottomley; micha...@cs.wisc.edu
 Cc: linux-s...@vger.kernel.org; gre...@linuxfoundation.org;
 jasow...@redhat.com; linux-ker...@vger.kernel.org; oher...@suse.com;
 h...@infradead.org; a...@canonical.com; de...@linuxdriverproject.org
 Subject: RE: [PATCH 1/1] [SCSI] Fix a bug in deriving the FLUSH_TIMEOUT
 from the basic I/O timeout
 
 
 
  -Original Message-
  From: Jens Axboe [mailto:ax...@kernel.dk]
  Sent: Friday, June 6, 2014 11:23 AM
  To: James Bottomley; micha...@cs.wisc.edu
  Cc: linux-ker...@vger.kernel.org; h...@infradead.org;
  de...@linuxdriverproject.org; a...@canonical.com; KY Srinivasan; linux-
  s...@vger.kernel.org; oher...@suse.com; gre...@linuxfoundation.org;
  jasow...@redhat.com
  Subject: Re: [PATCH 1/1] [SCSI] Fix a bug in deriving the
  FLUSH_TIMEOUT from the basic I/O timeout
 
  On 2014-06-06 11:52, James Bottomley wrote:
   On Fri, 2014-06-06 at 12:18 -0500, Mike Christie wrote:
   On 6/5/14, 9:53 PM, KY Srinivasan wrote:
  
  
   -Original Message-
   From: Mike Christie [mailto:micha...@cs.wisc.edu]
   Sent: Thursday, June 5, 2014 6:33 PM
   To: KY Srinivasan
   Cc: James Bottomley; linux-ker...@vger.kernel.org;
   a...@canonical.com; de...@linuxdriverproject.org;
  h...@infradead.org;
   linux- s...@vger.kernel.org; oher...@suse.com;
   gre...@linuxfoundation.org; jasow...@redhat.com
   Subject: Re: [PATCH 1/1] [SCSI] Fix a bug in deriving the
   FLUSH_TIMEOUT from the basic I/O timeout
  
   On 06/04/2014 12:15 PM, KY Srinivasan wrote:
  
  
   -Original Message-
   From: James Bottomley [mailto:jbottom...@parallels.com]
   Sent: Wednesday, June 4, 2014 10:02 AM
   To: KY Srinivasan
   Cc: linux-ker...@vger.kernel.org; a...@canonical.com;
   de...@linuxdriverproject.org; h...@infradead.org; linux-
   s...@vger.kernel.org; oher...@suse.com;
   gre...@linuxfoundation.org; jasow...@redhat.com
   Subject: Re: [PATCH 1/1] [SCSI] Fix a bug in deriving the
   FLUSH_TIMEOUT from the basic I/O timeout
  
   On Wed, 2014-06-04 at 09:33 -0700, K. Y. Srinivasan wrote:
   Commit ID: 7e660100d85af860e7ad763202fff717adcdaacd added
  code
   to derive the FLUSH_TIMEOUT from the basic I/O timeout.
  However,
   this patch did not use the basic I/O timeout of the device.
   Fix this
  bug.
  
   Signed-off-by: K. Y. Srinivasan k...@microsoft.com
   ---
  drivers/scsi/sd.c |4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)
  
   diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index
   e9689d5..54150b1 100644
   --- a/drivers/scsi/sd.c
   +++ b/drivers/scsi/sd.c
   @@ -832,7 +832,9 @@ static int
  sd_setup_write_same_cmnd(struct
   scsi_device *sdp, struct request *rq)
  
  static int scsi_setup_flush_cmnd(struct scsi_device *sdp,
   struct request *rq)  {
   -   rq-timeout *= SD_FLUSH_TIMEOUT_MULTIPLIER;
   +   int timeout = sdp-request_queue-rq_timeout;
   +
   +   rq-timeout = (timeout *
  SD_FLUSH_TIMEOUT_MULTIPLIER);
  
   Could you share where you found this to be a problem?  It looks
   like a bug in block because all inbound requests being prepared
   should have a timeout set, so block would be the place to fix it.
  
   Perhaps; what I found was that the value in rq-timeout was 0
   coming into this function and thus multiplying obviously has no
 effect.
  
  
   I think you are right. We hit this problem because we are doing:
  
   scsi_request_fn - blk_peek_request - sd_prep_fn -
   scsi_setup_flush_cmnd.
  
   At this time request-timeout is zero so the multiplication does
   nothing. See how sd_setup_write_same_cmnd will set the request-
  timeout at this time.
  
   Then in scsi_request_fn we do:
  
   scsi_request_fn - blk_start_request - blk_add_timer.
  
   At this time it will set the request-timeout if something like
   req block pc users (like scsi_execute() or block/scsi_ioctl.c) or
   the write same code mentioned above have not set the timeout.
  
   I don't think this is a recent change. Prior to this commit, we
   were setting the timeout value in this function; it just happened
   to be a different constant unrelated to the I/O timeout.
  
  
   Yeah, it looks like when 7e660100d85af860e7ad763202fff717adcdaacd
   was merged we were supposed to initialize it like in your patch in this
 thread.
  
   I guess we could do your patch in this thread, or if we want the
   block layer to initialize the timeout before the prep_fn callout is
   called then we would need to have the blk-flush.c code to that when
   it sets up the request. If we do the latter, do we want the discard
   and write same code to initialize the request's timeout before the
   prep_fn callout is called too?
  
   I looked through the call chain; it seems to be intentional
   behaviour on the part of block.  Just from an mq 

Re: [PATCH] xillybus: place 'else' on same line as '}'

2014-07-17 Thread Greg Kroah-Hartman
On Sun, Jul 13, 2014 at 08:07:00PM -0700, Jeremiah Mahler wrote:
 Place 'else' on same line as closing brace '}' as per
 Documentation/CodingStyle.  Fixes 1 error found by checkpatch.pl.
 
 Signed-off-by: Jeremiah Mahler jmmah...@gmail.com
 ---
  drivers/staging/xillybus/xillybus_core.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

Sorry, someone else sent this patch, which I applied already.  They did
so after you, but I missed this one as you didn't have the 'staging'
line on the Subject, my fault.

Sorry about that.

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Chen Gang
On 07/18/2014 05:05 AM, Arnd Bergmann wrote:
 On Thursday 17 July 2014 16:41:14 Chris Metcalf wrote:
 On 7/17/2014 7:28 AM, Chen Gang wrote:
 On 07/17/2014 06:48 PM, Arnd Bergmann wrote:
 AFAICT, NO_IOMEM only has a real purpose on UML these days. Could we take
 a shortcut here and make COMPILE_TEST depend on !UML? Getting random stuff
 to build on UML seems pointless to me and we special-case it in a number of
 places already.

 According to current source code, tile still has chance to choose
 NO_IOMEM, for me, welcome the tile's maintainer's ideas or suggestions.

 I'm not really sure.  It's true that on tile, if you don't enable PCI
 support there's no other I/O memory (or I/O port) space you can use.
 We pretty much always enable PCI support in our kernel, though.  I'm
 kind of surprised that other architectures don't also have the model
 that IOMEM requires PCI, but perhaps most architectures just don't
 encode that in the Kconfig file?
 
 Only s390 as far as I know. Most architectures have integrated
 peripherals that use MMIO without PCI.
 
 My observation is just that if I remove the NO_IOMEM if !PCI from
 arch/tile/Kconfig, my build fails with ioremap() undefined.  No doubt I
 could work around that, but my assumption was that NO_IOMEM was exactly the
 right thing to express the fact that without PCI there is no I/O memory 
 
 Your assumption is correct.
 
 For tile by itself it would certainly be best to leave this
 dependency, it makes no sense to enable IOMEM without PCI.
 
 That doesn't solve the problem of COMPILE_TEST enabling drivers
 that require IOMEM though. An easy hack for that would be to
 make COMPILE_TEST depend on HAS_IOMEM, but it gets into hacky territory
 there, and it's not clear if this is any better than the original patch
 to provide fallbacks for ioremap and friends. Definitely simpler
 though.
 

OK, thank all of you, tile just likes most of architectures to support
IOMEM, and at present, we can focus score and uml only.

Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource'

2014-07-17 Thread Chen Gang

On 07/18/2014 02:09 AM, Richard Weinberger wrote:
 Am 17.07.2014 12:48, schrieb Arnd Bergmann:
 AFAICT, NO_IOMEM only has a real purpose on UML these days. Could we take
 a shortcut here and make COMPILE_TEST depend on !UML? Getting random stuff
 to build on UML seems pointless to me and we special-case it in a number of
 places already.
 
 If UML is the only arch without io memory the dependency on !UML seems
 reasonable to me. :-)
 

For me, if only uml left, I suggest to implement dummy functions within
uml instead of let CONFIG_UML appear in generic include directory. And
then remove all HAS_IOMEM and NO_IOMEM from kernel.

If score sticks to NO_IOMEM, and can not remove score from kernel only
because of this reason. I also suggest implement dummy functions within
score itself.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 1/1] [SCSI] Fix a bug in deriving the FLUSH_TIMEOUT from the basic I/O timeout

2014-07-17 Thread Elliott, Robert (Server Storage)
In sd_sync_cache:
rq-timeout *= SD_FLUSH_TIMEOUT_MULTIPLIER;

Regardless of the baseline for the multiplication, a magic 
number of 2 is too arbitrary.  That might work for an
individual drive, but could be far too short for a RAID
controller that runs into worst case error handling for
the drives to which it is flushing (e.g., if its cache
is volatile and the drives all have recoverable errors
during writes).  That time goes up with a bigger cache and 
with more fragmented write data in the cache requiring
more individual WRITE commands.

A better value would be the Recommended Command Timeout field 
value reported in the REPORT SUPPORTED OPERATION CODES command,
if reported by the device server.  That is supposed to account
for the worst case.

For cases where that is not reported, exposing the multiplier
in sysfs would let the timeout for simple devices be set to
smaller values than complex devices.

Also, in both sd_setup_flush_cmnd and sd_sync_cache:
  cmd-cmnd[0] = SYNCHRONIZE_CACHE;
  cmd-cmd_len = 10;

SYNCHRONIZE CACHE (16) should be favored over SYNCHRONIZE 
CACHE (10) unless SYNCHRONIZE CACHE (10) is not supported.

---
Rob ElliottHP Server Storage



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/5] staging: comedi: cleanup pr_{level} messages

2014-07-17 Thread Greg KH
On Thu, Jul 17, 2014 at 12:27:27PM -0700, H Hartley Sweeten wrote:
 Where possible, convert all the pr_{level} messages to dev_{level}.
 
 H Hartley Sweeten (5):
   staging: comedi: usbduxfast: convert pr_err() to dev_err()
   staging: comedi: usbduxfast: convert pr_warn() to dev_warn()
   staging: comedi: cb_pcidas64: remove unused pr_fmt() macro
   staging: comedi: ni_labpc: tidy up labpc_ai_scan_mode()
   staging: comedi: comedi_fops: use pr_fmt()

Thanks for doing this cleanup, and the previous one as well, now
applied.

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/1] Staging: adl_pci9118: a style issue fixed

2014-07-17 Thread Greg KH
On Thu, Jul 17, 2014 at 01:26:23AM +0300, Sam Asadi wrote:
 a 'quoted string split across lines' fixed while better use of
 English applied to the text.
 
 Signed-off-by: Sam Asadi asadi.sam...@gmail.com
 ---
  drivers/staging/comedi/drivers/adl_pci9118.c |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c 
 b/drivers/staging/comedi/drivers/adl_pci9118.c
 index 93bd9ee..7365f31 100644
 --- a/drivers/staging/comedi/drivers/adl_pci9118.c
 +++ b/drivers/staging/comedi/drivers/adl_pci9118.c
 @@ -418,8 +418,7 @@ static int check_channel_list(struct comedi_device *dev,
   if ((CR_RANGE(chanlist[i])  PCI9118_BIPOLAR_RANGES) !=
   (bipolar)) {
   comedi_error(dev,
 -  Bipolar and unipolar ranges 
 - can't be mixtured!);
 +  Bipolar and unipolar ranges can't 
 be mixed!);
   return 0;
   }
   if (!devpriv-usemux  differencial 
 -- 
 1.7.10.4

This patch doesn't apply to my tree due to other changes in this same
file.  Can you please refresh it and resend?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: gdm724x: gdm_lte.c: fix missing blank line after variable declaration

2014-07-17 Thread Greg KH
On Thu, Jul 17, 2014 at 09:30:38AM +0530, Kiran Padwal wrote:
 Checkpatch fix - Add missing blank line after variable declaration
 
 Signed-off-by: Kiran Padwal kiran.padwa...@gmail.com
 ---
  drivers/staging/gdm724x/gdm_lte.c |2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/drivers/staging/gdm724x/gdm_lte.c 
 b/drivers/staging/gdm724x/gdm_lte.c
 index 64c55b9..bc6d574 100644
 --- a/drivers/staging/gdm724x/gdm_lte.c
 +++ b/drivers/staging/gdm724x/gdm_lte.c
 @@ -447,6 +447,7 @@ static int gdm_lte_tx(struct sk_buff *skb, struct 
 net_device *dev)
*/
   if (nic_type  NIC_TYPE_F_VLAN) {
   struct vlan_ethhdr *vlan_eth = (struct vlan_ethhdr *)skb-data;
 +
   nic-vlan_id = ntohs(vlan_eth-h_vlan_TCI)  VLAN_VID_MASK;
   data_buf = skb-data + (VLAN_ETH_HLEN - ETH_HLEN);
   data_len = skb-len - (VLAN_ETH_HLEN - ETH_HLEN);
 @@ -505,6 +506,7 @@ static int gdm_lte_tx(struct sk_buff *skb, struct 
 net_device *dev)
  static struct net_device_stats *gdm_lte_stats(struct net_device *dev)
  {
   struct nic *nic = netdev_priv(dev);
 +
   return nic-stats;
  }
  

Someone else sent me this same patch back in May, and it's in my tree.
Please always work against linux-next, or my staging-next branch of my
staging.git tree if you want to send me patches like this.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgap: introduce dgap_cleanup_nodes()

2014-07-17 Thread DaeSeok Youn
Hi, Mark.

Thanks for testing.

I am trying to solve this problem with config sample which is sent by you.

regards,
Daeseok Youn.

2014-07-17 22:27 GMT+09:00 Mark Hounschell ma...@compro.net:
 On 07/16/2014 09:35 PM, Daeseok Youn wrote:
 When a configration file is parsed with dgap_parsefile(),
 makes nodes for saving configrations for board.

 Making a node will allocate node memory and strings for saving
 configrations with kstrdup().

 So these are freed when dgap is unloaded or failed to initialize.

 Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
 ---
 Mark, please review this patch.
 Thanks.

   drivers/staging/dgap/dgap.c |   47 
 +++
   1 files changed, 47 insertions(+), 0 deletions(-)

 diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
 index 06c55cb..e9df2ea 100644
 --- a/drivers/staging/dgap/dgap.c
 +++ b/drivers/staging/dgap/dgap.c
 @@ -201,6 +201,7 @@ static int dgap_test_fep(struct board_t *brd);
   static int dgap_tty_register_ports(struct board_t *brd);
   static int dgap_firmware_load(struct pci_dev *pdev, int card_type,
 struct board_t *brd);
 +static void dgap_cleanup_nodes(void);

   static void dgap_cleanup_module(void);

 @@ -619,6 +620,7 @@ unregister_tty:
   free_flipbuf:
   dgap_free_flipbuf(brd);
   cleanup_brd:
 + dgap_cleanup_nodes();
   dgap_release_remap(brd);
   kfree(brd);

 @@ -659,6 +661,8 @@ static void dgap_cleanup_module(void)
   dgap_cleanup_board(dgap_board[i]);
   }

 + dgap_cleanup_nodes();
 +
   if (dgap_numboards)
   pci_unregister_driver(dgap_driver);
   }
 @@ -6323,6 +6327,49 @@ static void dgap_remove_tty_sysfs(struct device *c)
   sysfs_remove_group(c-kobj, dgap_tty_attribute_group);
   }

 +static void dgap_cleanup_nodes(void)
 +{
 + struct cnode *p;
 +
 + p = dgap_head;
 +
 + while (p) {
 + struct cnode *tmp = p-next;
 +
 + switch (p-type) {
 + case BNODE:
 + kfree(p-u.board.portstr);
 + kfree(p-u.board.addrstr);
 + kfree(p-u.board.pcibusstr);
 + kfree(p-u.board.pcislotstr);
 + kfree(p-u.board.method);
 + break;
 + case CNODE:
 + kfree(p-u.conc.id);
 + kfree(p-u.conc.connect);
 + break;
 + case MNODE:
 + kfree(p-u.module.id);
 + break;
 + case TNODE:
 + kfree(p-u.ttyname);
 + break;
 + case CUNODE:
 + kfree(p-u.cuname);
 + break;
 + case LNODE:
 + kfree(p-u.line.cable);
 + break;
 + case PNODE:
 + kfree(p-u.printname);
 + break;
 + }
 +
 + kfree(p-u.board.status);
 + kfree(p);
 + p = tmp;
 + }
 +}
   /*
* Parse a configuration file read into memory as a string.
*/


 I get a kernel oops when unloading the driver with this patch.

 2014-07-17T09:22:12.666987-04:00 harley kernel: [60216.979134] task: 
 8801037846b0 ti: 880149256000 task.ti: 880149256000
 2014-07-17T09:22:12.666988-04:00 harley kernel: [60216.979136] RIP: 
 0010:[8034d5ff]  [8034d5ff] kfree+0x17f/0x190
 2014-07-17T09:22:12.666989-04:00 harley kernel: [60216.979143] RSP: 
 0018:880149257e78  EFLAGS: 00010246
 2014-07-17T09:22:12.666991-04:00 harley kernel: [60216.979144] RAX: 
 40080068 RBX: a0428d20 RCX: 038eb895
 2014-07-17T09:22:12.666992-04:00 harley kernel: [60216.979146] RDX: 
 40080068 RSI: ea0004131e00 RDI: a0428d20
 2014-07-17T09:22:12.666993-04:00 harley kernel: [60216.979147] RBP: 
 880149257e90 R08: 00015b60 R09: 88014fd55b60
 2014-07-17T09:22:12.666994-04:00 harley kernel: [60216.979149] R10: 
 ea810a00 R11: a0424ffd R12: 88005a3d2a80
 2014-07-17T09:22:12.666995-04:00 harley kernel: [60216.979150] R13: 
 a041c155 R14: 0002 R15: 0bc0
 2014-07-17T09:22:12.666996-04:00 harley kernel: [60216.979152] FS:  
 7fb7d51d2700() GS:88014fd4() knlGS:
 2014-07-17T09:22:12.666997-04:00 harley kernel: [60216.979154] CS:  0010 DS: 
  ES:  CR0: 8005003b
 2014-07-17T09:22:12.666998-04:00 harley kernel: [60216.979155] CR2: 
 7fe66ee4e000 CR3: 0001497af000 CR4: 000407e0
 2014-07-17T09:22:12.666999-04:00 harley kernel: [60216.979156] Stack:
 2014-07-17T09:22:12.667000-04:00 harley kernel: [60216.979157]  
 a0428d20 88005a3d2a80 8801259dd330 880149257eb0
 2014-07-17T09:22:12.667001-04:00 harley kernel: [60216.979161]  
 a041c155 0700 8801259dd000 

  1   2   >