Re: [PATCH 02/06] staging: dgap: Only read config file dgap.conf once

2014-04-15 Thread Dan Carpenter
On Mon, Apr 14, 2014 at 03:17:19PM -0400, Mark Hounschell wrote:
 On 04/14/2014 11:49 AM, Greg Kroah-Hartman wrote:
  On Tue, Mar 25, 2014 at 04:38:14PM -0400, Mark Hounschell wrote:
  The config file is currently read for each board found.
  It only needs to be read one time. The buffer it is read
  into can now be freed immediately after it is parsed
  instead of at driver unload time.
 
  Signed-off-by: Mark Hounschell ma...@compro.net
  ---
   drivers/staging/dgap/dgap.c | 18 +-
   1 file changed, 9 insertions(+), 9 deletions(-)
  
  Kernel drivers shouldn't be reading config files in the first place :)
  
  But I'll take this for now, as it does fix the code up.
  
 
 Ya, I know. I'm just not sure how to work around that yet.
 

You're probably going to have different solutions for different bits.
For example, can we auto detect the board type?  If so then remove that
chunk from the config file.  We'll have to have a struct somewhere with
the number of ports each type has.  Some things may have to be module
init options and somethings maybe we can configure with the tty ioctls
and some things through sysfs.

Creating your own driver specific api is bad so always prefer shared
infrastructure over, for example, doing your own thing in sysfs.

regards,
dan carpenter

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


Re: [PATCH 02/06] staging: dgap: Only read config file dgap.conf once

2014-04-15 Thread Mark Hounschell
On 04/15/2014 06:01 AM, Dan Carpenter wrote:
 On Mon, Apr 14, 2014 at 03:17:19PM -0400, Mark Hounschell wrote:
 On 04/14/2014 11:49 AM, Greg Kroah-Hartman wrote:
 On Tue, Mar 25, 2014 at 04:38:14PM -0400, Mark Hounschell wrote:
 The config file is currently read for each board found.
 It only needs to be read one time. The buffer it is read
 into can now be freed immediately after it is parsed
 instead of at driver unload time.

 Signed-off-by: Mark Hounschell ma...@compro.net
 ---
  drivers/staging/dgap/dgap.c | 18 +-
  1 file changed, 9 insertions(+), 9 deletions(-)

 Kernel drivers shouldn't be reading config files in the first place :)

 But I'll take this for now, as it does fix the code up.


 Ya, I know. I'm just not sure how to work around that yet.

 
 You're probably going to have different solutions for different bits.
 For example, can we auto detect the board type?  If so then remove that
 chunk from the config file.  We'll have to have a struct somewhere with
 the number of ports each type has.  Some things may have to be module
 init options and somethings maybe we can configure with the tty ioctls
 and some things through sysfs.
 
 Creating your own driver specific api is bad so always prefer shared
 infrastructure over, for example, doing your own thing in sysfs.
 

Understood. This driver supports many boards that I do not have access
to.  Some of the other boards support external port expanders that allow
external control of the port configuration. These boards also require
different concentrator firmware depending on what external port
configuration you have connected.

In any case, I'm not quite ready to dive into all that just yet. There
are still lots of little things to do. Probably a lot more than I know of.

Regards
Mark

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


Re: [PATCH 02/06] staging: dgap: Only read config file dgap.conf once

2014-04-14 Thread Greg Kroah-Hartman
On Tue, Mar 25, 2014 at 04:38:14PM -0400, Mark Hounschell wrote:
 The config file is currently read for each board found.
 It only needs to be read one time. The buffer it is read
 into can now be freed immediately after it is parsed
 instead of at driver unload time.
 
 Signed-off-by: Mark Hounschell ma...@compro.net
 ---
  drivers/staging/dgap/dgap.c | 18 +-
  1 file changed, 9 insertions(+), 9 deletions(-)

Kernel drivers shouldn't be reading config files in the first place :)

But I'll take this for now, as it does fix the code up.

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


Re: [PATCH 02/06] staging: dgap: Only read config file dgap.conf once

2014-04-14 Thread Mark Hounschell
On 04/14/2014 11:49 AM, Greg Kroah-Hartman wrote:
 On Tue, Mar 25, 2014 at 04:38:14PM -0400, Mark Hounschell wrote:
 The config file is currently read for each board found.
 It only needs to be read one time. The buffer it is read
 into can now be freed immediately after it is parsed
 instead of at driver unload time.

 Signed-off-by: Mark Hounschell ma...@compro.net
 ---
  drivers/staging/dgap/dgap.c | 18 +-
  1 file changed, 9 insertions(+), 9 deletions(-)
 
 Kernel drivers shouldn't be reading config files in the first place :)
 
 But I'll take this for now, as it does fix the code up.
 

Ya, I know. I'm just not sure how to work around that yet.

Thanks
Mark

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