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 6/8 V2] staging: dgap: remove unneeded dgap_err()

2014-07-16 Thread DaeSeok Youn
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.


 thanks,

 greg k-h
___
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-16 Thread Mark Hounschell

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

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?


Also, there is a userland utility (dpa) that is used to set some 
parameters of the card. Sort of like stty except it is for special 
things that the kernel does not directly support. Like special baud 
rates and such. I'm not sure what to do about that one. I personally 
have never used these special things but I'm sure they are used by 
someone somewhere?? I saw some code removed related to dpa recently. 
This came to mind.


Regards
Mark






___
devel mailing list
de...@linuxdriverproject.org

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

2014-07-16 Thread Greg KH
On Wed, Jul 16, 2014 at 06:26:17PM +0900, 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.

For now keep the parsing code, and find a device to use, there should be
one somewhere, as it is a driver :)

thanks,

greg k-h
___
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-16 Thread DaeSeok Youn
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. Is it possible to call dgap_firmware_load after init? It
means dgap_firmware_load() calls by
ioctl in user-land application with configuration data about board. If
it has parameter for initialize this module, then use module param.

Just my opinion. 

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

2014-07-16 Thread DaeSeok Youn
2014-07-17 3:47 GMT+09:00 Greg KH gre...@linuxfoundation.org:
 On Wed, Jul 16, 2014 at 06:26:17PM +0900, 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.

 For now keep the parsing code, and find a device to use, there should be
 one somewhere, as it is a driver :)
OK. find a device to use for dev_*() and makes a patch for this.

thanks.

regards,
Daeseok Youn.

 thanks,

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


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

2014-07-15 Thread Daeseok Youn
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);
 
return brd;
@@ -875,7 +876,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int 
card_type,
ret = request_firmware(fw, fw_info[card_type].conf_name,
 pdev-dev);
if (ret) {
-   pr_err(dgap: config file %s not found\n,
+   pr_err(config file %s not found\n,
fw_info[card_type].conf_name);
return ret;
}
@@ -920,7 +921,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int 
card_type,
dgap_find_config(PAPORT4, brd-pci_bus, brd-pci_slot);
 
if (!brd-bd_config) {
-   pr_err(dgap: No valid configuration found\n);
+   pr_err(No valid configuration found\n);
return -EINVAL;
}
 
@@ -928,7 +929,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int 
card_type,
ret = request_firmware(fw, fw_info[card_type].bios_name,
pdev-dev);
if (ret) {
-   pr_err(dgap: bios file %s not found\n,
+   pr_err(bios file %s not found\n,
fw_info[card_type].bios_name);
return ret;
}
@@ -945,7 +946,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int 
card_type,
ret = request_firmware(fw, fw_info[card_type].fep_name,
pdev-dev);
if (ret) {
-   pr_err(dgap: fep file %s not found\n,
+   pr_err(fep file %s not found\n,
fw_info[card_type].fep_name);
return ret;
}
@@ -974,7 +975,7 @@ static int dgap_firmware_load(struct pci_dev *pdev, int 
card_type,
ret = request_firmware(fw, fw_info[card_type].con_name,
pdev-dev);
if (ret) {
-   pr_err(dgap: conc file %s not found\n,
+   pr_err(conc file %s not found\n,
fw_info[card_type].con_name);
return ret;
}
@@ -1379,17 +1380,17 @@ static int dgap_tty_init(struct board_t *brd)
 
if (true_count != brd-nasync) {
if ((brd-type == PPCM)  (true_count == 64)) {
-   pr_warn(dgap: %s configured for %d ports, has %d 
ports.\n,
+   pr_warn(%s configured for %d ports, has %d ports.\n,
brd-name, brd-nasync, true_count);
-   pr_warn(dgap: Please make SURE the EBI cable running 
from the card\n);
-   pr_warn(dgap: to each EM module is plugged into EBI 
IN!\n);
+   pr_warn(Please make SURE the EBI cable running from 
the card\n);
+   pr_warn(to each EM module is plugged into EBI IN!\n);
} else if ((brd-type == PPCM)  (true_count == 0)) {
-   pr_warn(dgap: %s configured for %d ports, has %d 
ports.\n,
+   pr_warn(%s configured for %d ports, has %d ports.\n,
brd-name, brd-nasync, true_count);
-   pr_warn(dgap: Please make SURE the EBI cable running 
from the card\n);
-   

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

2014-07-15 Thread Greg KH
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.

thanks,

greg k-h
___
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-15 Thread DaeSeok Youn
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

Thanks.

regards,
Daeseok Youn

 thanks,

 greg k-h
___
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-15 Thread Greg KH
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.

thanks,

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