Re: hello

2013-11-26 Thread Zhang Xiaoguang
I have an important message for you which is of mutual benefit to us . Let me 
know if you get this email.

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


Re: [PATCH] staging: dwc2: set up all module params

2013-11-26 Thread Andre Heider
On Mon, Nov 25, 2013 at 10:02:30PM -0700, Stephen Warren wrote:
> The DWC2 USB controller in the BCM2835 (Raspberry Pi) needs some non-
> default parameters. Select these based on the compatible value from the
> DT node. For all other HW, fall back to the default parameters currently
> in use.
> 
> The values in params_bcm2835[] were posted to the mailing list by Paul
> quite some time ago. I made a couple of minor modifications since then;
> to set ahbcfg instead of ahb_single, and to set uframe_sched.
> 
> Signed-off-by: Stephen Warren 
> ---
>  Documentation/devicetree/bindings/staging/dwc2.txt |4 +-
>  drivers/staging/dwc2/platform.c|   56 
> 
>  2 files changed, 50 insertions(+), 10 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/staging/dwc2.txt 
> b/Documentation/devicetree/bindings/staging/dwc2.txt
> index 1a1b7cf..8b60e90 100644
> --- a/Documentation/devicetree/bindings/staging/dwc2.txt
> +++ b/Documentation/devicetree/bindings/staging/dwc2.txt
> @@ -2,7 +2,9 @@ Platform DesignWare HS OTG USB 2.0 controller
>  -
>  
>  Required properties:
> -- compatible : "snps,dwc2"
> +- compatible : One of:
> +  - brcm,bcm2835-usb: The DWC2 USB controller instance in the BCM2835 SoC.
> +  - snps,dwc2: A generic DWC2 USB controller with default parameters.
>  - reg : Should contain 1 register range (address and length)
>  - interrupts : Should contain 1 interrupt
>  
> diff --git a/drivers/staging/dwc2/platform.c b/drivers/staging/dwc2/platform.c
> index 4d9fac0..20586dc 100644
> --- a/drivers/staging/dwc2/platform.c
> +++ b/drivers/staging/dwc2/platform.c
> @@ -39,6 +39,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  #include "core.h"
> @@ -46,6 +47,33 @@
>  
>  static const char dwc2_driver_name[] = "dwc2";
>  
> +static const struct dwc2_core_params params_bcm2835 = {
> + .otg_cap= 0,/* HNP/SRP capable */
> + .otg_ver= 0,/* 1.3 */
> + .dma_enable = 1,
> + .dma_desc_enable= 0,
> + .speed  = 0,/* High Speed */
> + .enable_dynamic_fifo= 1,
> + .en_multiple_tx_fifo= 1,
> + .host_rx_fifo_size  = 774,  /* 774 DWORDs */
> + .host_nperio_tx_fifo_size   = 256,  /* 256 DWORDs */
> + .host_perio_tx_fifo_size= 512,  /* 512 DWORDs */
> + .max_transfer_size  = 65535,
> + .max_packet_count   = 511,
> + .host_channels  = 8,
> + .phy_type   = 1,/* UTMI */
> + .phy_utmi_width = 8,/* 8 bits */
> + .phy_ulpi_ddr   = 0,/* Single */
> + .phy_ulpi_ext_vbus  = 0,
> + .i2c_enable = 0,
> + .ulpi_fs_ls = 0,
> + .host_support_fs_ls_low_power   = 0,
> + .host_ls_low_power_phy_clk  = 0,/* 48 MHz */
> + .ts_dline   = 0,
> + .reload_ctl = 0,
> + .ahbcfg = 0x10,
> +};
> +
>  /**
>   * dwc2_driver_remove() - Called when the DWC_otg core is unregistered with 
> the
>   * DWC_otg driver
> @@ -66,6 +94,13 @@ static int dwc2_driver_remove(struct platform_device *dev)
>   return 0;
>  }
>  
> +static const struct of_device_id dwc2_of_match_table[] = {
> + { .compatible = "brcm,bcm2835-usb", .data = ¶ms_bcm2835 },
> + { .compatible = "snps,dwc2", .data = NULL },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, dwc2_of_match_table);
> +
>  /**
>   * dwc2_driver_probe() - Called when the DWC_otg core is bound to the DWC_otg
>   * driver
> @@ -80,14 +115,23 @@ static int dwc2_driver_remove(struct platform_device 
> *dev)
>   */
>  static int dwc2_driver_probe(struct platform_device *dev)
>  {
> + const struct of_device_id *match;
> + const struct dwc2_core_params *params;
> + struct dwc2_core_params defparams;
>   struct dwc2_hsotg *hsotg;
>   struct resource *res;
>   int retval;
>   int irq;
> - struct dwc2_core_params params;
> +
> + match = of_match_device(dwc2_of_match_table, &dev->dev);
> + if (match)
> + params = match->data;
> + else {
> + dwc2_set_all_params(&defparams, -1);
> + params = &defparams;
> + }

If that matches "snps,dwc2", params will be NULL instead of the default set, 
which I guess was not your intention?

>  
>   /* Default all params to autodetect */
> - dwc2_set_all_params(¶ms, -1);

The comment can be moved too.

>  
>   hsotg = devm_kzalloc(&dev->dev, sizeof(*hsotg), GFP_KERNEL);
>   if (!hsotg)
> @@ -118,7 +162,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
>   dev_dbg(&dev->dev, "mapped PA %08lx to VA %p\n",
>   (unsigned long)res->start, hsotg->regs);
>  
> - 

Re: [PATCH 0/2] staging: as102: Cleanups for the as102 driver

2013-11-26 Thread Mauro Dreissig
On 11/25/2013 10:06 PM, Greg Kroah-Hartman wrote:
> On Mon, Nov 25, 2013 at 05:10:51PM -0500, Mauro Dreissig wrote:
>> The first patch cleans sparse warnings and the second one removes
>> useless code.
>>
>> Mauro Dreissig (2):
>>   staging: as102: Declare local variables as static
>>   staging: as102: Remove ENTER/LEAVE debugging macros
> 
> I've acked these, but they can't go through my tree, they need to go
> through Mauro's tree.
> 
> Also, please use scripts/getmaintainer.pl to figure out the proper
> people to cc: and lists, you forgot the media one which is needed for
> these types of patches.
> 
> thanks,
> 
> greg k-h
> 
I will send them again, thanks Greg!

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


[PATCH 0/2] staging: as102: Cleanups for the as102 driver

2013-11-26 Thread Mauro Dreissig
The first patch cleans sparse warnings and the second one removes
useless code.

Mauro Dreissig (2):
  staging: as102: Declare local variables as static
  staging: as102: Remove ENTER/LEAVE debugging macros

 drivers/staging/media/as102/as102_drv.c| 10 --
 drivers/staging/media/as102/as102_drv.h|  8 
 drivers/staging/media/as102/as102_fe.c | 26 -
 drivers/staging/media/as102/as102_fw.c | 16 +--
 drivers/staging/media/as102/as102_usb_drv.c| 27 +-
 drivers/staging/media/as102/as10x_cmd.c| 21 
 drivers/staging/media/as102/as10x_cmd_cfg.c|  9 -
 drivers/staging/media/as102/as10x_cmd_stream.c | 12 
 8 files changed, 6 insertions(+), 123 deletions(-)

-- 
1.8.5.rc3

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


[PATCH 2/2] staging: as102: Remove ENTER/LEAVE debugging macros

2013-11-26 Thread Mauro Dreissig
Too much noise, also does not cover every possible code paths.

Signed-off-by: Mauro Dreissig 
Acked-by: Greg Kroah-Hartman 
---
 drivers/staging/media/as102/as102_drv.c| 10 --
 drivers/staging/media/as102/as102_drv.h|  8 
 drivers/staging/media/as102/as102_fe.c | 26 --
 drivers/staging/media/as102/as102_fw.c |  6 --
 drivers/staging/media/as102/as102_usb_drv.c| 25 -
 drivers/staging/media/as102/as10x_cmd.c| 21 -
 drivers/staging/media/as102/as10x_cmd_cfg.c|  9 -
 drivers/staging/media/as102/as10x_cmd_stream.c | 12 
 8 files changed, 117 deletions(-)

diff --git a/drivers/staging/media/as102/as102_drv.c 
b/drivers/staging/media/as102/as102_drv.c
index ac92eaf..62218db 100644
--- a/drivers/staging/media/as102/as102_drv.c
+++ b/drivers/staging/media/as102/as102_drv.c
@@ -112,8 +112,6 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
struct as10x_bus_adapter_t *bus_adap = &dev->bus_adap;
int ret = -EFAULT;
 
-   ENTER();
-
if (mutex_lock_interruptible(&dev->bus_adap.lock)) {
dprintk(debug, "mutex_lock_interruptible(lock) failed !\n");
return -EBUSY;
@@ -141,8 +139,6 @@ static int as10x_pid_filter(struct as102_dev_t *dev,
}
 
mutex_unlock(&dev->bus_adap.lock);
-
-   LEAVE();
return ret;
 }
 
@@ -152,8 +148,6 @@ static int as102_dvb_dmx_start_feed(struct dvb_demux_feed 
*dvbdmxfeed)
struct dvb_demux *demux = dvbdmxfeed->demux;
struct as102_dev_t *as102_dev = demux->priv;
 
-   ENTER();
-
if (mutex_lock_interruptible(&as102_dev->sem))
return -ERESTARTSYS;
 
@@ -165,7 +159,6 @@ static int as102_dvb_dmx_start_feed(struct dvb_demux_feed 
*dvbdmxfeed)
ret = as102_start_stream(as102_dev);
 
mutex_unlock(&as102_dev->sem);
-   LEAVE();
return ret;
 }
 
@@ -174,8 +167,6 @@ static int as102_dvb_dmx_stop_feed(struct dvb_demux_feed 
*dvbdmxfeed)
struct dvb_demux *demux = dvbdmxfeed->demux;
struct as102_dev_t *as102_dev = demux->priv;
 
-   ENTER();
-
if (mutex_lock_interruptible(&as102_dev->sem))
return -ERESTARTSYS;
 
@@ -187,7 +178,6 @@ static int as102_dvb_dmx_stop_feed(struct dvb_demux_feed 
*dvbdmxfeed)
 dvbdmxfeed->pid, 0);
 
mutex_unlock(&as102_dev->sem);
-   LEAVE();
return 0;
 }
 
diff --git a/drivers/staging/media/as102/as102_drv.h 
b/drivers/staging/media/as102/as102_drv.h
index b0e5a23..a06837d 100644
--- a/drivers/staging/media/as102/as102_drv.h
+++ b/drivers/staging/media/as102/as102_drv.h
@@ -38,14 +38,6 @@ extern int elna_enable;
printk(args);   \
} } while (0)
 
-#ifdef TRACE
-#define ENTER()pr_debug(">> enter %s\n", __func__)
-#define LEAVE()pr_debug("<< leave %s\n", __func__)
-#else
-#define ENTER()
-#define LEAVE()
-#endif
-
 #define AS102_DEVICE_MAJOR 192
 
 #define AS102_USB_BUF_SIZE 512
diff --git a/drivers/staging/media/as102/as102_fe.c 
b/drivers/staging/media/as102/as102_fe.c
index 9ce8c9d..72b2c48 100644
--- a/drivers/staging/media/as102/as102_fe.c
+++ b/drivers/staging/media/as102/as102_fe.c
@@ -34,8 +34,6 @@ static int as102_fe_set_frontend(struct dvb_frontend *fe)
struct as102_dev_t *dev;
struct as10x_tune_args tune_args = { 0 };
 
-   ENTER();
-
dev = (struct as102_dev_t *) fe->tuner_priv;
if (dev == NULL)
return -ENODEV;
@@ -52,7 +50,6 @@ static int as102_fe_set_frontend(struct dvb_frontend *fe)
 
mutex_unlock(&dev->bus_adap.lock);
 
-   LEAVE();
return (ret < 0) ? -EINVAL : 0;
 }
 
@@ -63,8 +60,6 @@ static int as102_fe_get_frontend(struct dvb_frontend *fe)
struct as102_dev_t *dev;
struct as10x_tps tps = { 0 };
 
-   ENTER();
-
dev = (struct as102_dev_t *) fe->tuner_priv;
if (dev == NULL)
return -EINVAL;
@@ -80,13 +75,11 @@ static int as102_fe_get_frontend(struct dvb_frontend *fe)
 
mutex_unlock(&dev->bus_adap.lock);
 
-   LEAVE();
return (ret < 0) ? -EINVAL : 0;
 }
 
 static int as102_fe_get_tune_settings(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings *settings) {
-   ENTER();
 
 #if 0
dprintk(debug, "step_size= %d\n", settings->step_size);
@@ -97,7 +90,6 @@ static int as102_fe_get_tune_settings(struct dvb_frontend *fe,
 
settings->min_delay_ms = 1000;
 
-   LEAVE();
return 0;
 }
 
@@ -108,8 +100,6 @@ static int as102_fe_read_status(struct dvb_frontend *fe, 
fe_status_t *status)
struct as102_dev_t *dev;
struct as10x_tune_status tstate = { 0 };
 
-   ENTER();
-
dev = (struct as102_dev_t *) fe->tuner_priv;
if (dev == NULL)
return -ENODEV;
@@ -168,7 +158,6 @@ static

[PATCH 1/2] staging: as102: Declare local variables as static

2013-11-26 Thread Mauro Dreissig
As pointed out by sparse:

drivers/staging/media/as102/as102_fw.c:29:6: warning: symbol 'as102_st_fw1' was 
not declared. Should it be static?
drivers/staging/media/as102/as102_fw.c:30:6: warning: symbol 'as102_st_fw2' was 
not declared. Should it be static?
drivers/staging/media/as102/as102_fw.c:31:6: warning: symbol 'as102_dt_fw1' was 
not declared. Should it be static?
drivers/staging/media/as102/as102_fw.c:32:6: warning: symbol 'as102_dt_fw2' was 
not declared. Should it be static?
drivers/staging/media/as102/as102_usb_drv.c:194:25: warning: symbol 
'as102_priv_ops' was not declared. Should it be static?

Also use the const qualifier on the firmware name strings.

Signed-off-by: Mauro Dreissig 
Acked-by: Greg Kroah-Hartman 
---
 drivers/staging/media/as102/as102_fw.c  | 10 +-
 drivers/staging/media/as102/as102_usb_drv.c |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/media/as102/as102_fw.c 
b/drivers/staging/media/as102/as102_fw.c
index b9670ee..9e7c6d7 100644
--- a/drivers/staging/media/as102/as102_fw.c
+++ b/drivers/staging/media/as102/as102_fw.c
@@ -26,10 +26,10 @@
 #include "as102_drv.h"
 #include "as102_fw.h"
 
-char as102_st_fw1[] = "as102_data1_st.hex";
-char as102_st_fw2[] = "as102_data2_st.hex";
-char as102_dt_fw1[] = "as102_data1_dt.hex";
-char as102_dt_fw2[] = "as102_data2_dt.hex";
+static const char as102_st_fw1[] = "as102_data1_st.hex";
+static const char as102_st_fw2[] = "as102_data2_st.hex";
+static const char as102_dt_fw1[] = "as102_data1_dt.hex";
+static const char as102_dt_fw2[] = "as102_data2_dt.hex";
 
 static unsigned char atohx(unsigned char *dst, char *src)
 {
@@ -167,7 +167,7 @@ int as102_fw_upload(struct as10x_bus_adapter_t *bus_adap)
int errno = -EFAULT;
const struct firmware *firmware = NULL;
unsigned char *cmd_buf = NULL;
-   char *fw1, *fw2;
+   const char *fw1, *fw2;
struct usb_device *dev = bus_adap->usb_dev;
 
ENTER();
diff --git a/drivers/staging/media/as102/as102_usb_drv.c 
b/drivers/staging/media/as102/as102_usb_drv.c
index 9f275f0..0eaced3 100644
--- a/drivers/staging/media/as102/as102_usb_drv.c
+++ b/drivers/staging/media/as102/as102_usb_drv.c
@@ -191,7 +191,7 @@ static int as102_read_ep2(struct as10x_bus_adapter_t 
*bus_adap,
return ret ? ret : actual_len;
 }
 
-struct as102_priv_ops_t as102_priv_ops = {
+static struct as102_priv_ops_t as102_priv_ops = {
.upload_fw_pkt  = as102_send_ep1,
.xfer_cmd   = as102_usb_xfer_cmd,
.as102_read_ep2 = as102_read_ep2,
-- 
1.8.5.rc3

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


[PATCH] staging: sb105x: Fix typo in sb105x

2013-11-26 Thread Masanari Iida
Correct spelling typo in staging/sb105x.

Signed-off-by: Masanari Iida 
---
 drivers/staging/sb105x/sb_mp_register.h | 8 
 drivers/staging/sb105x/sb_pci_mp.c  | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/sb105x/sb_mp_register.h 
b/drivers/staging/sb105x/sb_mp_register.h
index 16de497..276c1bb 100644
--- a/drivers/staging/sb105x/sb_mp_register.h
+++ b/drivers/staging/sb105x/sb_mp_register.h
@@ -116,10 +116,10 @@
 #define SB105X_FCR_TXFR0x04/* TX FIFO Reset */
 #define SB105X_FCR_DMS 0x08/* DMA Mode Select */
 
-#define SB105X_FCR_RTR08   0x00/* Receice Trigger Level set at 8 */
-#define SB105X_FCR_RTR16   0x40  /* Receice Trigger Level set at 16 */
-#define SB105X_FCR_RTR56   0x80  /* Receice Trigger Level set at 56 */
-#define SB105X_FCR_RTR60   0xc0  /* Receice Trigger Level set at 60 */
+#define SB105X_FCR_RTR08   0x00  /* Receive Trigger Level set at 8 */
+#define SB105X_FCR_RTR16   0x40  /* Receive Trigger Level set at 16 */
+#define SB105X_FCR_RTR56   0x80  /* Receive Trigger Level set at 56 */
+#define SB105X_FCR_RTR60   0xc0  /* Receive Trigger Level set at 60 */
 #define SB105X_FCR_TTR08   0x00  /* Transmit Trigger Level set at 8 */
 #define SB105X_FCR_TTR16   0x10  /* Transmit Trigger Level set at 16 */
 #define SB105X_FCR_TTR32   0x20  /* Transmit Trigger Level set at 32 */
diff --git a/drivers/staging/sb105x/sb_pci_mp.c 
b/drivers/staging/sb105x/sb_pci_mp.c
index 5cd3eff..c9d6ee3 100644
--- a/drivers/staging/sb105x/sb_pci_mp.c
+++ b/drivers/staging/sb105x/sb_pci_mp.c
@@ -182,7 +182,7 @@ static int sb1054_get_register(struct sb_uart_port *port, 
int page, int reg)
 
if( page <= 0)
{
-   printk(" page 0 can not use this fuction\n");
+   printk(" page 0 can not use this function\n");
return -1;
}
 
@@ -243,7 +243,7 @@ static int sb1054_set_register(struct sb_uart_port *port, 
int page, int reg, int
 
if( page <= 0)
{
-   printk(" page 0 can not use this fuction\n");
+   printk(" page 0 can not use this function\n");
return -1;
}
switch(page)
-- 
1.8.5.rc1.28.g7061504

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


[PATCH v2 05/26] staging: comedi: remove DPRINTK macro

2013-11-26 Thread H Hartley Sweeten
All users of this macro have been converted to use dev_dbg(). Remove
the unused macro.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/comedidev.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h 
b/drivers/staging/comedi/comedidev.h
index 3c6329b..f00b43c 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -27,8 +27,6 @@
 
 #include "comedi.h"
 
-#define DPRINTK(format, args...)   pr_debug("comedi: " format, ## args);
-
 #define COMEDI_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
 #define COMEDI_VERSION_CODE COMEDI_VERSION(COMEDI_MAJORVERSION, \
COMEDI_MINORVERSION, COMEDI_MICROVERSION)
-- 
1.8.4.4

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


[PATCH v2 02/26] staging: comedi: ni_pcidio: remove DEBUG_FLAGS define and code

2013-11-26 Thread H Hartley Sweeten
The DEBUG_FLAGS define enables some development code that outputs
interrupt flags and status information in the interrupt handler.
This information is just added noise. Remove it.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_pcidio.c | 60 --
 1 file changed, 60 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c 
b/drivers/staging/comedi/drivers/ni_pcidio.c
index 75da358..c04ec29 100644
--- a/drivers/staging/comedi/drivers/ni_pcidio.c
+++ b/drivers/staging/comedi/drivers/ni_pcidio.c
@@ -47,7 +47,6 @@ comedi_nonfree_firmware tarball available from 
http://www.comedi.org
 */
 
 #define USE_DMA
-/* #define DEBUG_FLAGS */
 
 #include 
 #include 
@@ -311,14 +310,6 @@ static int ni_pcidio_ns_to_timer(int *nanosec, int 
round_mode);
 static int setup_mite_dma(struct comedi_device *dev,
  struct comedi_subdevice *s);
 
-#ifdef DEBUG_FLAGS
-static void ni_pcidio_print_flags(unsigned int flags);
-static void ni_pcidio_print_status(unsigned int status);
-#else
-#define ni_pcidio_print_flags(x)
-#define ni_pcidio_print_status(x)
-#endif
-
 static int ni_pcidio_request_di_mite_channel(struct comedi_device *dev)
 {
struct nidio96_private *devpriv = dev->private;
@@ -421,8 +412,6 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
 
DPRINTK("ni_pcidio_interrupt: status=0x%02x,flags=0x%02x\n",
status, flags);
-   ni_pcidio_print_flags(flags);
-   ni_pcidio_print_status(status);
 
spin_lock(&devpriv->mite_channel_lock);
if (devpriv->di_mite_chan)
@@ -488,8 +477,6 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
async->buf_int_count); */
/* DPRINTK("1) IntEn=%d,flags=%d,status=%d\n",
IntEn,flags,status); */
-   /* ni_pcidio_print_flags(flags); */
-   /* ni_pcidio_print_status(status); */
async->events |= COMEDI_CB_BLOCK;
}
 
@@ -536,8 +523,6 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
   Interrupt_And_Window_Status);
/* DPRINTK("loop end: IntEn=0x%02x,flags=0x%02x,"
"status=0x%02x\n", IntEn, flags, status); */
-   /* ni_pcidio_print_flags(flags); */
-   /* ni_pcidio_print_status(status); */
}
 
 out:
@@ -554,51 +539,6 @@ out:
return IRQ_HANDLED;
 }
 
-#ifdef DEBUG_FLAGS
-static const char *bit_set_string(unsigned int bits, unsigned int bit,
- const char *const strings[])
-{
-   return (bits & (1U << bit)) ? strings[bit] : "";
-}
-
-static const char *const flags_strings[] = {
-   " TransferReady", " CountExpired", " 2", " 3",
-   " 4", " Waited", " PrimaryTC", " SecondaryTC",
-};
-
-
-static void ni_pcidio_print_flags(unsigned int flags)
-{
-   pr_debug("group_1_flags:%s%s%s%s%s%s%s%s\n",
-bit_set_string(flags, 7, flags_strings),
-bit_set_string(flags, 6, flags_strings),
-bit_set_string(flags, 5, flags_strings),
-bit_set_string(flags, 4, flags_strings),
-bit_set_string(flags, 3, flags_strings),
-bit_set_string(flags, 2, flags_strings),
-bit_set_string(flags, 1, flags_strings),
-bit_set_string(flags, 0, flags_strings));
-}
-
-static const char *const status_strings[] = {
-   " DataLeft1", " Reserved1", " Req1", " StopTrig1",
-   " DataLeft2", " Reserved2", " Req2", " StopTrig2",
-};
-
-static void ni_pcidio_print_status(unsigned int flags)
-{
-   pr_debug("group_status:%s%s%s%s%s%s%s%s\n",
-bit_set_string(flags, 7, status_strings),
-bit_set_string(flags, 6, status_strings),
-bit_set_string(flags, 5, status_strings),
-bit_set_string(flags, 4, status_strings),
-bit_set_string(flags, 3, status_strings),
-bit_set_string(flags, 2, status_strings),
-bit_set_string(flags, 1, status_strings),
-bit_set_string(flags, 0, status_strings));
-}
-#endif
-
 #ifdef unused
 static void debug_int(struct comedi_device *dev)
 {
-- 
1.8.4.4

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


[PATCH v2 03/26] staging: comedi: ni_pcidio: remove debug_int()

2013-11-26 Thread H Hartley Sweeten
This function is not used by the driver. Just remove it.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_pcidio.c | 31 --
 1 file changed, 31 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c 
b/drivers/staging/comedi/drivers/ni_pcidio.c
index c04ec29..933aabe 100644
--- a/drivers/staging/comedi/drivers/ni_pcidio.c
+++ b/drivers/staging/comedi/drivers/ni_pcidio.c
@@ -539,37 +539,6 @@ out:
return IRQ_HANDLED;
 }
 
-#ifdef unused
-static void debug_int(struct comedi_device *dev)
-{
-   struct nidio96_private *devpriv = dev->private;
-   int a, b;
-   static int n_int;
-   struct timeval tv;
-
-   do_gettimeofday(&tv);
-   a = readb(devpriv->mite->daq_io_addr + Group_Status);
-   b = readb(devpriv->mite->daq_io_addr + Group_1_Flags);
-
-   if (n_int < 10) {
-   DPRINTK("status 0x%02x flags 0x%02x time %06d\n", a, b,
-   (int)tv.tv_usec);
-   }
-
-   while (b & 1) {
-   writew(0xff, devpriv->mite->daq_io_addr + Group_1_FIFO);
-   b = readb(devpriv->mite->daq_io_addr + Group_1_Flags);
-   }
-
-   b = readb(devpriv->mite->daq_io_addr + Group_1_Flags);
-
-   if (n_int < 10) {
-   DPRINTK("new status 0x%02x\n", b);
-   n_int++;
-   }
-}
-#endif
-
 static int ni_pcidio_insn_config(struct comedi_device *dev,
 struct comedi_subdevice *s,
 struct comedi_insn *insn,
-- 
1.8.4.4

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


[PATCH v2 12/26] staging: comedi: ni_pcimio: remove PCI_DEBUG

2013-11-26 Thread H Hartley Sweeten
This define is not used in the driver. Remove it.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_pcimio.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c 
b/drivers/staging/comedi/drivers/ni_pcimio.c
index 536be83..aa002b2 100644
--- a/drivers/staging/comedi/drivers/ni_pcimio.c
+++ b/drivers/staging/comedi/drivers/ni_pcimio.c
@@ -116,8 +116,6 @@ Bugs:
 #include "ni_stc.h"
 #include "mite.h"
 
-/* #define PCI_DEBUG */
-
 #define PCIDMA
 
 #define PCIMIO 1
-- 
1.8.4.4

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


[PATCH v2 04/26] staging: comedi: ni_pcidio: remove use of DPRINTK

2013-11-26 Thread H Hartley Sweeten
Remove the DPRINTK messages that are just function trace noise.

Use dev_dbg() instead of the DPRINTK macro to output the comedi
debugging information.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_pcidio.c | 34 ++
 1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c 
b/drivers/staging/comedi/drivers/ni_pcidio.c
index 933aabe..b2af280 100644
--- a/drivers/staging/comedi/drivers/ni_pcidio.c
+++ b/drivers/staging/comedi/drivers/ni_pcidio.c
@@ -410,9 +410,6 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
   Interrupt_And_Window_Status);
flags = readb(devpriv->mite->daq_io_addr + Group_1_Flags);
 
-   DPRINTK("ni_pcidio_interrupt: status=0x%02x,flags=0x%02x\n",
-   status, flags);
-
spin_lock(&devpriv->mite_channel_lock);
if (devpriv->di_mite_chan)
m_status = mite_get_status(devpriv->di_mite_chan);
@@ -431,7 +428,8 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
}
if (m_status & ~(CHSR_INT | CHSR_LINKC | CHSR_DONE | CHSR_DRDY |
 CHSR_DRQ1 | CHSR_MRDY)) {
-   DPRINTK("unknown mite interrupt, disabling IRQ\n");
+   dev_dbg(dev->class_dev,
+   "unknown mite interrupt, disabling IRQ\n");
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
disable_irq(dev->irq);
}
@@ -441,7 +439,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
while (status & DataLeft) {
work++;
if (work > 20) {
-   DPRINTK("too much work in interrupt\n");
+   dev_dbg(dev->class_dev, "too much work in interrupt\n");
writeb(0x00,
   devpriv->mite->daq_io_addr +
   Master_DMA_And_Interrupt_Control);
@@ -451,11 +449,11 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
flags &= IntEn;
 
if (flags & TransferReady) {
-   /* DPRINTK("TransferReady\n"); */
while (flags & TransferReady) {
work++;
if (work > 100) {
-   DPRINTK("too much work in interrupt\n");
+   dev_dbg(dev->class_dev,
+   "too much work in interrupt\n");
writeb(0x00,
   devpriv->mite->daq_io_addr +
   Master_DMA_And_Interrupt_Control
@@ -469,19 +467,13 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
data2 = (auxdata & 0x) >> 16;
comedi_buf_put(async, data1);
comedi_buf_put(async, data2);
-   /* DPRINTK("read:%d, %d\n",data1,data2); */
flags = readb(devpriv->mite->daq_io_addr +
  Group_1_Flags);
}
-   /* DPRINTK("buf_int_count: %d\n",
-   async->buf_int_count); */
-   /* DPRINTK("1) IntEn=%d,flags=%d,status=%d\n",
-   IntEn,flags,status); */
async->events |= COMEDI_CB_BLOCK;
}
 
if (flags & CountExpired) {
-   DPRINTK("CountExpired\n");
writeb(ClearExpired,
   devpriv->mite->daq_io_addr +
   Group_1_Second_Clear);
@@ -490,39 +482,26 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
writeb(0x00, devpriv->mite->daq_io_addr + OpMode);
break;
} else if (flags & Waited) {
-   DPRINTK("Waited\n");
writeb(ClearWaited,
   devpriv->mite->daq_io_addr +
   Group_1_First_Clear);
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
break;
} else if (flags & PrimaryTC) {
-   DPRINTK("PrimaryTC\n");
writeb(ClearPrimaryTC,
   devpriv->mite->daq_io_addr +
   Group_1_First_Clear);
async->events |= COMEDI_CB_EOA;
} else if (flags & SecondaryTC) {
-   DPRINTK("SecondaryTC\n");
writeb(ClearSecondaryTC,
   devp

[PATCH v2 07/26] staging: comedi: mite: remove DEBUG_MITE code

2013-11-26 Thread H Hartley Sweeten
The code protected by the DEBUG_MITE define outputs some development
debug information. This information is just added noise in the final
driver. Remove the code.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/mite.c  | 134 -
 drivers/staging/comedi/drivers/mite.h  |   5 -
 drivers/staging/comedi/drivers/ni_mio_common.c |   3 -
 drivers/staging/comedi/drivers/ni_pcidio.c |   4 -
 4 files changed, 146 deletions(-)

diff --git a/drivers/staging/comedi/drivers/mite.c 
b/drivers/staging/comedi/drivers/mite.c
index 447047f..9c9a0ee 100644
--- a/drivers/staging/comedi/drivers/mite.c
+++ b/drivers/staging/comedi/drivers/mite.c
@@ -633,140 +633,6 @@ int mite_done(struct mite_channel *mite_chan)
 }
 EXPORT_SYMBOL_GPL(mite_done);
 
-#ifdef DEBUG_MITE
-
-/* names of bits in mite registers */
-
-static const char *const mite_CHOR_strings[] = {
-   "start", "cont", "stop", "abort",
-   "freset", "clrlc", "clrrb", "clrdone",
-   "clr_lpause", "set_lpause", "clr_send_tc",
-   "set_send_tc", "12", "13", "14",
-   "15", "16", "17", "18",
-   "19", "20", "21", "22",
-   "23", "24", "25", "26",
-   "27", "28", "29", "30",
-   "dmareset",
-};
-
-static const char *const mite_CHCR_strings[] = {
-   "continue", "ringbuff", "2", "3",
-   "4", "5", "6", "7",
-   "8", "9", "10", "11",
-   "12", "13", "bursten", "fifodis",
-   "clr_cont_rb_ie", "set_cont_rb_ie", "clr_lc_ie", "set_lc_ie",
-   "clr_drdy_ie", "set_drdy_ie", "clr_mrdy_ie", "set_mrdy_ie",
-   "clr_done_ie", "set_done_ie", "clr_sar_ie", "set_sar_ie",
-   "clr_linkp_ie", "set_linkp_ie", "clr_dma_ie", "set_dma_ie",
-};
-
-static const char *const mite_MCR_strings[] = {
-   "amdevice", "1", "2", "3",
-   "4", "5", "portio", "portvxi",
-   "psizebyte", "psizehalf (byte & half = word)", "aseqxp1", "11",
-   "12", "13", "blocken", "berhand",
-   "reqsintlim/reqs0", "reqs1", "reqs2", "rd32",
-   "rd512", "rl1", "rl2", "rl8",
-   "24", "25", "26", "27",
-   "28", "29", "30", "stopen",
-};
-
-static const char *const mite_DCR_strings[] = {
-   "amdevice", "1", "2", "3",
-   "4", "5", "portio", "portvxi",
-   "psizebyte", "psizehalf (byte & half = word)", "aseqxp1", "aseqxp2",
-   "aseqxp8", "13", "blocken", "berhand",
-   "reqsintlim", "reqs1", "reqs2", "rd32",
-   "rd512", "rl1", "rl2", "rl8",
-   "23", "24", "25", "27",
-   "28", "wsdevc", "wsdevs", "rwdevpack",
-};
-
-static const char *const mite_LKCR_strings[] = {
-   "amdevice", "1", "2", "3",
-   "4", "5", "portio", "portvxi",
-   "psizebyte", "psizehalf (byte & half = word)", "asequp", "aseqdown",
-   "12", "13", "14", "berhand",
-   "16", "17", "18", "rd32",
-   "rd512", "rl1", "rl2", "rl8",
-   "24", "25", "26", "27",
-   "28", "29", "30", "chngend",
-};
-
-static const char *const mite_CHSR_strings[] = {
-   "d.err0", "d.err1", "m.err0", "m.err1",
-   "l.err0", "l.err1", "drq0", "drq1",
-   "end", "xferr", "operr0", "operr1",
-   "stops", "habort", "sabort", "error",
-   "16", "conts_rb", "18", "linkc",
-   "20", "drdy", "22", "mrdy",
-   "24", "done", "26", "sars",
-   "28", "lpauses", "30", "int",
-};
-
-static void mite_decode(const char *const *bit_str, unsigned int bits)
-{
-   int i;
-
-   for (i = 31; i >= 0; i--) {
-   if (bits & (1 << i))
-   pr_debug(" %s\n", bit_str[i]);
-   }
-}
-
-void mite_dump_regs(struct mite_channel *mite_chan)
-{
-   void __iomem *mite_io_addr = mite_chan->mite->mite_io_addr;
-   unsigned int offset;
-   unsigned int value;
-   int channel = mite_chan->channel;
-
-   pr_debug("mite_dump_regs ch%i\n", channel);
-   pr_debug("mite address is  =%p\n", mite_io_addr);
-
-   offset = MITE_CHOR(channel);
-   value = readl(mite_io_addr + offset);
-   pr_debug("mite status[CHOR] at 0x%08x =0x%08x\n", offset, value);
-   mite_decode(mite_CHOR_strings, value);
-   offset = MITE_CHCR(channel);
-   value = readl(mite_io_addr + offset);
-   pr_debug("mite status[CHCR] at 0x%08x =0x%08x\n", offset, value);
-   mite_decode(mite_CHCR_strings, value);
-   offset = MITE_TCR(channel);
-   value = readl(mite_io_addr + offset);
-   pr_debug("mite status[TCR] at 0x%08x =0x%08x\n", offset, value);
-   offset = MITE_MCR(channel);
-   value = readl(mite_io_addr + offset);
-   pr_debug("mite status[MCR] at 0x%08x =0x%08x\n", offset, value);
-   mite_decode(mite_MCR_strings, value);
-   offset = MITE_MAR(channel);
-   value = readl(mite_io_addr + offset);
-   pr_debug("mite status[MAR] at 0x%08x =0x%08x\n", offset, value);
-   offset = MITE_DCR(channel);
-   value = readl(mite_io_addr + offset);
-   pr_debug("mite status[DCR] at 0x%08x =0x%08x\n", offset, 

[PATCH v2 11/26] staging: comedi: cb_pcimdas: remove CBPCIMDAS_DEBUG

2013-11-26 Thread H Hartley Sweeten
This define is not used in the driver. Remove it.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/cb_pcimdas.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c 
b/drivers/staging/comedi/drivers/cb_pcimdas.c
index 30520d4..b25fa5d 100644
--- a/drivers/staging/comedi/drivers/cb_pcimdas.c
+++ b/drivers/staging/comedi/drivers/cb_pcimdas.c
@@ -44,9 +44,6 @@ See http://www.mccdaq.com/PDFs/Manuals/pcim-das1602-16.pdf 
for more details.
 #include "plx9052.h"
 #include "8255.h"
 
-/* #define CBPCIMDAS_DEBUG */
-#undef CBPCIMDAS_DEBUG
-
 /* Registers for the PCIM-DAS1602/16 */
 
 /* sizes of io regions (bytes) */
-- 
1.8.4.4

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


[PATCH v2 14/26] staging: comedi: pcmmio: remove commented out debug code

2013-11-26 Thread H Hartley Sweeten
Remove the commented out code in init_asics() that enables the rising
edge interrupts on port0 of both asics.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcmmio.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcmmio.c 
b/drivers/staging/comedi/drivers/pcmmio.c
index 1ebc9d2..6da836e 100644
--- a/drivers/staging/comedi/drivers/pcmmio.c
+++ b/drivers/staging/comedi/drivers/pcmmio.c
@@ -357,13 +357,6 @@ static void init_asics(struct comedi_device *dev)
outb(0, baseaddr + reg);
}
 
-   /* DEBUG  set rising edge interrupts on port0 of both asics */
-   /*switch_page(dev, asic, PAGE_POL);
-  outb(0xff, baseaddr + REG_POL0);
-  switch_page(dev, asic, PAGE_ENAB);
-  outb(0xff, baseaddr + REG_ENAB0); */
-   /* END DEBUG */
-
/* switch back to default page 0 */
switch_page(dev, asic, 0);
}
-- 
1.8.4.4

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


[PATCH v2 19/26] staging: comedi: pcl818: remove an unnecessary printk(KERN_DEBUG ...

2013-11-26 Thread H Hartley Sweeten
This debug message is just added noise. Remove it.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl818.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 8b5e9c0..be9cb8d 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -1257,8 +1257,6 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
(", unable to allocate IRQ %u, 
DISABLING IT",
 irq);
irq = 0;/* Can't use IRQ */
-   } else {
-   printk(KERN_DEBUG "irq=%u", irq);
}
}
}
-- 
1.8.4.4

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


[PATCH v2 10/26] staging: comedi: ni_at_a2150: remove A2150_DEBUG

2013-11-26 Thread H Hartley Sweeten
The A2150_DEBUG define enables some development messages, specifically
the ni_dum_regs() function. These messages are just added noise. Remove
them.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_at_a2150.c | 25 -
 1 file changed, 25 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c 
b/drivers/staging/comedi/drivers/ni_at_a2150.c
index 63c8479..cc69dde 100644
--- a/drivers/staging/comedi/drivers/ni_at_a2150.c
+++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
@@ -74,9 +74,6 @@ TRIG_WAKE_EOS
 #define A2150_SIZE   28
 #define A2150_DMA_BUFFER_SIZE  0xff00  /*  size in bytes of dma buffer */
 
-/* #define A2150_DEBUG enable debugging code */
-#undef A2150_DEBUG /*  disable debugging code */
-
 /* Registers and bits */
 #define CONFIG_REG 0x0
 #define   CHANNEL_BITS(x)  ((x) & 0x7)
@@ -167,19 +164,6 @@ static int a2150_get_timing(struct comedi_device *dev, 
unsigned int *period,
 static int a2150_set_chanlist(struct comedi_device *dev,
  unsigned int start_channel,
  unsigned int num_channels);
-#ifdef A2150_DEBUG
-
-static void ni_dump_regs(struct comedi_device *dev)
-{
-   struct a2150_private *devpriv = dev->private;
-
-   printk("config bits 0x%x\n", devpriv->config_bits);
-   printk("irq dma bits 0x%x\n", devpriv->irq_dma_bits);
-   printk("status bits 0x%x\n", inw(dev->iobase + STATUS_REG));
-}
-
-#endif
-
 /* interrupt service routine */
 static irqreturn_t a2150_interrupt(int irq, void *d)
 {
@@ -506,9 +490,6 @@ static int a2150_ai_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
/*  start acquisition for soft trigger */
if (cmd->start_src == TRIG_NOW)
outw(0, dev->iobase + FIFO_START_REG);
-#ifdef A2150_DEBUG
-   ni_dump_regs(dev);
-#endif
 
return 0;
 }
@@ -573,13 +554,7 @@ static int a2150_ai_rinsn(struct comedi_device *dev, 
struct comedi_subdevice *s,
comedi_error(dev, "timeout");
return -ETIME;
}
-#ifdef A2150_DEBUG
-   ni_dump_regs(dev);
-#endif
data[n] = inw(dev->iobase + FIFO_DATA_REG);
-#ifdef A2150_DEBUG
-   printk(" data is %i\n", data[n]);
-#endif
data[n] ^= 0x8000;
}
 
-- 
1.8.4.4

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


[PATCH v2 21/26] staging: comedi: ni_mio_common: remove unused NI_CS5529_DEBUG code

2013-11-26 Thread H Hartley Sweeten
The code blocked by #ifdef NI_CS5529_DEBUG is not used by the driver.
Just remove it.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 30 --
 1 file changed, 30 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index 866e993..f44013c 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -318,10 +318,6 @@ static int cs5529_do_conversion(struct comedi_device *dev,
 static int cs5529_ai_insn_read(struct comedi_device *dev,
   struct comedi_subdevice *s,
   struct comedi_insn *insn, unsigned int *data);
-#ifdef NI_CS5529_DEBUG
-static unsigned int cs5529_config_read(struct comedi_device *dev,
-  unsigned int reg_select_bits);
-#endif
 static void cs5529_config_write(struct comedi_device *dev, unsigned int value,
unsigned int reg_select_bits);
 
@@ -5856,25 +5852,6 @@ static void cs5529_config_write(struct comedi_device 
*dev, unsigned int value,
comedi_error(dev, "time or signal in cs5529_config_write()");
 }
 
-#ifdef NI_CS5529_DEBUG
-/* read from cs5529 register */
-static unsigned int cs5529_config_read(struct comedi_device *dev,
-  unsigned int reg_select_bits)
-{
-   unsigned int value;
-
-   reg_select_bits &= CSCMD_REGISTER_SELECT_MASK;
-   cs5529_command(dev, CSCMD_COMMAND | CSCMD_READ | reg_select_bits);
-   if (cs5529_wait_for_idle(dev))
-   comedi_error(dev, "timeout or signal in cs5529_config_read()");
-   value = (ni_ao_win_inw(dev,
-  CAL_ADC_Config_Data_High_Word_67xx) << 16) &
-   0xff;
-   value |= ni_ao_win_inw(dev, CAL_ADC_Config_Data_Low_Word_67xx) & 0x;
-   return value;
-}
-#endif
-
 static int cs5529_do_conversion(struct comedi_device *dev, unsigned short 
*data)
 {
int retval;
@@ -5951,12 +5928,5 @@ static int init_cs5529(struct comedi_device *dev)
if (cs5529_wait_for_idle(dev))
comedi_error(dev, "timeout or signal in init_cs5529()\n");
 #endif
-#ifdef NI_CS5529_DEBUG
-   printk("config: 0x%x\n", cs5529_config_read(dev,
-   CSCMD_CONFIG_REGISTER));
-   printk("gain: 0x%x\n", cs5529_config_read(dev, CSCMD_GAIN_REGISTER));
-   printk("offset: 0x%x\n", cs5529_config_read(dev,
-   CSCMD_OFFSET_REGISTER));
-#endif
return 0;
 }
-- 
1.8.4.4

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


[PATCH v2 17/26] staging: comedi: c6xdigio: remove unnecessary c6xdigio_pwmo_insn_read()

2013-11-26 Thread H Hartley Sweeten
The pwm subdevice in this driver sets the subdev_flags to SDF_WRITEABLE
so the s->insn_read callback is not needed. Since this callback simply
outputs a printk(KERN_DEBUG ... message jsut remove it.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/c6xdigio.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/comedi/drivers/c6xdigio.c 
b/drivers/staging/comedi/drivers/c6xdigio.c
index 217aa19c..a85b949 100644
--- a/drivers/staging/comedi/drivers/c6xdigio.c
+++ b/drivers/staging/comedi/drivers/c6xdigio.c
@@ -322,14 +322,6 @@ static void C6X_encResetAll(unsigned long baseAddr)
}
 }
 
-static int c6xdigio_pwmo_insn_read(struct comedi_device *dev,
-  struct comedi_subdevice *s,
-  struct comedi_insn *insn, unsigned int *data)
-{
-   printk(KERN_DEBUG "c6xdigio_pwmo_insn_read %x\n", insn->n);
-   return insn->n;
-}
-
 static int c6xdigio_pwmo_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
@@ -426,7 +418,6 @@ static int c6xdigio_attach(struct comedi_device *dev,
s->subdev_flags = SDF_WRITEABLE;
s->n_chan = 2;
/*  s->trig[0] = c6xdigio_pwmo; */
-   s->insn_read = c6xdigio_pwmo_insn_read;
s->insn_write = c6xdigio_pwmo_insn_write;
s->maxdata = 500;
s->range_table = &range_bipolar10;  /*  A suitable lie */
-- 
1.8.4.4

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


[PATCH v2 09/26] staging: comedi: gsc_hpdi: remove DEBUG_PRINT

2013-11-26 Thread H Hartley Sweeten
The DEBUG_PRINT macro in this driver is used to output development
debug tracing messages. These messages are just added noise. Remove
them.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/gsc_hpdi.c | 78 ---
 1 file changed, 78 deletions(-)

diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c 
b/drivers/staging/comedi/drivers/gsc_hpdi.c
index 559bf55..4fcf3c8 100644
--- a/drivers/staging/comedi/drivers/gsc_hpdi.c
+++ b/drivers/staging/comedi/drivers/gsc_hpdi.c
@@ -60,15 +60,6 @@ static int hpdi_cancel(struct comedi_device *dev, struct 
comedi_subdevice *s);
 static irqreturn_t handle_interrupt(int irq, void *d);
 static int dio_config_block_size(struct comedi_device *dev, unsigned int 
*data);
 
-#undef HPDI_DEBUG  /*  disable debugging messages */
-/* #define HPDI_DEBUG  enable debugging code */
-
-#ifdef HPDI_DEBUG
-#define DEBUG_PRINT(format, args...)  pr_debug(format , ## args)
-#else
-#define DEBUG_PRINT(format, args...)  no_printk(pr_fmt(format), ## args)
-#endif
-
 #define TIMER_BASE 50  /*  20MHz master clock */
 #define DMA_BUFFER_SIZE 0x1
 #define NUM_DMA_BUFFERS 4
@@ -260,32 +251,6 @@ static void init_plx9080(struct comedi_device *dev)
uint32_t bits;
void __iomem *plx_iobase = devpriv->plx9080_iobase;
 
-   /*  plx9080 dump */
-   DEBUG_PRINT(" plx interrupt status 0x%x\n",
-   readl(plx_iobase + PLX_INTRCS_REG));
-   DEBUG_PRINT(" plx id bits 0x%x\n", readl(plx_iobase + PLX_ID_REG));
-   DEBUG_PRINT(" plx control reg 0x%x\n",
-   readl(devpriv->plx9080_iobase + PLX_CONTROL_REG));
-
-   DEBUG_PRINT(" plx revision 0x%x\n",
-   readl(plx_iobase + PLX_REVISION_REG));
-   DEBUG_PRINT(" plx dma channel 0 mode 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_MODE_REG));
-   DEBUG_PRINT(" plx dma channel 1 mode 0x%x\n",
-   readl(plx_iobase + PLX_DMA1_MODE_REG));
-   DEBUG_PRINT(" plx dma channel 0 pci address 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_PCI_ADDRESS_REG));
-   DEBUG_PRINT(" plx dma channel 0 local address 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_LOCAL_ADDRESS_REG));
-   DEBUG_PRINT(" plx dma channel 0 transfer size 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_TRANSFER_SIZE_REG));
-   DEBUG_PRINT(" plx dma channel 0 descriptor 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_DESCRIPTOR_REG));
-   DEBUG_PRINT(" plx dma channel 0 command status 0x%x\n",
-   readb(plx_iobase + PLX_DMA0_CS_REG));
-   DEBUG_PRINT(" plx dma channel 0 threshold 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_THRESHOLD_REG));
-   DEBUG_PRINT(" plx bigend 0x%x\n", readl(plx_iobase + PLX_BIGEND_REG));
 #ifdef __BIG_ENDIAN
bits = BIGEND_DMA0 | BIGEND_DMA1;
 #else
@@ -395,10 +360,6 @@ static int setup_dma_descriptors(struct comedi_device *dev,
if (transfer_size == 0)
return -1;
 
-   DEBUG_PRINT(" transfer_size %i\n", transfer_size);
-   DEBUG_PRINT(" descriptors at 0x%lx\n",
-   (unsigned long)devpriv->dma_desc_phys_addr);
-
buffer_offset = 0;
buffer_index = 0;
for (i = 0; i < NUM_DMA_DESCRIPTORS &&
@@ -423,21 +384,11 @@ static int setup_dma_descriptors(struct comedi_device 
*dev,
buffer_offset = 0;
buffer_index++;
}
-
-   DEBUG_PRINT(" desc %i\n", i);
-   DEBUG_PRINT(" start addr virt 0x%p, phys 0x%lx\n",
-   devpriv->desc_dio_buffer[i],
-   (unsigned long)devpriv->dma_desc[i].
-   pci_start_addr);
-   DEBUG_PRINT(" next 0x%lx\n",
-   (unsigned long)devpriv->dma_desc[i].next);
}
devpriv->num_dma_descriptors = i;
/*  fix last descriptor to point back to first */
devpriv->dma_desc[i - 1].next =
cpu_to_le32(devpriv->dma_desc_phys_addr | next_bits);
-   DEBUG_PRINT(" desc %i next fixup 0x%lx\n", i - 1,
-   (unsigned long)devpriv->dma_desc[i - 1].next);
 
devpriv->block_size = transfer_size;
 
@@ -489,9 +440,6 @@ static int hpdi_auto_attach(struct comedi_device *dev,
return -ENOMEM;
}
 
-   DEBUG_PRINT(" plx9080 remapped to 0x%p\n", devpriv->plx9080_iobase);
-   DEBUG_PRINT(" hpdi remapped to 0x%p\n", devpriv->hpdi_iobase);
-
init_plx9080(dev);
 
/*  get irq */
@@ -510,9 +458,6 @@ static int hpdi_auto_attach(struct comedi_device *dev,
devpriv->dio_buffer[i] =
pci_alloc_consistent(pcidev, DMA_BUFFER_SIZE,
 &devpriv->dio_buffer_phys_addr[i]);
-   DEBUG_PRINT("dio_buffer at virt 0x%p, phys 0x%lx\n",
-   

[PATCH v2 01/26] staging: comedi: comedi_fops: remove use of DPRINTK

2013-11-26 Thread H Hartley Sweeten
Use dev_dbg(), or pr_debug() when dev is not valid, instead of the
DPRINTK macro to output the comedi debugging information.

Remove the debug messages for allocation failures. The failure will
have already generated a message.

Reword the messages that include the dev->minor number. This number
will already be displayed as part of the dev_dbg() output.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/comedi_fops.c | 119 +++
 1 file changed, 64 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index 1071c96..cdaef09 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -250,11 +250,13 @@ static int resize_async_buffer(struct comedi_device *dev,
return -EPERM;
 
if (s->busy) {
-   DPRINTK("subdevice is busy, cannot resize buffer\n");
+   dev_dbg(dev->class_dev,
+   "subdevice is busy, cannot resize buffer\n");
return -EBUSY;
}
if (comedi_buf_is_mmapped(async)) {
-   DPRINTK("subdevice is mmapped, cannot resize buffer\n");
+   dev_dbg(dev->class_dev,
+   "subdevice is mmapped, cannot resize buffer\n");
return -EBUSY;
}
 
@@ -272,8 +274,8 @@ static int resize_async_buffer(struct comedi_device *dev,
return retval;
}
 
-   DPRINTK("comedi%i subd %d buffer resized to %i bytes\n",
-   dev->minor, s->index, async->prealloc_bufsz);
+   dev_dbg(dev->class_dev, "subd %d buffer resized to %i bytes\n",
+   s->index, async->prealloc_bufsz);
return 0;
 }
 
@@ -726,7 +728,8 @@ static int do_bufconfig_ioctl(struct comedi_device *dev,
async = s->async;
 
if (!async) {
-   DPRINTK("subdevice does not have async capability\n");
+   dev_dbg(dev->class_dev,
+   "subdevice does not have async capability\n");
bc.size = 0;
bc.maximum_size = 0;
goto copyback;
@@ -973,7 +976,8 @@ static int do_bufinfo_ioctl(struct comedi_device *dev,
async = s->async;
 
if (!async) {
-   DPRINTK("subdevice does not have async capability\n");
+   dev_dbg(dev->class_dev,
+   "subdevice does not have async capability\n");
bi.buf_write_ptr = 0;
bi.buf_read_ptr = 0;
bi.buf_write_count = 0;
@@ -1125,19 +1129,20 @@ static int parse_insn(struct comedi_device *dev, struct 
comedi_insn *insn,
break;
}
if (insn->subdev >= dev->n_subdevices) {
-   DPRINTK("%d not usable subdevice\n",
+   dev_dbg(dev->class_dev,
+   "%d not usable subdevice\n",
insn->subdev);
ret = -EINVAL;
break;
}
s = &dev->subdevices[insn->subdev];
if (!s->async) {
-   DPRINTK("no async\n");
+   dev_dbg(dev->class_dev, "no async\n");
ret = -EINVAL;
break;
}
if (!s->async->inttrig) {
-   DPRINTK("no inttrig\n");
+   dev_dbg(dev->class_dev, "no inttrig\n");
ret = -EAGAIN;
break;
}
@@ -1146,7 +1151,7 @@ static int parse_insn(struct comedi_device *dev, struct 
comedi_insn *insn,
ret = 1;
break;
default:
-   DPRINTK("invalid insn\n");
+   dev_dbg(dev->class_dev, "invalid insn\n");
ret = -EINVAL;
break;
}
@@ -1155,21 +1160,23 @@ static int parse_insn(struct comedi_device *dev, struct 
comedi_insn *insn,
unsigned int maxdata;
 
if (insn->subdev >= dev->n_subdevices) {
-   DPRINTK("subdevice %d out of range\n", insn->subdev);
+   dev_dbg(dev->class_dev, "subdevice %d out of range\n",
+   insn->subdev);
ret = -EINVAL;
goto out;
}
s = &dev->subdevices[insn->subdev];
 
if (s->type == COMEDI_SUBD_UNUSED) {
-   DPRINTK("%d not usable subdevice\n", insn->subdev);
+   dev_dbg(dev->class_dev, "%d not usab

[PATCH v2 15/26] staging: comedi: dyna_pci10xx: convert a KERN_DEBUG message to dev_dbg()

2013-11-26 Thread H Hartley Sweeten
Convert a printk(KERN_DEBUG ... message to dev_dbg().

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dyna_pci10xx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c 
b/drivers/staging/comedi/drivers/dyna_pci10xx.c
index f2a9f1c..9b1f196 100644
--- a/drivers/staging/comedi/drivers/dyna_pci10xx.c
+++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c
@@ -90,8 +90,7 @@ static int dyna_pci10xx_insn_read_ai(struct comedi_device 
*dev,
goto conv_finish;
}
data[n] = 0;
-   printk(KERN_DEBUG "comedi: dyna_pci10xx: "
-   "timeout reading analog input\n");
+   dev_dbg(dev->class_dev, "timeout reading analog input\n");
continue;
 conv_finish:
/* mask the first 4 bits - EOC bits */
-- 
1.8.4.4

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


[PATCH v2 20/26] staging: comedi: dmm32at: remove some unnecessary printk(KERN_DEBUG ...

2013-11-26 Thread H Hartley Sweeten
These debug messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dmm32at.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dmm32at.c 
b/drivers/staging/comedi/drivers/dmm32at.c
index b04a563..cac8358 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -723,12 +723,6 @@ static int dmm32at_attach(struct comedi_device *dev,
intstat = inb(dev->iobase + DMM32AT_INTCLOCK);
airback = inb(dev->iobase + DMM32AT_AIRBACK);
 
-   printk(KERN_DEBUG "dmm32at: lo=0x%02x hi=0x%02x fifostat=0x%02x\n",
-  ailo, aihi, fifostat);
-   printk(KERN_DEBUG
-  "dmm32at: aistat=0x%02x intstat=0x%02x airback=0x%02x\n",
-  aistat, intstat, airback);
-
if ((ailo != 0x00) || (aihi != 0x1f) || (fifostat != 0x80) ||
(aistat != 0x60 || (intstat != 0x00) || airback != 0x0c)) {
printk(KERN_ERR "dmmat32: board detection failed\n");
-- 
1.8.4.4

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


[PATCH v2 06/26] staging: comedi: mite: remove MDPRINTK macro

2013-11-26 Thread H Hartley Sweeten
This macro is used by the comedi drivers that usee the mite module to
output development function trace messages. These are just added noise.
Remove the messages as well as the macro.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/mite.c  |  9 -
 drivers/staging/comedi/drivers/mite.h  |  7 ---
 drivers/staging/comedi/drivers/ni_mio_common.c | 18 ++
 3 files changed, 2 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/comedi/drivers/mite.c 
b/drivers/staging/comedi/drivers/mite.c
index 1a21916..447047f 100644
--- a/drivers/staging/comedi/drivers/mite.c
+++ b/drivers/staging/comedi/drivers/mite.c
@@ -288,7 +288,6 @@ void mite_dma_arm(struct mite_channel *mite_chan)
int chor;
unsigned long flags;
 
-   MDPRINTK("mite_dma_arm ch%i\n", mite_chan->channel);
/*
 * memory barrier is intended to insure any twiddling with the buffer
 * is done before writing to the mite to arm dma transfer
@@ -329,8 +328,6 @@ int mite_buf_change(struct mite_dma_descriptor_ring *ring,
 
n_links = async->prealloc_bufsz >> PAGE_SHIFT;
 
-   MDPRINTK("ring->hw_dev=%p, n_links=0x%04x\n", ring->hw_dev, n_links);
-
ring->descriptors =
dma_alloc_coherent(ring->hw_dev,
   n_links * sizeof(struct mite_dma_descriptor),
@@ -368,8 +365,6 @@ void mite_prep_dma(struct mite_channel *mite_chan,
unsigned int chor, chcr, mcr, dcr, lkcr;
struct mite_struct *mite = mite_chan->mite;
 
-   MDPRINTK("mite_prep_dma ch%i\n", mite_chan->channel);
-
/* reset DMA and FIFO */
chor = CHOR_DMARESET | CHOR_FRESET;
writel(chor, mite->mite_io_addr + MITE_CHOR(mite_chan->channel));
@@ -448,8 +443,6 @@ void mite_prep_dma(struct mite_channel *mite_chan,
/* starting address for link chaining */
writel(mite_chan->ring->descriptors_dma_addr,
   mite->mite_io_addr + MITE_LKAR(mite_chan->channel));
-
-   MDPRINTK("exit mite_prep_dma\n");
 }
 EXPORT_SYMBOL_GPL(mite_prep_dma);
 
@@ -515,8 +508,6 @@ unsigned mite_dma_tcr(struct mite_channel *mite_chan)
 
lkar = readl(mite->mite_io_addr + MITE_LKAR(mite_chan->channel));
tcr = readl(mite->mite_io_addr + MITE_TCR(mite_chan->channel));
-   MDPRINTK("mite_dma_tcr ch%i, lkar=0x%08x tcr=%d\n", mite_chan->channel,
-lkar, tcr);
 
return tcr;
 }
diff --git a/drivers/staging/comedi/drivers/mite.h 
b/drivers/staging/comedi/drivers/mite.h
index 8423b8b..1d72149 100644
--- a/drivers/staging/comedi/drivers/mite.h
+++ b/drivers/staging/comedi/drivers/mite.h
@@ -24,15 +24,8 @@
 #include 
 #include "../comedidev.h"
 
-/*  #define DEBUG_MITE */
 #define PCIMIO_COMPAT
 
-#ifdef DEBUG_MITE
-#define MDPRINTK(format, args...)  pr_debug(format , ## args)
-#else
-#define MDPRINTK(format, args...)  do { } while (0)
-#endif
-
 #define MAX_MITE_DMA_CHANNELS 8
 
 struct mite_dma_descriptor {
diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index 5113397..0581852 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -63,10 +63,6 @@
 #include "mite.h"
 #include "comedi_fc.h"
 
-#ifndef MDPRINTK
-#define MDPRINTK(format, args...)
-#endif
-
 /* A timeout count */
 #define NI_TIMEOUT 1000
 static const unsigned old_RTSI_clock_channel = 7;
@@ -1214,12 +1210,9 @@ static void handle_b_interrupt(struct comedi_device *dev,
s->async->events |= COMEDI_CB_OVERFLOW;
}
 
-   if (b_status & AO_BC_TC_St) {
-   MDPRINTK
-   ("ni_mio_common: AO BC_TC status=0x%04x status2=0x%04x\n",
-b_status, devpriv->stc_readw(dev, AO_Status_2_Register));
+   if (b_status & AO_BC_TC_St)
s->async->events |= COMEDI_CB_EOA;
-   }
+
 #ifndef PCIDMA
if (b_status & AO_FIFO_Request_St) {
int ret;
@@ -2392,7 +2385,6 @@ static int ni_ai_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
unsigned int stop_count;
int interrupt_a_enable = 0;
 
-   MDPRINTK("ni_ai_cmd\n");
if (dev->irq == 0) {
comedi_error(dev, "cannot run command without an irq");
return -EIO;
@@ -2630,15 +2622,11 @@ static int ni_ai_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
 
ni_set_bits(dev, Interrupt_A_Enable_Register,
interrupt_a_enable, 1);
-
-   MDPRINTK("Interrupt_A_Enable_Register = 0x%04x\n",
-devpriv->int_a_enable_reg);
} else {
/* interrupt on nothing */
ni_set_bits(dev, Interrupt_A_Enable_Register, ~0, 0);
 
/* XXX start polling if necessary */
-   MDPRINTK("interrupting on nothing\n");
}

[PATCH v2 00/26] cleanup debugging support

2013-11-26 Thread H Hartley Sweeten
Currently the COMEDI_DEBUG option enables the comedi_debug module parameter as
well as a DPRINTK() macro. To actually get debug messages to display the 
kernel
still needs to be built with the -DDEBUG flag.

Cleanup all the custom uses of DEBUG in comedi and use the COMEDI_DEBUG option
to enable the ccflag -DDEBUG in the comedi subsystem.

Remove all uses of the DPRINTK macro and just use dev_dbg() or pr_debug() 
instead.
Remove any debug messages that are just added noise.

Tidy up all the private debugging implementations in the comedi drivers.

v2: Rebase series to Greg's staging-next tree.
Add Ian Abbott's Reviewed-by for patches 1-25

The first 14 patches of the original 39 patch series have already been applied
to Greg's staging-next tree. This series just includes the unapplied patches.
The last patch in this series is new.

H Hartley Sweeten (26):
  staging: comedi: comedi_fops: remove use of DPRINTK
  staging: comedi: ni_pcidio: remove DEBUG_FLAGS define and code
  staging: comedi: ni_pcidio: remove debug_int()
  staging: comedi: ni_pcidio: remove use of DPRINTK
  staging: comedi: remove DPRINTK macro
  staging: comedi: mite: remove MDPRINTK macro
  staging: comedi: mite: remove DEBUG_MITE code
  staging: comedi: cb_pcidas64: remove DEBUG_PRINT
  staging: comedi: gsc_hpdi: remove DEBUG_PRINT
  staging: comedi: ni_at_a2150: remove A2150_DEBUG
  staging: comedi: cb_pcimdas: remove CBPCIMDAS_DEBUG
  staging: comedi: ni_pcimio: remove PCI_DEBUG
  staging: comedi: pcmmio: remove DAMMIT_ITS_BROKEN debug
  staging: comedi: pcmmio: remove commented out debug code
  staging: comedi: dyna_pci10xx: convert a KERN_DEBUG message to dev_dbg()
  staging: comedi: pcmmio: convert a KERN_DEBUG message to dev_dbg()
  staging: comedi: c6xdigio: remove unnecessary c6xdigio_pwmo_insn_read()
  staging: comedi: dt2814: remove disabled irq probe code
  staging: comedi: pcl818: remove an unnecessary printk(KERN_DEBUG ...
  staging: comedi: dmm32at: remove some unnecessary printk(KERN_DEBUG ...
  staging: comedi: ni_mio_common: remove unused NI_CS5529_DEBUG code
  staging: comedi: ni_mio_common: remove DEBUG_DIO messages
  staging: comedi: ni_mio_common: remove DEBUG_STATUS_B messages
  staging: comedi: ni_mio_common: remove DEBUG_STATUS_A messages
  staging: comedi: ni_mio_common: remove DEBUG_INTERRUPT messages
  staging: comedi: unionxx5: tidy up some dev_{level} messages

 drivers/staging/comedi/comedi_fops.c   | 119 ++-
 drivers/staging/comedi/comedidev.h |   2 -
 drivers/staging/comedi/drivers/c6xdigio.c  |   9 --
 drivers/staging/comedi/drivers/cb_pcidas64.c   | 126 +---
 drivers/staging/comedi/drivers/cb_pcimdas.c|   3 -
 drivers/staging/comedi/drivers/dmm32at.c   |   6 -
 drivers/staging/comedi/drivers/dt2814.c|  26 
 drivers/staging/comedi/drivers/dyna_pci10xx.c  |   3 +-
 drivers/staging/comedi/drivers/gsc_hpdi.c  |  78 
 drivers/staging/comedi/drivers/mite.c  | 143 --
 drivers/staging/comedi/drivers/mite.h  |  12 --
 drivers/staging/comedi/drivers/ni_at_a2150.c   |  25 
 drivers/staging/comedi/drivers/ni_mio_common.c | 157 +
 drivers/staging/comedi/drivers/ni_pcidio.c | 129 +---
 drivers/staging/comedi/drivers/ni_pcimio.c |   2 -
 drivers/staging/comedi/drivers/pcl818.c|   2 -
 drivers/staging/comedi/drivers/pcmmio.c|  35 +-
 drivers/staging/comedi/drivers/unioxx5.c   |  32 ++---
 18 files changed, 97 insertions(+), 812 deletions(-)

-- 
1.8.4.4

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


[PATCH v2 25/26] staging: comedi: ni_mio_common: remove DEBUG_INTERRUPT messages

2013-11-26 Thread H Hartley Sweeten
Defining DEBUG_INTERRUPT enables some function trace messages  during the
interrupt. These messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 24 
 1 file changed, 24 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index 2ca37b6..65db6ad 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -52,8 +52,6 @@
fully tested as yet. Terry Barnaby, BEAM Ltd.
 */
 
-/* #define DEBUG_INTERRUPT */
-
 #include 
 #include 
 #include 
@@ -1029,11 +1027,6 @@ static void handle_a_interrupt(struct comedi_device 
*dev, unsigned short status,
if (s->type == COMEDI_SUBD_UNUSED)
return;
 
-#ifdef DEBUG_INTERRUPT
-   printk
-   ("ni_mio_common: interrupt: a_status=%04x ai_mite_status=%08x\n",
-status, ai_mite_status);
-#endif
 #ifdef PCIDMA
if (ai_mite_status & CHSR_LINKC) {
ni_sync_ai_dma(dev);
@@ -1081,9 +1074,6 @@ static void handle_a_interrupt(struct comedi_device *dev, 
unsigned short status,
return;
}
if (status & AI_SC_TC_St) {
-#ifdef DEBUG_INTERRUPT
-   printk("ni_mio_common: SC_TC interrupt\n");
-#endif
if (!devpriv->ai_continuous) {
shutdown_ai_command(dev);
}
@@ -1110,15 +1100,6 @@ static void handle_a_interrupt(struct comedi_device 
*dev, unsigned short status,
}
 
ni_event(dev, s);
-
-#ifdef DEBUG_INTERRUPT
-   status = devpriv->stc_readw(dev, AI_Status_1_Register);
-   if (status & Interrupt_A_St) {
-   printk
-   ("handle_a_interrupt: didn't clear interrupt? 
status=0x%x\n",
-status);
-   }
-#endif
 }
 
 static void ack_b_interrupt(struct comedi_device *dev, unsigned short b_status)
@@ -1158,11 +1139,6 @@ static void handle_b_interrupt(struct comedi_device *dev,
struct comedi_subdevice *s = &dev->subdevices[NI_AO_SUBDEV];
/* unsigned short ack=0; */
 
-#ifdef DEBUG_INTERRUPT
-   printk("ni_mio_common: interrupt: b_status=%04x m1_status=%08x\n",
-  b_status, ao_mite_status);
-#endif
-
 #ifdef PCIDMA
/* Currently, mite.c requires us to handle LINKC */
if (ao_mite_status & CHSR_LINKC) {
-- 
1.8.4.4

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


[PATCH v2 16/26] staging: comedi: pcmmio: convert a KERN_DEBUG message to dev_dbg()

2013-11-26 Thread H Hartley Sweeten
Convert a printk(KERN_DEBUG ... message to dev_dbg().

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcmmio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcmmio.c 
b/drivers/staging/comedi/drivers/pcmmio.c
index 6da836e..063496d 100644
--- a/drivers/staging/comedi/drivers/pcmmio.c
+++ b/drivers/staging/comedi/drivers/pcmmio.c
@@ -476,9 +476,9 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
 * TODO here: dispatch io lines to subdevs
 * with commands..
 */
-   printk
-   (KERN_DEBUG "got edge detect interrupt %d 
asic %d which_chans: %06x\n",
-irq, asic, triggered);
+   dev_dbg(dev->class_dev,
+   "got edge detect interrupt %d asic %d 
which_chans: %06x\n",
+   irq, asic, triggered);
for (i = 2; i < dev->n_subdevices; i++) {
s = &dev->subdevices[i];
/*
-- 
1.8.4.4

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


[PATCH v2 22/26] staging: comedi: ni_mio_common: remove DEBUG_DIO messages

2013-11-26 Thread H Hartley Sweeten
Defining DEBUG_DIO simply enables some function trace messages. These are
just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 22 ++
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index f44013c..4bf0ef2 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -3798,10 +3798,6 @@ static int ni_serial_insn_config(struct comedi_device 
*dev,
 
switch (data[0]) {
case INSN_CONFIG_SERIAL_CLOCK:
-
-#ifdef DEBUG_DIO
-   printk("SPI serial clock Config cd\n", data[1]);
-#endif
devpriv->serial_hw_mode = 1;
devpriv->dio_control |= DIO_HW_Serial_Enable;
 
@@ -3890,10 +3886,6 @@ static int ni_serial_hw_readwrite8(struct comedi_device 
*dev,
unsigned int status1;
int err = 0, count = 20;
 
-#ifdef DEBUG_DIO
-   printk("ni_serial_hw_readwrite8: outputting 0x%x\n", data_out);
-#endif
-
devpriv->dio_output &= ~DIO_Serial_Data_Mask;
devpriv->dio_output |= DIO_Serial_Data_Out(data_out);
devpriv->stc_writew(dev, devpriv->dio_output, DIO_Output_Register);
@@ -3927,12 +3919,8 @@ static int ni_serial_hw_readwrite8(struct comedi_device 
*dev,
   DIO_Serial_IO_In_Progress_St goes high one bit too early. */
udelay((devpriv->serial_interval_ns + 999) / 1000);
 
-   if (data_in != NULL) {
+   if (data_in != NULL)
*data_in = devpriv->stc_readw(dev, DIO_Serial_Input_Register);
-#ifdef DEBUG_DIO
-   printk("ni_serial_hw_readwrite8: inputted 0x%x\n", *data_in);
-#endif
-   }
 
 Error:
devpriv->stc_writew(dev, devpriv->dio_control, DIO_Control_Register);
@@ -3948,10 +3936,6 @@ static int ni_serial_sw_readwrite8(struct comedi_device 
*dev,
struct ni_private *devpriv = dev->private;
unsigned char mask, input = 0;
 
-#ifdef DEBUG_DIO
-   printk("ni_serial_sw_readwrite8: outputting 0x%x\n", data_out);
-#endif
-
/* Wait for one bit before transfer */
udelay((devpriv->serial_interval_ns + 999) / 1000);
 
@@ -3988,9 +3972,7 @@ static int ni_serial_sw_readwrite8(struct comedi_device 
*dev,
input |= mask;
}
}
-#ifdef DEBUG_DIO
-   printk("ni_serial_sw_readwrite8: inputted 0x%x\n", input);
-#endif
+
if (data_in)
*data_in = input;
 
-- 
1.8.4.4

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


[PATCH v2 23/26] staging: comedi: ni_mio_common: remove DEBUG_STATUS_B messages

2013-11-26 Thread H Hartley Sweeten
Defining DEBUG_STATUS_B enables dumping of a status register during the
interrupt. These messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 29 --
 1 file changed, 29 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index 4bf0ef2..1ae8f97 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -54,7 +54,6 @@
 
 /* #define DEBUG_INTERRUPT */
 /* #define DEBUG_STATUS_A */
-/* #define DEBUG_STATUS_B */
 
 #include 
 #include 
@@ -267,11 +266,6 @@ static void ni_mio_print_status_a(int status);
 #else
 #define ni_mio_print_status_a(a)
 #endif
-#ifdef DEBUG_STATUS_B
-static void ni_mio_print_status_b(int status);
-#else
-#define ni_mio_print_status_b(a)
-#endif
 
 static int ni_ai_reset(struct comedi_device *dev, struct comedi_subdevice *s);
 #ifndef PCIDMA
@@ -1176,7 +1170,6 @@ static void handle_b_interrupt(struct comedi_device *dev,
 #ifdef DEBUG_INTERRUPT
printk("ni_mio_common: interrupt: b_status=%04x m1_status=%08x\n",
   b_status, ao_mite_status);
-   ni_mio_print_status_b(b_status);
 #endif
 
 #ifdef PCIDMA
@@ -1247,28 +1240,6 @@ static void ni_mio_print_status_a(int status)
 }
 #endif
 
-#ifdef DEBUG_STATUS_B
-static const char *const status_b_strings[] = {
-   "passthru1", "fifo", "G1_gate", "G1_TC",
-   "UI2_TC", "UPDATE", "UC_TC", "BC_TC",
-   "start1", "overrun", "start", "bc_tc_error",
-   "fifo_empty", "fifo_half_full", "fifo_full", "interrupt_b"
-};
-
-static void ni_mio_print_status_b(int status)
-{
-   int i;
-
-   printk("B status:");
-   for (i = 15; i >= 0; i--) {
-   if (status & (1 << i)) {
-   printk(" %s", status_b_strings[i]);
-   }
-   }
-   printk("\n");
-}
-#endif
-
 #ifndef PCIDMA
 
 static void ni_ao_fifo_load(struct comedi_device *dev,
-- 
1.8.4.4

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


[PATCH v2 18/26] staging: comedi: dt2814: remove disabled irq probe code

2013-11-26 Thread H Hartley Sweeten
The irq probe code in dt2814_attach() is disabled by an #if 0 block.
Just remove it.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2814.c | 26 --
 1 file changed, 26 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2814.c 
b/drivers/staging/comedi/drivers/dt2814.c
index 6514b9e..4b41478 100644
--- a/drivers/staging/comedi/drivers/dt2814.c
+++ b/drivers/staging/comedi/drivers/dt2814.c
@@ -256,26 +256,6 @@ static int dt2814_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
i = inb(dev->iobase + DT2814_DATA);
 
irq = it->options[1];
-#if 0
-   if (irq < 0) {
-   save_flags(flags);
-   sti();
-   irqs = probe_irq_on();
-
-   outb(0, dev->iobase + DT2814_CSR);
-
-   udelay(100);
-
-   irq = probe_irq_off(irqs);
-   restore_flags(flags);
-   if (inb(dev->iobase + DT2814_CSR) & DT2814_ERR)
-   printk(KERN_DEBUG "error probing irq (bad)\n");
-
-
-   i = inb(dev->iobase + DT2814_DATA);
-   i = inb(dev->iobase + DT2814_DATA);
-   }
-#endif
dev->irq = 0;
if (irq > 0) {
if (request_irq(irq, dt2814_interrupt, 0, "dt2814", dev)) {
@@ -286,12 +266,6 @@ static int dt2814_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
}
} else if (irq == 0) {
printk(KERN_WARNING "(no irq)\n");
-   } else {
-#if 0
-   printk(KERN_DEBUG "(probe returned multiple irqs--bad)\n");
-#else
-   printk(KERN_WARNING "(irq probe not implemented)\n");
-#endif
}
 
ret = comedi_alloc_subdevices(dev, 1);
-- 
1.8.4.4

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


[PATCH v2 26/26] staging: comedi: unionxx5: tidy up some dev_{level} messages

2013-11-26 Thread H Hartley Sweeten
Remove the "comedi%d:" prefix from the dev_{level} messages. This previx
will already be displayed.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/unioxx5.c | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/drivers/unioxx5.c 
b/drivers/staging/comedi/drivers/unioxx5.c
index d6b75d6..adf7cb7 100644
--- a/drivers/staging/comedi/drivers/unioxx5.c
+++ b/drivers/staging/comedi/drivers/unioxx5.c
@@ -146,8 +146,8 @@ static int __unioxx5_digital_read(struct comedi_subdevice 
*s,
channel_offset = __unioxx5_define_chan_offset(channel);
if (channel_offset < 0) {
dev_err(csdev,
-   "comedi%d: undefined channel %d. channel range is 0 .. 
23\n",
-   minor, channel);
+   "undefined channel %d. channel range is 0 .. 23\n",
+   channel);
return 0;
}
 
@@ -174,8 +174,9 @@ static int __unioxx5_analog_read(struct comedi_subdevice *s,
 
/* defining if given module can work on input */
if (usp->usp_module_type[module_no] & MODULE_OUTPUT_MASK) {
-   dev_err(csdev, "comedi%d: module in position %d with id 0x%02x 
is for output only",
-  minor, module_no, usp->usp_module_type[module_no]);
+   dev_err(csdev,
+   "module in position %d with id 0x%02x is for output 
only",
+   module_no, usp->usp_module_type[module_no]);
return 0;
}
 
@@ -191,8 +192,7 @@ static int __unioxx5_analog_read(struct comedi_subdevice *s,
 
/* if four bytes readding error occurs - return 0(false) */
if ((control & Rx4CA_ERR_MASK)) {
-   dev_err(csdev,
-   "comedi%d: 4 bytes error\n", minor);
+   dev_err(csdev, "4 bytes error\n");
return 0;
}
 
@@ -214,8 +214,9 @@ static int __unioxx5_digital_write(struct comedi_subdevice 
*s,
 
channel_offset = __unioxx5_define_chan_offset(channel);
if (channel_offset < 0) {
-   dev_err(csdev, "comedi%d: undefined channel %d. channel range 
is 0 .. 23\n",
-  minor, channel);
+   dev_err(csdev,
+   "undefined channel %d. channel range is 0 .. 23\n",
+   channel);
return 0;
}
 
@@ -246,8 +247,9 @@ static int __unioxx5_analog_write(struct comedi_subdevice 
*s,
 
/* defining if given module can work on output */
if (!(usp->usp_module_type[module] & MODULE_OUTPUT_MASK)) {
-   dev_err(csdev, "comedi%d: module in position %d with id 0x%0x 
is for input only!\n",
-  minor, module, usp->usp_module_type[module]);
+   dev_err(csdev,
+   "module in position %d with id 0x%0x is for input 
only!\n",
+   module, usp->usp_module_type[module]);
return 0;
}
 
@@ -329,16 +331,15 @@ static int unioxx5_insn_config(struct comedi_device *dev,
 
if (type != MODULE_DIGITAL) {
dev_err(dev->class_dev,
-   "comedi%d: channel configuration accessible only for 
digital modules\n",
-   dev->minor);
+   "channel configuration accessible only for digital 
modules\n");
return -1;
}
 
channel_offset = __unioxx5_define_chan_offset(channel);
if (channel_offset < 0) {
dev_err(dev->class_dev,
-   "comedi%d: undefined channel %d. channel range is 0 .. 
23\n",
-   dev->minor, channel);
+   "undefined channel %d. channel range is 0 .. 23\n",
+   channel);
return -1;
}
 
@@ -353,8 +354,7 @@ static int unioxx5_insn_config(struct comedi_device *dev,
flags |= mask;
break;
default:
-   dev_err(dev->class_dev,
-   "comedi%d: unknown flag\n", dev->minor);
+   dev_err(dev->class_dev, "unknown flag\n");
return -1;
}
 
-- 
1.8.4.4

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


[PATCH v2 08/26] staging: comedi: cb_pcidas64: remove DEBUG_PRINT

2013-11-26 Thread H Hartley Sweeten
The DEBUG_PRINT macro in this driver is used to output development
debug tracing messages. These messages are just added noise. Remove
them.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/cb_pcidas64.c | 126 +--
 1 file changed, 3 insertions(+), 123 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c 
b/drivers/staging/comedi/drivers/cb_pcidas64.c
index ff52065..a0053bb 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -94,15 +94,6 @@ TODO:
 #include "plx9080.h"
 #include "comedi_fc.h"
 
-#undef PCIDAS64_DEBUG  /*  disable debugging code */
-/* #define PCIDAS64_DEBUG enable debugging code */
-
-#ifdef PCIDAS64_DEBUG
-#define DEBUG_PRINT(format, args...)  pr_debug(format, ## args)
-#else
-#define DEBUG_PRINT(format, args...)  no_printk(format, ## args)
-#endif
-
 #define TIMER_BASE 25  /*  40MHz master clock */
 /* 100kHz 'prescaled' clock for slow acquisition,
  * maybe I'll support this someday */
@@ -1252,8 +1243,6 @@ static void disable_ai_interrupts(struct comedi_device 
*dev)
writew(devpriv->intr_enable_bits,
   devpriv->main_iobase + INTR_ENABLE_REG);
spin_unlock_irqrestore(&dev->spinlock, flags);
-
-   DEBUG_PRINT("intr enable bits 0x%x\n", devpriv->intr_enable_bits);
 }
 
 static void enable_ai_interrupts(struct comedi_device *dev,
@@ -1277,7 +1266,6 @@ static void enable_ai_interrupts(struct comedi_device 
*dev,
devpriv->intr_enable_bits |= bits;
writew(devpriv->intr_enable_bits,
   devpriv->main_iobase + INTR_ENABLE_REG);
-   DEBUG_PRINT("intr enable bits 0x%x\n", devpriv->intr_enable_bits);
spin_unlock_irqrestore(&dev->spinlock, flags);
 }
 
@@ -1292,38 +1280,6 @@ static void init_plx9080(struct comedi_device *dev)
devpriv->plx_control_bits =
readl(devpriv->plx9080_iobase + PLX_CONTROL_REG);
 
-   /*  plx9080 dump */
-   DEBUG_PRINT(" plx interrupt status 0x%x\n",
-   readl(plx_iobase + PLX_INTRCS_REG));
-   DEBUG_PRINT(" plx id bits 0x%x\n", readl(plx_iobase + PLX_ID_REG));
-   DEBUG_PRINT(" plx control reg 0x%x\n", devpriv->plx_control_bits);
-   DEBUG_PRINT(" plx mode/arbitration reg 0x%x\n",
-   readl(plx_iobase + PLX_MARB_REG));
-   DEBUG_PRINT(" plx region0 reg 0x%x\n",
-   readl(plx_iobase + PLX_REGION0_REG));
-   DEBUG_PRINT(" plx region1 reg 0x%x\n",
-   readl(plx_iobase + PLX_REGION1_REG));
-
-   DEBUG_PRINT(" plx revision 0x%x\n",
-   readl(plx_iobase + PLX_REVISION_REG));
-   DEBUG_PRINT(" plx dma channel 0 mode 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_MODE_REG));
-   DEBUG_PRINT(" plx dma channel 1 mode 0x%x\n",
-   readl(plx_iobase + PLX_DMA1_MODE_REG));
-   DEBUG_PRINT(" plx dma channel 0 pci address 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_PCI_ADDRESS_REG));
-   DEBUG_PRINT(" plx dma channel 0 local address 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_LOCAL_ADDRESS_REG));
-   DEBUG_PRINT(" plx dma channel 0 transfer size 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_TRANSFER_SIZE_REG));
-   DEBUG_PRINT(" plx dma channel 0 descriptor 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_DESCRIPTOR_REG));
-   DEBUG_PRINT(" plx dma channel 0 command status 0x%x\n",
-   readb(plx_iobase + PLX_DMA0_CS_REG));
-   DEBUG_PRINT(" plx dma channel 0 threshold 0x%x\n",
-   readl(plx_iobase + PLX_DMA0_THRESHOLD_REG));
-   DEBUG_PRINT(" plx bigend 0x%x\n", readl(plx_iobase + PLX_BIGEND_REG));
-
 #ifdef __BIG_ENDIAN
bits = BIGEND_DMA0 | BIGEND_DMA1;
 #else
@@ -1417,9 +1373,6 @@ static int set_ai_fifo_segment_length(struct 
comedi_device *dev,
 
devpriv->ai_fifo_segment_length = num_increments * increment_size;
 
-   DEBUG_PRINT("set hardware fifo segment length to %i\n",
-   devpriv->ai_fifo_segment_length);
-
return devpriv->ai_fifo_segment_length;
 }
 
@@ -1441,8 +1394,6 @@ static int set_ai_fifo_size(struct comedi_device *dev, 
unsigned int num_samples)
 
num_samples = retval * fifo->num_segments * fifo->sample_packing_ratio;
 
-   DEBUG_PRINT("set hardware fifo size to %i\n", num_samples);
-
return num_samples;
 }
 
@@ -1538,8 +1489,6 @@ static int alloc_and_init_dma_members(struct 
comedi_device *dev)
if (devpriv->ai_dma_desc == NULL)
return -ENOMEM;
 
-   DEBUG_PRINT("ai dma descriptors start at bus addr 0x%llx\n",
-   (unsigned long long)devpriv->ai_dma_desc_bus_addr);
if (ao_cmd_is_supported(thisboard)) {
devpriv->ao_dma_desc =
pci_alloc_consistent(pcidev,
@@ -1548,9 +1497,6 @@ static int al

[PATCH v2 24/26] staging: comedi: ni_mio_common: remove DEBUG_STATUS_A messages

2013-11-26 Thread H Hartley Sweeten
Defining DEBUG_STATUS_A enables dumping of a status register during the
interrupt. These messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 31 --
 1 file changed, 31 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index 1ae8f97..2ca37b6 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -53,7 +53,6 @@
 */
 
 /* #define DEBUG_INTERRUPT */
-/* #define DEBUG_STATUS_A */
 
 #include 
 #include 
@@ -261,12 +260,6 @@ static int ni_rtsi_insn_config(struct comedi_device *dev,
 static void caldac_setup(struct comedi_device *dev, struct comedi_subdevice 
*s);
 static int ni_read_eeprom(struct comedi_device *dev, int addr);
 
-#ifdef DEBUG_STATUS_A
-static void ni_mio_print_status_a(int status);
-#else
-#define ni_mio_print_status_a(a)
-#endif
-
 static int ni_ai_reset(struct comedi_device *dev, struct comedi_subdevice *s);
 #ifndef PCIDMA
 static void ni_handle_fifo_half_full(struct comedi_device *dev);
@@ -1040,7 +1033,6 @@ static void handle_a_interrupt(struct comedi_device *dev, 
unsigned short status,
printk
("ni_mio_common: interrupt: a_status=%04x ai_mite_status=%08x\n",
 status, ai_mite_status);
-   ni_mio_print_status_a(status);
 #endif
 #ifdef PCIDMA
if (ai_mite_status & CHSR_LINKC) {
@@ -1077,7 +1069,6 @@ static void handle_a_interrupt(struct comedi_device *dev, 
unsigned short status,
  AI_SC_TC_Error_St)) {
printk("ni_mio_common: ai error a_status=%04x\n",
   status);
-   ni_mio_print_status_a(status);
 
shutdown_ai_command(dev);
 
@@ -1218,28 +1209,6 @@ static void handle_b_interrupt(struct comedi_device *dev,
ni_event(dev, s);
 }
 
-#ifdef DEBUG_STATUS_A
-static const char *const status_a_strings[] = {
-   "passthru0", "fifo", "G0_gate", "G0_TC",
-   "stop", "start", "sc_tc", "start1",
-   "start2", "sc_tc_error", "overflow", "overrun",
-   "fifo_empty", "fifo_half_full", "fifo_full", "interrupt_a"
-};
-
-static void ni_mio_print_status_a(int status)
-{
-   int i;
-
-   printk("A status:");
-   for (i = 15; i >= 0; i--) {
-   if (status & (1 << i)) {
-   printk(" %s", status_a_strings[i]);
-   }
-   }
-   printk("\n");
-}
-#endif
-
 #ifndef PCIDMA
 
 static void ni_ao_fifo_load(struct comedi_device *dev,
-- 
1.8.4.4

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


[PATCH v2 13/26] staging: comedi: pcmmio: remove DAMMIT_ITS_BROKEN debug

2013-11-26 Thread H Hartley Sweeten
These debug messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Reviewed-by: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcmmio.c | 22 --
 1 file changed, 22 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcmmio.c 
b/drivers/staging/comedi/drivers/pcmmio.c
index 14cee3a..1ebc9d2 100644
--- a/drivers/staging/comedi/drivers/pcmmio.c
+++ b/drivers/staging/comedi/drivers/pcmmio.c
@@ -250,11 +250,6 @@ static int pcmmio_dio_insn_bits(struct comedi_device *dev,
/* The insn data is a mask in data[0] and the new data
 * in data[1], each channel cooresponding to a bit. */
 
-#ifdef DAMMIT_ITS_BROKEN
-   /* DEBUG */
-   printk(KERN_DEBUG "write mask: %08x  data: %08x\n", data[0], data[1]);
-#endif
-
s->state = 0;
 
for (byte_no = 0; byte_no < s->n_chan / CHANS_PER_PORT; ++byte_no) {
@@ -271,14 +266,6 @@ static int pcmmio_dio_insn_bits(struct comedi_device *dev,
 
byte = inb(ioaddr); /* read all 8-bits for this port */
 
-#ifdef DAMMIT_ITS_BROKEN
-   /* DEBUG */
-   printk
-   (KERN_DEBUG "byte %d wmb %02x db %02x offset %02d io %04x,"
-" data_in %02x ", byte_no, (unsigned)write_mask_byte,
-(unsigned)data_byte, offset, ioaddr, (unsigned)byte);
-#endif
-
if (write_mask_byte) {
/*
 * this byte has some write_bits
@@ -291,10 +278,6 @@ static int pcmmio_dio_insn_bits(struct comedi_device *dev,
/* Write out the new digital output state */
outb(byte, ioaddr);
}
-#ifdef DAMMIT_ITS_BROKEN
-   /* DEBUG */
-   printk(KERN_DEBUG "data_out_byte %02x\n", (unsigned)byte);
-#endif
/* save the digital input lines for this byte.. */
s->state |= ((unsigned int)byte) << offset;
}
@@ -302,11 +285,6 @@ static int pcmmio_dio_insn_bits(struct comedi_device *dev,
/* now return the DIO lines to data[1] - note they came inverted! */
data[1] = ~s->state;
 
-#ifdef DAMMIT_ITS_BROKEN
-   /* DEBUG */
-   printk(KERN_DEBUG "s->state %08x data_out %08x\n", s->state, data[1]);
-#endif
-
return insn->n;
 }
 
-- 
1.8.4.4

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


RE: [PATCH] staging: dwc2: set up all module params

2013-11-26 Thread Paul Zimmerman
> From: Stephen Warren [mailto:swar...@wwwdotorg.org]
> Sent: Monday, November 25, 2013 9:03 PM
> 
> The DWC2 USB controller in the BCM2835 (Raspberry Pi) needs some non-
> default parameters. Select these based on the compatible value from the
> DT node. For all other HW, fall back to the default parameters currently
> in use.
> 
> The values in params_bcm2835[] were posted to the mailing list by Paul
> quite some time ago. I made a couple of minor modifications since then;
> to set ahbcfg instead of ahb_single, and to set uframe_sched.

Hi Stephen,

I don't see any code in this patch that is setting uframe_sched?

> diff --git a/drivers/staging/dwc2/platform.c b/drivers/staging/dwc2/platform.c
> index 4d9fac0..20586dc 100644
> --- a/drivers/staging/dwc2/platform.c
> +++ b/drivers/staging/dwc2/platform.c
> @@ -39,6 +39,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
> 
>  #include "core.h"
> @@ -46,6 +47,33 @@
> 
>  static const char dwc2_driver_name[] = "dwc2";
> 
> +static const struct dwc2_core_params params_bcm2835 = {
> + .otg_cap= 0,/* HNP/SRP capable */
> + .otg_ver= 0,/* 1.3 */
> + .dma_enable = 1,
> + .dma_desc_enable= 0,
> + .speed  = 0,/* High Speed */
> + .enable_dynamic_fifo= 1,
> + .en_multiple_tx_fifo= 1,
> + .host_rx_fifo_size  = 774,  /* 774 DWORDs */
> + .host_nperio_tx_fifo_size   = 256,  /* 256 DWORDs */
> + .host_perio_tx_fifo_size= 512,  /* 512 DWORDs */
> + .max_transfer_size  = 65535,
> + .max_packet_count   = 511,
> + .host_channels  = 8,
> + .phy_type   = 1,/* UTMI */
> + .phy_utmi_width = 8,/* 8 bits */
> + .phy_ulpi_ddr   = 0,/* Single */
> + .phy_ulpi_ext_vbus  = 0,
> + .i2c_enable = 0,
> + .ulpi_fs_ls = 0,
> + .host_support_fs_ls_low_power   = 0,
> + .host_ls_low_power_phy_clk  = 0,/* 48 MHz */
> + .ts_dline   = 0,
> + .reload_ctl = 0,
> + .ahbcfg = 0x10,

I guess uframe_sched should be set here.

> +};

-- 
Paul

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


Re: [PATCH] staging: dwc2: set up all module params

2013-11-26 Thread Stephen Warren
On 11/26/2013 12:27 PM, Paul Zimmerman wrote:
>> From: Stephen Warren [mailto:swar...@wwwdotorg.org]
>> Sent: Monday, November 25, 2013 9:03 PM
>>
>> The DWC2 USB controller in the BCM2835 (Raspberry Pi) needs some non-
>> default parameters. Select these based on the compatible value from the
>> DT node. For all other HW, fall back to the default parameters currently
>> in use.
>>
>> The values in params_bcm2835[] were posted to the mailing list by Paul
>> quite some time ago. I made a couple of minor modifications since then;
>> to set ahbcfg instead of ahb_single, and to set uframe_sched.
> 
> Hi Stephen,
> 
> I don't see any code in this patch that is setting uframe_sched?

Hmm, that's true. What value should it be set to for the BCM2835, do you
know? I obviously have it set to 0, which seems to work out OK...
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH] staging: dwc2: set up all module params

2013-11-26 Thread Paul Zimmerman
> From: Stephen Warren [mailto:swar...@wwwdotorg.org]
> Sent: Tuesday, November 26, 2013 11:43 AM
> 
> On 11/26/2013 12:27 PM, Paul Zimmerman wrote:
> >> From: Stephen Warren [mailto:swar...@wwwdotorg.org]
> >> Sent: Monday, November 25, 2013 9:03 PM
> >>
> >> The DWC2 USB controller in the BCM2835 (Raspberry Pi) needs some non-
> >> default parameters. Select these based on the compatible value from the
> >> DT node. For all other HW, fall back to the default parameters currently
> >> in use.
> >>
> >> The values in params_bcm2835[] were posted to the mailing list by Paul
> >> quite some time ago. I made a couple of minor modifications since then;
> >> to set ahbcfg instead of ahb_single, and to set uframe_sched.
> >
> > Hi Stephen,
> >
> > I don't see any code in this patch that is setting uframe_sched?
> 
> Hmm, that's true. What value should it be set to for the BCM2835, do you
> know? I obviously have it set to 0, which seems to work out OK...

It definitely should be enabled for the Pi, so set it to 1.

-- 
Paul

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


[PATCH 10/60] staging: comedi: cb_pcimdas: remove commented out irq init code

2013-11-26 Thread H Hartley Sweeten
This driver does not have interrupt support. Remove the commented out
code that requests the irq.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/cb_pcimdas.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c 
b/drivers/staging/comedi/drivers/cb_pcimdas.c
index b25fa5d..a75e501 100644
--- a/drivers/staging/comedi/drivers/cb_pcimdas.c
+++ b/drivers/staging/comedi/drivers/cb_pcimdas.c
@@ -219,15 +219,6 @@ static int cb_pcimdas_auto_attach(struct comedi_device 
*dev,
devpriv->BADR3 = pci_resource_start(pcidev, 3);
iobase_8255 = pci_resource_start(pcidev, 4);
 
-/* Dont support IRQ yet */
-/*  get irq */
-/* if(request_irq(pcidev->irq, cb_pcimdas_interrupt, IRQF_SHARED, 
"cb_pcimdas", dev )) */
-/* { */
-/* printk(" unable to allocate irq %u\n", pcidev->irq); */
-/* return -EINVAL; */
-/* } */
-/* dev->irq = pcidev->irq; */
-
ret = comedi_alloc_subdevices(dev, 3);
if (ret)
return ret;
-- 
1.8.4.4

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


[PATCH 07/60] staging: comedi: adq12b: remove commented out debug message

2013-11-26 Thread H Hartley Sweeten
Remove the commented out message, it would just be added noise.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adq12b.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adq12b.c 
b/drivers/staging/comedi/drivers/adq12b.c
index 8150a67..79e06b9 100644
--- a/drivers/staging/comedi/drivers/adq12b.c
+++ b/drivers/staging/comedi/drivers/adq12b.c
@@ -162,8 +162,6 @@ static int adq12b_ai_rinsn(struct comedi_device *dev,
hi = inb(dev->iobase + ADQ12B_ADHIG);
lo = inb(dev->iobase + ADQ12B_ADLOW);
 
-   /* printk("debug: chan=%d range=%d status=%d hi=%d lo=%d\n",
-  channel, range, status,  hi, lo); */
data[n] = (hi << 8) | lo;
 
}
-- 
1.8.4.4

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


[PATCH 03/60] staging: comedi: dmm32at: remove final attach noise and fix return value

2013-11-26 Thread H Hartley Sweeten
The "success" message after an attach is just added noise. Remove it.

The normal return value for "success" is 0.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dmm32at.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dmm32at.c 
b/drivers/staging/comedi/drivers/dmm32at.c
index cac8358..bd192de 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -793,11 +793,7 @@ static int dmm32at_attach(struct comedi_device *dev,
s->insn_bits = dmm32at_dio_insn_bits;
s->insn_config = dmm32at_dio_insn_config;
 
-   /* success */
-   printk(KERN_INFO "comedi%d: dmm32at: attached\n", dev->minor);
-
-   return 1;
-
+   return 0;
 }
 
 static struct comedi_driver dmm32at_driver = {
-- 
1.8.4.4

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


[PATCH 17/60] staging: comedi: dt2801: remove disabled code in dt2801_writedata

2013-11-26 Thread H Hartley Sweeten
The code that checks the DT_S_READY status is disabled. Just remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2801.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2801.c 
b/drivers/staging/comedi/drivers/dt2801.c
index 1dd8190..a1b022c 100644
--- a/drivers/staging/comedi/drivers/dt2801.c
+++ b/drivers/staging/comedi/drivers/dt2801.c
@@ -289,13 +289,6 @@ static int dt2801_writedata(struct comedi_device *dev, 
unsigned int data)
outb_p(data & 0xff, dev->iobase + DT2801_DATA);
return 0;
}
-#if 0
-   if (stat & DT_S_READY) {
-   printk
-   ("dt2801: ready flag set (bad!) in 
dt2801_writedata()\n");
-   return -EIO;
-   }
-#endif
} while (--timeout > 0);
 
return -ETIME;
-- 
1.8.4.4

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


[PATCH 09/60] staging: comedi: c6xdigio: remove commented out function trace messages

2013-11-26 Thread H Hartley Sweeten
These commented out messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/c6xdigio.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/staging/comedi/drivers/c6xdigio.c 
b/drivers/staging/comedi/drivers/c6xdigio.c
index 7512eaf..5034f66 100644
--- a/drivers/staging/comedi/drivers/c6xdigio.c
+++ b/drivers/staging/comedi/drivers/c6xdigio.c
@@ -94,8 +94,6 @@ static void C6X_pwmInit(unsigned long baseAddr)
 {
int timeout = 0;
 
-/* printk("Inside C6X_pwmInit\n"); */
-
WriteByteToHwPort(baseAddr, 0x70);
while (((ReadByteFromHwPort(baseAddr + 1) & 0x80) == 0)
   && (timeout < C6XDIGIO_TIME_OUT)) {
@@ -132,8 +130,6 @@ static void C6X_pwmOutput(unsigned long baseAddr, unsigned 
channel, int value)
int timeout = 0;
unsigned tmp;
 
-   /* printk("Inside C6X_pwmOutput\n"); */
-
pwm.cmd = value;
if (pwm.cmd > 498)
pwm.cmd = 498;
@@ -200,8 +196,6 @@ static int C6X_encInput(unsigned long baseAddr, unsigned 
channel)
int timeout = 0;
int tmp;
 
-   /* printk("Inside C6X_encInput\n"); */
-
enc.value = 0;
if (channel == 0)
ppcmd = 0x48;
@@ -295,8 +289,6 @@ static void C6X_encResetAll(unsigned long baseAddr)
 {
unsigned timeout = 0;
 
-/* printk("Inside C6X_encResetAll\n"); */
-
WriteByteToHwPort(baseAddr, 0x68);
while (((ReadByteFromHwPort(baseAddr + 1) & 0x80) == 0)
   && (timeout < C6XDIGIO_TIME_OUT)) {
@@ -330,7 +322,6 @@ static int c6xdigio_pwmo_insn_write(struct comedi_device 
*dev,
int i;
int chan = CR_CHAN(insn->chanspec);
 
-   /*   printk("c6xdigio_pwmo_insn_write %x\n", insn->n); */
for (i = 0; i < insn->n; i++) {
C6X_pwmOutput(dev->iobase, chan, data[i]);
/*devpriv->ao_readback[chan] = data[i]; */
@@ -342,7 +333,6 @@ static int c6xdigio_ei_insn_read(struct comedi_device *dev,
 struct comedi_subdevice *s,
 struct comedi_insn *insn, unsigned int *data)
 {
-   /*   printk("c6xdigio_ei__insn_read %x\n", insn->n); */
int n;
int chan = CR_CHAN(insn->chanspec);
 
@@ -354,12 +344,8 @@ static int c6xdigio_ei_insn_read(struct comedi_device *dev,
 
 static void board_init(struct comedi_device *dev)
 {
-
-   /* printk("Inside board_init\n"); */
-
C6X_pwmInit(dev->iobase);
C6X_encResetAll(dev->iobase);
-
 }
 
 static const struct pnp_device_id c6xdigio_pnp_tbl[] = {
-- 
1.8.4.4

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


[PATCH 11/60] staging: comedi: cb_pcimdas: remove unnecessary printk noise

2013-11-26 Thread H Hartley Sweeten
The ai read timeout will return -ETIMEDOUT. The printk is just added
noise. Remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/cb_pcimdas.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c 
b/drivers/staging/comedi/drivers/cb_pcimdas.c
index a75e501..a8c32b6 100644
--- a/drivers/staging/comedi/drivers/cb_pcimdas.c
+++ b/drivers/staging/comedi/drivers/cb_pcimdas.c
@@ -142,10 +142,9 @@ static int cb_pcimdas_ai_rinsn(struct comedi_device *dev,
if (!busy)
break;
}
-   if (i == TIMEOUT) {
-   printk("timeout\n");
+   if (i == TIMEOUT)
return -ETIMEDOUT;
-   }
+
/* read data */
data[n] = inw(dev->iobase + 0);
}
-- 
1.8.4.4

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


[PATCH 29/60] staging: comedi: dt282x: remove attach noise in dt282x_grab_dma()

2013-11-26 Thread H Hartley Sweeten
These messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt282x.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index d2f95bf..7de9c44 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -1060,10 +1060,8 @@ static int dt282x_grab_dma(struct comedi_device *dev, 
int dma1, int dma2)
 
devpriv->usedma = 0;
 
-   if (!dma1 && !dma2) {
-   printk(KERN_ERR " (no dma)");
+   if (!dma1 && !dma2)
return 0;
-   }
 
if (dma1 == dma2 || dma1 < 5 || dma2 < 5 || dma1 > 7 || dma2 > 7)
return -EINVAL;
@@ -1088,12 +1086,8 @@ static int dt282x_grab_dma(struct comedi_device *dev, 
int dma1, int dma2)
devpriv->dma_maxsize = PAGE_SIZE;
devpriv->dma[0].buf = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
devpriv->dma[1].buf = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
-   if (!devpriv->dma[0].buf || !devpriv->dma[1].buf) {
-   printk(KERN_ERR " can't get DMA memory");
+   if (!devpriv->dma[0].buf || !devpriv->dma[1].buf)
return -ENOMEM;
-   }
-
-   printk(KERN_INFO " (dma=%d,%d)", dma1, dma2);
 
devpriv->usedma = 1;
 
-- 
1.8.4.4

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


[PATCH 01/60] staging: comedi: pcmmio.c: remove kcalloc() failure message

2013-11-26 Thread H Hartley Sweeten
An allocation failure will have already displayed a message.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcmmio.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcmmio.c 
b/drivers/staging/comedi/drivers/pcmmio.c
index 063496d..ec098d8 100644
--- a/drivers/staging/comedi/drivers/pcmmio.c
+++ b/drivers/staging/comedi/drivers/pcmmio.c
@@ -991,11 +991,8 @@ static int pcmmio_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
devpriv->sprivs =
kcalloc(n_subdevs, sizeof(struct pcmmio_subdev_private),
GFP_KERNEL);
-   if (!devpriv->sprivs) {
-   printk(KERN_ERR "comedi%d: cannot allocate subdevice private 
data structures\n",
-   dev->minor);
+   if (!devpriv->sprivs)
return -ENOMEM;
-   }
 
ret = comedi_alloc_subdevices(dev, n_subdevs);
if (ret)
-- 
1.8.4.4

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


[PATCH 28/60] staging: comedi: dt282x: tidy up the irq support in dt282x_attach()

2013-11-26 Thread H Hartley Sweeten
An irq is only needed by this driver in order to support async commands.
Since it is optional, modify the attach so that if the request_irq() fails
the attach does not fail.

Remove the printk noise about the irq.

Only hookup the async command support if the request_irq() was successful.

Also, only call dt282x_grab_dma() if we have an irq since interrupt support
is needed to support dma.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt282x.c | 84 -
 1 file changed, 30 insertions(+), 54 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index c4ffedb..d2f95bf 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -1118,9 +1118,9 @@ static int dt282x_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
 {
const struct dt282x_board *board = comedi_board(dev);
struct dt282x_private *devpriv;
-   int i, irq;
-   int ret;
struct comedi_subdevice *s;
+   int ret;
+   int i;
 
ret = comedi_request_region(dev, it->options[0], DT2821_SIZE);
if (ret)
@@ -1144,53 +1144,23 @@ static int dt282x_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
}
/* should do board test */
 
-   irq = it->options[opt_irq];
-#if 0
-   if (irq < 0) {
-   unsigned long flags;
-   int irqs;
-
-   save_flags(flags);
-   sti();
-   irqs = probe_irq_on();
-
-   /* trigger interrupt */
-
-   udelay(100);
-
-   irq = probe_irq_off(irqs);
-   restore_flags(flags);
-   if (0 /* error */)
-   printk(KERN_ERR " error probing irq (bad)");
-   }
-#endif
-   if (irq > 0) {
-   printk(KERN_INFO " ( irq = %d )", irq);
-   ret = request_irq(irq, dt282x_interrupt, 0,
+   if (it->options[opt_irq] > 0) {
+   ret = request_irq(it->options[opt_irq], dt282x_interrupt, 0,
  dev->board_name, dev);
-   if (ret < 0) {
-   printk(KERN_ERR " failed to get irq\n");
-   return -EIO;
-   }
-   dev->irq = irq;
-   } else if (irq == 0) {
-   printk(KERN_INFO " (no irq)");
-   } else {
-#if 0
-   printk(KERN_INFO " (probe returned multiple irqs--bad)");
-#else
-   printk(KERN_INFO " (irq probe not implemented)");
-#endif
+   if (ret == 0)
+   dev->irq = it->options[opt_irq];
}
 
devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
if (!devpriv)
return -ENOMEM;
 
-   ret = dt282x_grab_dma(dev, it->options[opt_dma1],
- it->options[opt_dma2]);
-   if (ret < 0)
-   return ret;
+   if (dev->irq) {
+   ret = dt282x_grab_dma(dev, it->options[opt_dma1],
+ it->options[opt_dma2]);
+   if (ret < 0)
+   return ret;
+   }
 
ret = comedi_alloc_subdevices(dev, 3);
if (ret)
@@ -1198,22 +1168,25 @@ static int dt282x_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
 
s = &dev->subdevices[0];
 
-   dev->read_subdev = s;
/* ai subdevice */
s->type = COMEDI_SUBD_AI;
-   s->subdev_flags = SDF_READABLE | SDF_CMD_READ |
+   s->subdev_flags = SDF_READABLE |
((it->options[opt_diff]) ? SDF_DIFF : SDF_COMMON);
s->n_chan =
(it->options[opt_diff]) ? board->adchan_di : board->adchan_se;
s->insn_read = dt282x_ai_insn_read;
-   s->do_cmdtest = dt282x_ai_cmdtest;
-   s->do_cmd = dt282x_ai_cmd;
-   s->cancel = dt282x_ai_cancel;
s->maxdata = (1 << board->adbits) - 1;
-   s->len_chanlist = 16;
s->range_table =
opt_ai_range_lkup(board->ispgl, it->options[opt_ai_range]);
devpriv->ad_2scomp = it->options[opt_ai_twos];
+   if (dev->irq) {
+   dev->read_subdev = s;
+   s->subdev_flags |= SDF_CMD_READ;
+   s->len_chanlist = 16;
+   s->do_cmdtest = dt282x_ai_cmdtest;
+   s->do_cmd = dt282x_ai_cmd;
+   s->cancel = dt282x_ai_cancel;
+   }
 
s = &dev->subdevices[1];
 
@@ -1221,15 +1194,10 @@ static int dt282x_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
if (s->n_chan) {
/* ao subsystem */
s->type = COMEDI_SUBD_AO;
-   dev->write_subdev = s;
-   s->subdev_flags = SDF_WRITABLE | SDF_CMD_WRITE;
+   s->subdev_flags = SDF_WRITABLE;
s->insn_read = dt282x_ao_insn_read;
s->insn_write = dt282x_ao_insn_write;
- 

[PATCH 13/60] staging: comedi: dmm32at: remove unnecessary printk noise

2013-11-26 Thread H Hartley Sweeten
A timeout will return -ETIMEDOUT. The printks are just added noise.
Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dmm32at.c | 17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dmm32at.c 
b/drivers/staging/comedi/drivers/dmm32at.c
index bd192de..f057d79 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -199,10 +199,8 @@ static int dmm32at_ai_rinsn(struct comedi_device *dev,
if ((status & DMM32AT_STATUS) == 0)
break;
}
-   if (i == 4) {
-   printk(KERN_WARNING "dmm32at: timeout\n");
+   if (i == 4)
return -ETIMEDOUT;
-   }
 
/* convert n samples */
for (n = 0; n < insn->n; n++) {
@@ -214,10 +212,8 @@ static int dmm32at_ai_rinsn(struct comedi_device *dev,
if ((status & DMM32AT_STATUS) == 0)
break;
}
-   if (i == 4) {
-   printk(KERN_WARNING "dmm32at: timeout\n");
+   if (i == 4)
return -ETIMEDOUT;
-   }
 
/* read data */
lsb = inb(dev->iobase + DMM32AT_AILSB);
@@ -453,10 +449,8 @@ static int dmm32at_ai_cmd(struct comedi_device *dev, 
struct comedi_subdevice *s)
if ((status & DMM32AT_STATUS) == 0)
break;
}
-   if (i == 4) {
-   printk(KERN_WARNING "dmm32at: timeout\n");
+   if (i == 4)
return -ETIMEDOUT;
-   }
 
if (devpriv->ai_scans_left > 1) {
/* start the clock and enable the interrupts */
@@ -567,10 +561,9 @@ static int dmm32at_ao_winsn(struct comedi_device *dev,
if ((status & DMM32AT_DACBUSY) == 0)
break;
}
-   if (i == 4) {
-   printk(KERN_WARNING "dmm32at: timeout\n");
+   if (i == 4)
return -ETIMEDOUT;
-   }
+
/* dummy read to update trigger the output */
status = inb(dev->iobase + DMM32AT_DACMSB);
 
-- 
1.8.4.4

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


[PATCH 14/60] staging: comedi: dmm32at: remove commented out printk debug

2013-11-26 Thread H Hartley Sweeten
These printk messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dmm32at.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dmm32at.c 
b/drivers/staging/comedi/drivers/dmm32at.c
index f057d79..6fb8ce1 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -182,8 +182,6 @@ static int dmm32at_ai_rinsn(struct comedi_device *dev,
chan = CR_CHAN(insn->chanspec) & (s->n_chan - 1);
range = CR_RANGE(insn->chanspec);
 
-   /* printk("channel=0x%02x, range=%d\n",chan,range); */
-
/* zero scan and fifo control and reset fifo */
outb(DMM32AT_FIFORESET, dev->iobase + DMM32AT_FIFOCNTRL);
 
@@ -461,8 +459,6 @@ static int dmm32at_ai_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
outb(0xff, dev->iobase + DMM32AT_CONV);
}
 
-/* printk("dmmat32 in command\n"); */
-
 /* for(i=0;ichanlist_len;i++) */
 /* comedi_buf_put(s->async,i*100); */
 
@@ -550,7 +546,6 @@ static int dmm32at_ao_winsn(struct comedi_device *dev,
lo = data[i] & 0x00ff;
/* high byte also contains channel number */
hi = (data[i] >> 8) + chan * (1 << 6);
-   /* printk("writing 0x%02x  0x%02x\n",hi,lo); */
/* write the low and high values to the board */
outb(lo, dev->iobase + DMM32AT_DACLSB);
outb(hi, dev->iobase + DMM32AT_DACMSB);
-- 
1.8.4.4

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


[PATCH 21/60] staging: comedi: dt2811: remove disabled interrupt support code

2013-11-26 Thread H Hartley Sweeten
The interrupt support in this driver is incomplete due to the missing
comedi functions to support async commands.

Since the interrupt code is already disable just remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2811.c | 72 +
 1 file changed, 1 insertion(+), 71 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2811.c 
b/drivers/staging/comedi/drivers/dt2811.c
index 686d86c..115eb0a 100644
--- a/drivers/staging/comedi/drivers/dt2811.c
+++ b/drivers/staging/comedi/drivers/dt2811.c
@@ -42,7 +42,6 @@ Configuration options:
 */
 
 #include 
-#include 
 #include "../comedidev.h"
 
 static const struct comedi_lrange range_dt2811_pgh_ai_5_unipolar = {
@@ -227,33 +226,6 @@ static const struct comedi_lrange *dac_range_types[] = {
 
 #define DT2811_TIMEOUT 5
 
-#if 0
-static irqreturn_t dt2811_interrupt(int irq, void *d)
-{
-   int lo, hi;
-   int data;
-   struct comedi_device *dev = d;
-   struct dt2811_private *devpriv = dev->private;
-
-   if (!dev->attached) {
-   comedi_error(dev, "spurious interrupt");
-   return IRQ_HANDLED;
-   }
-
-   lo = inb(dev->iobase + DT2811_ADDATLO);
-   hi = inb(dev->iobase + DT2811_ADDATHI);
-
-   data = lo + (hi << 8);
-
-   if (!(--devpriv->ntrig)) {
-   /* how to turn off acquisition */
-   s->async->events |= COMEDI_SB_EOA;
-   }
-   comedi_event(dev, s);
-   return IRQ_HANDLED;
-}
-#endif
-
 static int dt2811_ai_insn(struct comedi_device *dev, struct comedi_subdevice 
*s,
  struct comedi_insn *insn, unsigned int *data)
 {
@@ -357,10 +329,7 @@ static int dt2811_do_insn_bits(struct comedi_device *dev,
 */
 static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig 
*it)
 {
-   /* int i, irq; */
-   /* unsigned long irqs; */
-   /* long flags; */
-
+   /* int i; */
const struct dt2811_board *board = comedi_board(dev);
struct dt2811_private *devpriv;
int ret;
@@ -377,45 +346,6 @@ static int dt2811_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
i = inb(dev->iobase + DT2811_ADDATHI);
 #endif
 
-#if 0
-   irq = it->options[1];
-   if (irq < 0) {
-   save_flags(flags);
-   sti();
-   irqs = probe_irq_on();
-
-   outb(DT2811_CLRERROR | DT2811_INTENB,
-dev->iobase + DT2811_ADCSR);
-   outb(0, dev->iobase + DT2811_ADGCR);
-
-   udelay(100);
-
-   irq = probe_irq_off(irqs);
-   restore_flags(flags);
-
-   /*outb(DT2811_CLRERROR|DT2811_INTENB,
-   dev->iobase+DT2811_ADCSR);*/
-
-   if (inb(dev->iobase + DT2811_ADCSR) & DT2811_ADERROR)
-   printk(KERN_ERR "error probing irq (bad)\n");
-   dev->irq = 0;
-   if (irq > 0) {
-   i = inb(dev->iobase + DT2811_ADDATLO);
-   i = inb(dev->iobase + DT2811_ADDATHI);
-   printk(KERN_INFO "(irq = %d)\n", irq);
-   ret = request_irq(irq, dt2811_interrupt, 0,
- dev->board_name, dev);
-   if (ret < 0)
-   return -EIO;
-   dev->irq = irq;
-   } else if (irq == 0) {
-   printk(KERN_INFO "(no irq)\n");
-   } else {
-   printk(KERN_ERR "( multiple irq's -- this is bad! )\n");
-   }
-   }
-#endif
-
ret = comedi_alloc_subdevices(dev, 4);
if (ret)
return ret;
-- 
1.8.4.4

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


[PATCH 25/60] staging: comedi: dt2814: tidy up the irq support in dt2814_attach()

2013-11-26 Thread H Hartley Sweeten
An irq is only needed by this driver in order to support async commands.
Since it is optional, modify the attach so that if the request_irq() fails
the attach does not fail.

Remove the printk noise about the irq.

Only hookup the async command support if the request_irq() was successful.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2814.c | 33 +++--
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2814.c 
b/drivers/staging/comedi/drivers/dt2814.c
index c3f8208..e52d22e 100644
--- a/drivers/staging/comedi/drivers/dt2814.c
+++ b/drivers/staging/comedi/drivers/dt2814.c
@@ -235,9 +235,9 @@ static irqreturn_t dt2814_interrupt(int irq, void *d)
 static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig 
*it)
 {
struct dt2814_private *devpriv;
-   int i, irq;
-   int ret;
struct comedi_subdevice *s;
+   int ret;
+   int i;
 
ret = comedi_request_region(dev, it->options[0], DT2814_SIZE);
if (ret)
@@ -252,17 +252,11 @@ static int dt2814_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
i = inb(dev->iobase + DT2814_DATA);
i = inb(dev->iobase + DT2814_DATA);
 
-   irq = it->options[1];
-   dev->irq = 0;
-   if (irq > 0) {
-   if (request_irq(irq, dt2814_interrupt, 0, "dt2814", dev)) {
-   printk(KERN_WARNING "(irq %d unavailable)\n", irq);
-   } else {
-   printk(KERN_INFO "( irq = %d )\n", irq);
-   dev->irq = irq;
-   }
-   } else if (irq == 0) {
-   printk(KERN_WARNING "(no irq)\n");
+   if (it->options[1]) {
+   ret = request_irq(it->options[1], dt2814_interrupt, 0,
+ dev->board_name, dev);
+   if (ret == 0)
+   dev->irq = it->options[1];
}
 
ret = comedi_alloc_subdevices(dev, 1);
@@ -274,16 +268,19 @@ static int dt2814_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
return -ENOMEM;
 
s = &dev->subdevices[0];
-   dev->read_subdev = s;
s->type = COMEDI_SUBD_AI;
-   s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_CMD_READ;
+   s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = 16; /* XXX */
-   s->len_chanlist = 1;
s->insn_read = dt2814_ai_insn_read;
-   s->do_cmd = dt2814_ai_cmd;
-   s->do_cmdtest = dt2814_ai_cmdtest;
s->maxdata = 0xfff;
s->range_table = &range_unknown;/* XXX */
+   if (dev->irq) {
+   dev->read_subdev = s;
+   s->subdev_flags |= SDF_CMD_READ;
+   s->len_chanlist = 1;
+   s->do_cmd = dt2814_ai_cmd;
+   s->do_cmdtest = dt2814_ai_cmdtest;
+   }
 
return 0;
 }
-- 
1.8.4.4

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


[PATCH 20/60] staging: comedi: dt2811: remove disabled dt2811_adtrig() function

2013-11-26 Thread H Hartley Sweeten
This function is not used by the driver. It's also suffering from bitrot
since COMEDI_MDEMAND and COMEDI_MCONTS are not defined anywhere. Just
remove the code.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2811.c | 29 -
 1 file changed, 29 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2811.c 
b/drivers/staging/comedi/drivers/dt2811.c
index 0ca02fa..686d86c 100644
--- a/drivers/staging/comedi/drivers/dt2811.c
+++ b/drivers/staging/comedi/drivers/dt2811.c
@@ -278,35 +278,6 @@ static int dt2811_ai_insn(struct comedi_device *dev, 
struct comedi_subdevice *s,
return i;
 }
 
-#if 0
-/* Wow.  This is code from the Comedi stone age.  But it hasn't been
- * replaced, so I'll let it stay. */
-int dt2811_adtrig(kdev_t minor, comedi_adtrig *adtrig)
-{
-   struct comedi_device *dev = comedi_devices + minor;
-
-   if (adtrig->n < 1)
-   return 0;
-   dev->curadchan = adtrig->chan;
-   switch (dev->i_admode) {
-   case COMEDI_MDEMAND:
-   dev->ntrig = adtrig->n - 1;
-   /* not necessary */
-   /*printk("dt2811: AD soft trigger\n"); */
-   /*outb(DT2811_CLRERROR|DT2811_INTENB,
-   dev->iobase+DT2811_ADCSR); */
-   outb(dev->curadchan, dev->iobase + DT2811_ADGCR);
-   do_gettimeofday(&trigtime);
-   break;
-   case COMEDI_MCONTS:
-   dev->ntrig = adtrig->n;
-   break;
-   }
-
-   return 0;
-}
-#endif
-
 static int dt2811_ao_insn(struct comedi_device *dev, struct comedi_subdevice 
*s,
  struct comedi_insn *insn, unsigned int *data)
 {
-- 
1.8.4.4

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


[PATCH 00/60] staging: comedi: more printk debug cleanup

2013-11-26 Thread H Hartley Sweeten
There are a lot of debugging messages in the comedi drivers that are
just added noise. Some of them messages are worth keeping but they
should be converted to the appropriate dev_{level} format.

This series is a first pass at cleaning this up.

H Hartley Sweeten (60):
  staging: comedi: pcmmio.c: remove kcalloc() failure message
  staging: comedi: adv_pci1710: convert some printk's to dev_dbg()
  staging: comedi: dmm32at: remove final attach noise and fix return value
  staging: comedi: pcl812: convert some printk's to dev_dbg()
  staging: comedi: pcl816: convert some printk's to dev_dbg()
  staging: comedi: pcl818: convert some printk's to dev_dbg()
  staging: comedi: adq12b: remove commented out debug message
  staging: comedi: c6xdigio: remove commented out subdevice code
  staging: comedi: c6xdigio: remove commented out function trace messages
  staging: comedi: cb_pcimdas: remove commented out irq init code
  staging: comedi: cb_pcimdas: remove unnecessary printk noise
  staging: comedi: das16m1: tidy up the irq support in das16m1_attach()
  staging: comedi: dmm32at: remove unnecessary printk noise
  staging: comedi: dmm32at: remove commented out printk debug
  staging: comedi: dmm32at: tidy up the irq support in dmm32at_attach()
  staging: comedi: dmm32at: convert a printk(KERN_ERR to a dev->err()
  staging: comedi: dt2801: remove disabled code in dt2801_writedata
  staging: comedi: dt2801: remove commented out printk()
  staging: comedi: dt2801: convert printk() messages to dev_dbg()
  staging: comedi: dt2811: remove disabled dt2811_adtrig() function
  staging: comedi: dt2811: remove disabled interrupt support code
  staging: comedi: dt2814: remove unnecessary printk noise
  staging: comedi: dt2814: remove bad printk noise
  staging: comedi: dt2814: convert a printk(KERN_ERR into a dev_err()
  staging: comedi: dt2814: tidy up the irq support in dt2814_attach()
  staging: comedi: dt2815: convert printk's in dt2815_ao_insn()
  staging: comedi: dt2815: convert printk's in dt2815_attach()
  staging: comedi: dt282x: tidy up the irq support in dt282x_attach()
  staging: comedi: dt282x: remove attach noise in dt282x_grab_dma()
  staging: comedi: dt282x: convert printk() in dt282x_attach to a dev_err()
  staging: comedi: dt282x: remove unnecessary blank line message
  staging: comedi: dt282x: remove disable code that disables the irq
  staging: comedi: dt282x: convert dt282x_ao_dma_interrupt() messages
  staging: comedi: dt282x: convert dt282x_ai_dma_interrupt() messages
  staging: comedi: dt282x: convert dt282x_ao_inttrig() messages
  staging: comedi: dt282x: remove commented out printk
  staging: comedi: mpc624: remove commented out printk
  staging: comedi: mpc624: remove unnecessary test
  staging: comedi: mpc624: remove unnecessary printk noise
  staging: comedi: mpc624: convert printk messages in mpc624_ai_rinsn()
  staging: comedi: rtd520: remove commented out printk debug
  staging: comedi: plx9080.h: remove unnecessary printk noise
  staging: comedi: pcm3724: remove commented out printk debug
  staging: comedi: pcl818: remove commented out printk debug
  staging: comedi: pcl818: remove printk function trace messages
  staging: comedi: pcl818: remove board attach noise
  staging: comedi: pcl818: tidy up the irq support in pcl818_attach()
  staging: comedi: pcl818: convert printk() messages to dev_{level}
  staging: comedi: pcl816: remove commented out outb() macro
  staging: comedi: pcl816: remove TRIG_WAKE_EOS support stub
  staging: comedi: pcl816: tidy up the irq support in pcl816_attach()
  staging: comedi: pcl816: remove commented out printk debug
  staging: comedi: pcl816: convert printk messages in pcl816_attach()
  staging: comedi: pcl812: tidy up the irq support in pcl812_attach()
  staging: comedi: pcl812: convert printk messages in pcl812_attach()
  staging: comedi: ni_tio: remove commented out printk message
  staging: comedi: ni_pcimio: convert printk() to dev_dbg()
  staging: comedi: ni_atmio16d: remove printk() noise in atmio16d_ai_insn_read()
  staging: comedi: ni_atmio16d: tidy up the irq support in atmio16d_attach()
  staging: comedi: ni_atmio16d: remove an unnecessary printk

 drivers/staging/comedi/drivers/adq12b.c  |   2 -
 drivers/staging/comedi/drivers/adv_pci1710.c |  27 +++---
 drivers/staging/comedi/drivers/c6xdigio.c|  45 --
 drivers/staging/comedi/drivers/cb_pcimdas.c  |  14 +---
 drivers/staging/comedi/drivers/das16m1.c |  78 ++---
 drivers/staging/comedi/drivers/dmm32at.c |  62 +-
 drivers/staging/comedi/drivers/dt2801.c  |  28 +++
 drivers/staging/comedi/drivers/dt2811.c  | 101 +-
 drivers/staging/comedi/drivers/dt2814.c  |  40 -
 drivers/staging/comedi/drivers/dt2815.c  |  19 +++--
 drivers/staging/comedi/drivers/dt282x.c  | 120 +--
 drivers/staging/comedi/drivers/mpc624.c  |  19 ++---
 drivers/staging/comedi/drivers/ni_atmio16d.c |  42 

[PATCH 16/60] staging: comedi: dmm32at: convert a printk(KERN_ERR to a dev->err()

2013-11-26 Thread H Hartley Sweeten
Convert this printk message to a dev_err() message.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 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 1831f32..174735d 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -710,7 +710,7 @@ static int dmm32at_attach(struct comedi_device *dev,
 
if ((ailo != 0x00) || (aihi != 0x1f) || (fifostat != 0x80) ||
(aistat != 0x60 || (intstat != 0x00) || airback != 0x0c)) {
-   printk(KERN_ERR "dmmat32: board detection failed\n");
+   dev_err(dev->class_dev, "board detection failed\n");
return -EIO;
}
 
-- 
1.8.4.4

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


[PATCH 18/60] staging: comedi: dt2801: remove commented out printk()

2013-11-26 Thread H Hartley Sweeten
This printk is just added noise. Remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2801.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/dt2801.c 
b/drivers/staging/comedi/drivers/dt2801.c
index a1b022c..065e780 100644
--- a/drivers/staging/comedi/drivers/dt2801.c
+++ b/drivers/staging/comedi/drivers/dt2801.c
@@ -372,7 +372,6 @@ static int dt2801_reset(struct comedi_device *dev)
if (!timeout)
printk("dt2801: timeout 1 status=0x%02x\n", stat);
 
-   /* printk("dt2801: reading dummy\n"); */
/* dt2801_readdata(dev,&board_code); */
 
outb_p(DT_C_RESET, dev->iobase + DT2801_CMD);
-- 
1.8.4.4

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


[PATCH 02/60] staging: comedi: adv_pci1710: convert some printk's to dev_dbg()

2013-11-26 Thread H Hartley Sweeten
Convert these debug messages to dev_dbg().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/adv_pci1710.c | 27 ---
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c 
b/drivers/staging/comedi/drivers/adv_pci1710.c
index c3fdcab..ad0692d 100644
--- a/drivers/staging/comedi/drivers/adv_pci1710.c
+++ b/drivers/staging/comedi/drivers/adv_pci1710.c
@@ -740,16 +740,15 @@ static void interrupt_pci1710_every_sample(void *d)
 
m = inw(dev->iobase + PCI171x_STATUS);
if (m & Status_FE) {
-   printk("comedi%d: A/D FIFO empty (%4x)\n", dev->minor, m);
+   dev_dbg(dev->class_dev, "A/D FIFO empty (%4x)\n", m);
pci171x_ai_cancel(dev, s);
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
comedi_event(dev, s);
return;
}
if (m & Status_FF) {
-   printk
-   ("comedi%d: A/D FIFO Full status (Fatal Error!) (%4x)\n",
-dev->minor, m);
+   dev_dbg(dev->class_dev,
+   "A/D FIFO Full status (Fatal Error!) (%4x)\n", m);
pci171x_ai_cancel(dev, s);
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
comedi_event(dev, s);
@@ -825,12 +824,12 @@ static int move_block_from_fifo(struct comedi_device *dev,
sampl = inw(dev->iobase + PCI171x_AD_DATA);
if (this_board->cardtype != TYPE_PCI1713)
if ((sampl & 0xf000) != devpriv->act_chanlist[j]) {
-   printk
-   ("comedi%d: A/D  FIFO data dropout: 
received data from channel %d, expected %d! (%d/%d/%d/%d/%d/%4x)\n",
-dev->minor, (sampl & 0xf000) >> 12,
-(devpriv->act_chanlist[j] & 0xf000) >> 12,
-i, j, devpriv->ai_act_scan, n, turn,
-sampl);
+   dev_dbg(dev->class_dev,
+   "A/D FIFO data dropout: received data 
from channel %d, expected %d! (%d/%d/%d/%d/%d/%4x)\n",
+   (sampl & 0xf000) >> 12,
+   (devpriv->act_chanlist[j] & 0xf000) >> 
12,
+   i, j, devpriv->ai_act_scan, n, turn,
+   sampl);
pci171x_ai_cancel(dev, s);
s->async->events |=
COMEDI_CB_EOA | COMEDI_CB_ERROR;
@@ -865,17 +864,15 @@ static void interrupt_pci1710_half_fifo(void *d)
 
m = inw(dev->iobase + PCI171x_STATUS);
if (!(m & Status_FH)) {
-   printk("comedi%d: A/D FIFO not half full! (%4x)\n",
-  dev->minor, m);
+   dev_dbg(dev->class_dev, "A/D FIFO not half full! (%4x)\n", m);
pci171x_ai_cancel(dev, s);
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
comedi_event(dev, s);
return;
}
if (m & Status_FF) {
-   printk
-   ("comedi%d: A/D FIFO Full status (Fatal Error!) (%4x)\n",
-dev->minor, m);
+   dev_dbg(dev->class_dev,
+   "A/D FIFO Full status (Fatal Error!) (%4x)\n", m);
pci171x_ai_cancel(dev, s);
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
comedi_event(dev, s);
-- 
1.8.4.4

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


[PATCH 15/60] staging: comedi: dmm32at: tidy up the irq support in dmm32at_attach()

2013-11-26 Thread H Hartley Sweeten
An irq is only needed by this driver in order to support async commands.
Since it is optional, modify the attach so that if the request_irq() fails
the attach does not fail.

Remove the printk noise about the irq.

Only hookup the async command support if the request_irq() was successful.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dmm32at.c | 32 ++--
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dmm32at.c 
b/drivers/staging/comedi/drivers/dmm32at.c
index 6fb8ce1..1831f32 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -670,9 +670,6 @@ static int dmm32at_attach(struct comedi_device *dev,
int ret;
struct comedi_subdevice *s;
unsigned char aihi, ailo, fifostat, aistat, intstat, airback;
-   unsigned int irq;
-
-   irq = it->options[1];
 
ret = comedi_request_region(dev, it->options[0], DMM32AT_MEMSIZE);
if (ret)
@@ -717,14 +714,11 @@ static int dmm32at_attach(struct comedi_device *dev,
return -EIO;
}
 
-   /* board is there, register interrupt */
-   if (irq) {
-   ret = request_irq(irq, dmm32at_isr, 0, dev->board_name, dev);
-   if (ret < 0) {
-   printk(KERN_ERR "dmm32at: irq conflict\n");
-   return ret;
-   }
-   dev->irq = irq;
+   if (it->options[1]) {
+   ret = request_irq(it->options[1], dmm32at_isr, 0,
+ dev->board_name, dev);
+   if (ret == 0)
+   dev->irq = it->options[1];
}
 
devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
@@ -736,20 +730,22 @@ static int dmm32at_attach(struct comedi_device *dev,
return ret;
 
s = &dev->subdevices[0];
-   dev->read_subdev = s;
/* analog input subdevice */
s->type = COMEDI_SUBD_AI;
/* we support single-ended (ground) and differential */
-   s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF | SDF_CMD_READ;
+   s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF;
s->n_chan = 32;
s->maxdata = 0x;
s->range_table = &dmm32at_airanges;
-   s->len_chanlist = 32;   /* This is the maximum chanlist length that
-  the board can handle */
s->insn_read = dmm32at_ai_rinsn;
-   s->do_cmd = dmm32at_ai_cmd;
-   s->do_cmdtest = dmm32at_ai_cmdtest;
-   s->cancel = dmm32at_ai_cancel;
+   if (dev->irq) {
+   dev->read_subdev = s;
+   s->subdev_flags |= SDF_CMD_READ;
+   s->len_chanlist = 32;
+   s->do_cmd = dmm32at_ai_cmd;
+   s->do_cmdtest = dmm32at_ai_cmdtest;
+   s->cancel = dmm32at_ai_cancel;
+   }
 
s = &dev->subdevices[1];
/* analog output subdevice */
-- 
1.8.4.4

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


[PATCH 60/60] staging: comedi: ni_atmio16d: remove an unnecessary printk

2013-11-26 Thread H Hartley Sweeten
This blank line printk is not necessary. Remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_atmio16d.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_atmio16d.c 
b/drivers/staging/comedi/drivers/ni_atmio16d.c
index 35cadc3..834c9e1 100644
--- a/drivers/staging/comedi/drivers/ni_atmio16d.c
+++ b/drivers/staging/comedi/drivers/ni_atmio16d.c
@@ -745,7 +745,6 @@ static int atmio16d_attach(struct comedi_device *dev,
s->n_chan = 0;
s->maxdata = 0
 #endif
-   printk("\n");
 
return 0;
 }
-- 
1.8.4.4

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


[PATCH 46/60] staging: comedi: pcl818: remove board attach noise

2013-11-26 Thread H Hartley Sweeten
These messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl818.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 931aed0..945a5dd 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -1234,16 +1234,10 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
irq = it->options[1];
if (irq) {  /* we want to use IRQ */
if (((1 << irq) & board->IRQbits) == 0) {
-   printk
-   (", IRQ %u is out of allowed range, 
DISABLING IT",
-irq);
irq = 0;/* Bad IRQ */
} else {
if (request_irq(irq, interrupt_pcl818, 0,
dev->board_name, dev)) {
-   printk
-   (", unable to allocate IRQ %u, 
DISABLING IT",
-irq);
irq = 0;/* Can't use IRQ */
}
}
@@ -1308,11 +1302,9 @@ no_dma:
if (check_single_ended(dev->iobase)) {
s->n_chan = board->n_aichan_se;
s->subdev_flags |= SDF_COMMON | SDF_GROUND;
-   printk(", %dchans S.E. DAC", s->n_chan);
} else {
s->n_chan = board->n_aichan_diff;
s->subdev_flags |= SDF_DIFF;
-   printk(", %dchans DIFF DAC", s->n_chan);
}
s->maxdata = board->ai_maxdata;
s->len_chanlist = s->n_chan;
@@ -1431,8 +1423,6 @@ no_dma:
 
pcl818_reset(dev);
 
-   printk("\n");
-
return 0;
 }
 
-- 
1.8.4.4

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


[PATCH 47/60] staging: comedi: pcl818: tidy up the irq support in pcl818_attach()

2013-11-26 Thread H Hartley Sweeten
Tidy up the code that does the request_irq().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl818.c | 28 +++-
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 945a5dd..15b4247 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -1204,7 +1204,6 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
const struct pcl818_board *board = comedi_board(dev);
struct pcl818_private *devpriv;
int ret;
-   unsigned int irq;
int dma;
unsigned long pages;
struct comedi_subdevice *s;
@@ -1228,28 +1227,15 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
return -EIO;
}
 
-   /* grab our IRQ */
-   irq = 0;
-   if (board->IRQbits != 0) {  /* board support IRQ */
-   irq = it->options[1];
-   if (irq) {  /* we want to use IRQ */
-   if (((1 << irq) & board->IRQbits) == 0) {
-   irq = 0;/* Bad IRQ */
-   } else {
-   if (request_irq(irq, interrupt_pcl818, 0,
-   dev->board_name, dev)) {
-   irq = 0;/* Can't use IRQ */
-   }
-   }
+   if ((1 << it->options[1]) & board->IRQbits) {
+   ret = request_irq(it->options[1], interrupt_pcl818, 0,
+ dev->board_name, dev);
+   if (ret == 0) {
+   dev->irq = it->options[1];
+   devpriv->irq_free = 1;
}
}
 
-   dev->irq = irq;
-   if (irq)
-   devpriv->irq_free = 1;   /* 1=we have allocated irq */
-   else
-   devpriv->irq_free = 0;
-
devpriv->irq_blocked = 0;   /* number of subdevice which use IRQ */
devpriv->ai_mode = 0;   /* mode of irq */
 
@@ -1311,7 +1297,7 @@ no_dma:
s->range_table = board->ai_range_type;
s->cancel = pcl818_ai_cancel;
s->insn_read = pcl818_ai_insn_read;
-   if (irq) {
+   if (dev->irq) {
dev->read_subdev = s;
s->subdev_flags |= SDF_CMD_READ;
s->do_cmdtest = ai_cmdtest;
-- 
1.8.4.4

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


[PATCH 27/60] staging: comedi: dt2815: convert printk's in dt2815_attach()

2013-11-26 Thread H Hartley Sweeten
These messages don't appear to be important enough to warrent KERN_INFO
and KERN_WARNING levels. Convert them dev_dbg().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2815.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2815.c 
b/drivers/staging/comedi/drivers/dt2815.c
index 1a4caad..ee24717 100644
--- a/drivers/staging/comedi/drivers/dt2815.c
+++ b/drivers/staging/comedi/drivers/dt2815.c
@@ -202,12 +202,13 @@ static int dt2815_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
unsigned int program;
program = (it->options[4] & 0x3) << 3 | 0x7;
outb(program, dev->iobase + DT2815_DATA);
-   printk(KERN_INFO ", program: 0x%x (@t=%d)\n",
-  program, i);
+   dev_dbg(dev->class_dev, "program: 0x%x (@t=%d)\n",
+   program, i);
break;
} else if (status != 0x00) {
-   printk(KERN_WARNING "dt2815: unexpected status 0x%x "
-  "(@t=%d)\n", status, i);
+   dev_dbg(dev->class_dev,
+   "unexpected status 0x%x (@t=%d)\n",
+   status, i);
if (status & 0x60)
outb(0x00, dev->iobase + DT2815_STATUS);
}
-- 
1.8.4.4

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


[PATCH 52/60] staging: comedi: pcl816: remove commented out printk debug

2013-11-26 Thread H Hartley Sweeten
These messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl816.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c 
b/drivers/staging/comedi/drivers/pcl816.c
index ad75bb6..d38b9fd 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -922,7 +922,6 @@ static int pcl816_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
devpriv->dmapages[0] = pages;
devpriv->hwdmaptr[0] = virt_to_bus((void *)devpriv->dmabuf[0]);
devpriv->hwdmasize[0] = (1 << pages) * PAGE_SIZE;
-   /* printk("%d %d %ld, 
",devpriv->dmapages[0],devpriv->hwdmasize[0],PAGE_SIZE); */
 
devpriv->dmabuf[1] = __get_dma_pages(GFP_KERNEL, pages);
if (!devpriv->dmabuf[1]) {
@@ -958,7 +957,6 @@ no_dma:
s->subdev_flags = SDF_READABLE | SDF_CMD_READ;
s->n_chan = board->n_aichan;
s->subdev_flags |= SDF_DIFF;
-   /* printk (", %dchans DIFF DAC - %d", s->n_chan, i); */
s->maxdata = board->ai_maxdata;
s->len_chanlist = board->ai_chanlist;
s->range_table = board->ai_range_type;
-- 
1.8.4.4

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


[PATCH 48/60] staging: comedi: pcl818: convert printk() messages to dev_{level}

2013-11-26 Thread H Hartley Sweeten
Convert the remaining printk messsages in this driver to dev_{level}.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl818.c | 29 +++--
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 15b4247..cacdca0 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -463,10 +463,10 @@ conv_finish:
outb(0, dev->iobase + PCL818_CLRINT);   /* clear INT request */
 
if ((low & 0xf) != devpriv->act_chanlist[devpriv->act_chanlist_pos]) {  
/*  dropout! */
-   printk
-   ("comedi: A/D mode1/3 IRQ - channel dropout %x!=%x !\n",
-(low & 0xf),
-devpriv->act_chanlist[devpriv->act_chanlist_pos]);
+   dev_dbg(dev->class_dev,
+   "A/D mode1/3 IRQ - channel dropout %x!=%x !\n",
+   (low & 0xf),
+   devpriv->act_chanlist[devpriv->act_chanlist_pos]);
pcl818_ai_cancel(dev, s);
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
comedi_event(dev, s);
@@ -532,11 +532,11 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma(int 
irq, void *d)
 
for (i = 0; i < len; i++) {
if ((ptr[bufptr] & 0xf) != 
devpriv->act_chanlist[devpriv->act_chanlist_pos]) {  /*  dropout! */
-   printk
-   ("comedi: A/D mode1/3 DMA - channel dropout 
%d(card)!=%d(chanlist) at %d !\n",
-(ptr[bufptr] & 0xf),
-devpriv->act_chanlist[devpriv->act_chanlist_pos],
-devpriv->act_chanlist_pos);
+   dev_dbg(dev->class_dev,
+   "A/D mode1/3 DMA - channel dropout 
%d(card)!=%d(chanlist) at %d !\n",
+   (ptr[bufptr] & 0xf),
+   
devpriv->act_chanlist[devpriv->act_chanlist_pos],
+   devpriv->act_chanlist_pos);
pcl818_ai_cancel(dev, s);
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
comedi_event(dev, s);
@@ -609,10 +609,10 @@ static irqreturn_t interrupt_pcl818_ai_mode13_fifo(int 
irq, void *d)
for (i = 0; i < len; i++) {
lo = inb(dev->iobase + PCL818_FI_DATALO);
if ((lo & 0xf) != 
devpriv->act_chanlist[devpriv->act_chanlist_pos]) {   /*  dropout! */
-   printk
-   ("comedi: A/D mode1/3 FIFO - channel dropout %d!=%d 
!\n",
-(lo & 0xf),
-devpriv->act_chanlist[devpriv->act_chanlist_pos]);
+   dev_dbg(dev->class_dev,
+   "A/D mode1/3 FIFO - channel dropout %d!=%d !\n",
+   (lo & 0xf),
+   
devpriv->act_chanlist[devpriv->act_chanlist_pos]);
pcl818_ai_cancel(dev, s);
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
comedi_event(dev, s);
@@ -1249,7 +1249,8 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
if (dma < 1)
goto no_dma;/* DMA disabled */
if (((1 << dma) & board->DMAbits) == 0) {
-   printk(KERN_ERR "DMA is out of allowed range, FAIL!\n");
+   dev_err(dev->class_dev,
+   "DMA is out of allowed range, FAIL!\n");
return -EINVAL; /* Bad DMA */
}
ret = request_dma(dma, dev->board_name);
-- 
1.8.4.4

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


[PATCH 19/60] staging: comedi: dt2801: convert printk() messages to dev_dbg()

2013-11-26 Thread H Hartley Sweeten
Convert all the printk() messages in this driver to dev_dbg().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2801.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2801.c 
b/drivers/staging/comedi/drivers/dt2801.c
index 065e780..4bf2c7f 100644
--- a/drivers/staging/comedi/drivers/dt2801.c
+++ b/drivers/staging/comedi/drivers/dt2801.c
@@ -336,11 +336,11 @@ static int dt2801_writecmd(struct comedi_device *dev, int 
command)
 
stat = inb_p(dev->iobase + DT2801_STATUS);
if (stat & DT_S_COMPOSITE_ERROR) {
-   printk
-   ("dt2801: composite-error in dt2801_writecmd(), 
ignoring\n");
+   dev_dbg(dev->class_dev,
+   "composite-error in %s, ignoring\n", __func__);
}
if (!(stat & DT_S_READY))
-   printk("dt2801: !ready in dt2801_writecmd(), ignoring\n");
+   dev_dbg(dev->class_dev, "!ready in %s, ignoring\n", __func__);
outb_p(command, dev->iobase + DT2801_CMD);
 
return 0;
@@ -370,7 +370,7 @@ static int dt2801_reset(struct comedi_device *dev)
break;
} while (timeout--);
if (!timeout)
-   printk("dt2801: timeout 1 status=0x%02x\n", stat);
+   dev_dbg(dev->class_dev, "timeout 1 status=0x%02x\n", stat);
 
/* dt2801_readdata(dev,&board_code); */
 
@@ -385,7 +385,7 @@ static int dt2801_reset(struct comedi_device *dev)
break;
} while (timeout--);
if (!timeout)
-   printk("dt2801: timeout 2 status=0x%02x\n", stat);
+   dev_dbg(dev->class_dev, "timeout 2 status=0x%02x\n", stat);
 
dt2801_readdata(dev, &board_code);
 
@@ -448,12 +448,12 @@ static int dt2801_error(struct comedi_device *dev, int 
stat)
 {
if (stat < 0) {
if (stat == -ETIME)
-   printk("dt2801: timeout\n");
+   dev_dbg(dev->class_dev, "timeout\n");
else
-   printk("dt2801: error %d\n", stat);
+   dev_dbg(dev->class_dev, "error %d\n", stat);
return stat;
}
-   printk("dt2801: error status 0x%02x, resetting...\n", stat);
+   dev_dbg(dev->class_dev, "error status 0x%02x, resetting...\n", stat);
 
dt2801_reset(dev);
dt2801_reset(dev);
@@ -584,8 +584,8 @@ static int dt2801_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
if (boardtypes[type].boardcode == board_code)
goto havetype;
}
-   printk("dt2801: unrecognized board code=0x%02x, contact author\n",
-  board_code);
+   dev_dbg(dev->class_dev,
+   "unrecognized board code=0x%02x, contact author\n", board_code);
type = 0;
 
 havetype:
-- 
1.8.4.4

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


[PATCH 45/60] staging: comedi: pcl818: remove printk function trace messages

2013-11-26 Thread H Hartley Sweeten
These messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl818.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index 5b96800..931aed0 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -522,7 +522,6 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, 
void *d)
release_dma_lock(flags);
enable_dma(devpriv->dma);
}
-   printk("comedi: A/D mode1/3 IRQ \n");
 
devpriv->dma_runs_to_end--;
outb(0, dev->iobase + PCL818_CLRINT);   /* clear INT request */
@@ -723,7 +722,6 @@ static void pcl818_ai_mode13dma_int(int mode, struct 
comedi_device *dev,
unsigned int flags;
unsigned int bytes;
 
-   printk("mode13dma_int, mode: %d\n", mode);
disable_dma(devpriv->dma);  /*  disable dma */
bytes = devpriv->hwdmasize[0];
if (!devpriv->neverending_ai) {
@@ -929,7 +927,6 @@ static int check_channel_list(struct comedi_device *dev,
} else {
seglen = 1;
}
-   printk("check_channel_list: seglen %d\n", seglen);
return seglen;
 }
 
-- 
1.8.4.4

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


[PATCH 26/60] staging: comedi: dt2815: convert printk's in dt2815_ao_insn()

2013-11-26 Thread H Hartley Sweeten
Convert the printk(KERN_WARNING messages in this function to dev_dbg().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2815.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2815.c 
b/drivers/staging/comedi/drivers/dt2815.c
index 34040f0..1a4caad 100644
--- a/drivers/staging/comedi/drivers/dt2815.c
+++ b/drivers/staging/comedi/drivers/dt2815.c
@@ -107,8 +107,9 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct 
comedi_subdevice *s,
 
status = dt2815_wait_for_status(dev, 0x00);
if (status != 0) {
-   printk(KERN_WARNING "dt2815: failed to write low byte "
-  "on %d reason %x\n", chan, status);
+   dev_dbg(dev->class_dev,
+   "failed to write low byte on %d reason %x\n",
+   chan, status);
return -EBUSY;
}
 
@@ -116,8 +117,9 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct 
comedi_subdevice *s,
 
status = dt2815_wait_for_status(dev, 0x10);
if (status != 0x10) {
-   printk(KERN_WARNING "dt2815: failed to write high byte "
-  "on %d reason %x\n", chan, status);
+   dev_dbg(dev->class_dev,
+   "failed to write high byte on %d reason %x\n",
+   chan, status);
return -EBUSY;
}
devpriv->ao_readback[chan] = data[i];
-- 
1.8.4.4

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


[PATCH 35/60] staging: comedi: dt282x: convert dt282x_ao_inttrig() messages

2013-11-26 Thread H Hartley Sweeten
Convert the messages in this function to dev_err().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt282x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index c8df18a..a850e1d 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -885,7 +885,7 @@ static int dt282x_ao_inttrig(struct comedi_device *dev,
size = cfc_read_array_from_buffer(s, devpriv->dma[0].buf,
  devpriv->dma_maxsize);
if (size == 0) {
-   printk(KERN_ERR "dt282x: AO underrun\n");
+   dev_err(dev->class_dev, "AO underrun\n");
return -EPIPE;
}
prep_ao_dma(dev, 0, size);
@@ -893,7 +893,7 @@ static int dt282x_ao_inttrig(struct comedi_device *dev,
size = cfc_read_array_from_buffer(s, devpriv->dma[1].buf,
  devpriv->dma_maxsize);
if (size == 0) {
-   printk(KERN_ERR "dt282x: AO underrun\n");
+   dev_err(dev->class_dev, "AO underrun\n");
return -EPIPE;
}
prep_ao_dma(dev, 1, size);
-- 
1.8.4.4

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


[PATCH 43/60] staging: comedi: pcm3724: remove commented out printk debug

2013-11-26 Thread H Hartley Sweeten
These messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcm3724.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcm3724.c 
b/drivers/staging/comedi/drivers/pcm3724.c
index cc1dc7f..f4a49bd 100644
--- a/drivers/staging/comedi/drivers/pcm3724.c
+++ b/drivers/staging/comedi/drivers/pcm3724.c
@@ -70,14 +70,11 @@ static int subdev_8255_cb(int dir, int port, int data, 
unsigned long arg)
 {
unsigned long iobase = arg;
unsigned char inbres;
-   /* printk("8255cb %d %d %d %lx\n", dir,port,data,arg); */
if (dir) {
-   /* printk("8255 cb   outb(%x, %lx)\n", data, iobase+port); */
outb(data, iobase + port);
return 0;
} else {
inbres = inb(iobase + port);
-   /* printk("8255 cb   inb(%lx) = %x\n", iobase+port, inbres); */
return inbres;
}
 }
@@ -137,8 +134,6 @@ static void do_3724_config(struct comedi_device *dev,
port_8255_cfg = dev->iobase + SIZE_8255 + _8255_CR;
 
outb(buffer_config, dev->iobase + 8);   /* update buffer register */
-   /* printk("pcm3724 buffer_config (%lx) %d, %x\n",
-  dev->iobase + _8255_CR, chanspec, buffer_config); */
 
outb(config, port_8255_cfg);
 }
@@ -177,7 +172,6 @@ static void enable_chan(struct comedi_device *dev, struct 
comedi_subdevice *s,
if (priv->dio_2 & 0xff)
gatecfg |= GATE_A1;
 
-   /*   printk("gate control %x\n", gatecfg); */
outb(gatecfg, dev->iobase + 9);
 }
 
-- 
1.8.4.4

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


[PATCH 39/60] staging: comedi: mpc624: remove unnecessary printk noise

2013-11-26 Thread H Hartley Sweeten
The ai read timeout will return -ETIMEDOUT. The printk is just added
noise. Remove it.

It's also not necessary to set data[n[ = 0 when the read timesout.
Remove that also.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/mpc624.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/mpc624.c 
b/drivers/staging/comedi/drivers/mpc624.c
index b105dd9..01b281e 100644
--- a/drivers/staging/comedi/drivers/mpc624.c
+++ b/drivers/staging/comedi/drivers/mpc624.c
@@ -177,11 +177,9 @@ static int mpc624_ai_rinsn(struct comedi_device *dev,
else
break;
}
-   if (i == TIMEOUT) {
-   printk(KERN_ERR "MPC624: timeout (%dms)\n", TIMEOUT);
-   data[n] = 0;
+   if (i == TIMEOUT)
return -ETIMEDOUT;
-   }
+
/*  Start reading data */
data_in = 0;
data_out = devpriv->ulConvertionRate;
-- 
1.8.4.4

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


[PATCH 36/60] staging: comedi: dt282x: remove commented out printk

2013-11-26 Thread H Hartley Sweeten
This printk is just added noise. Remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt282x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index a850e1d..df37d18 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -511,8 +511,7 @@ static irqreturn_t dt282x_interrupt(int irq, void *d)
}
 #endif
comedi_event(dev, s);
-   /* printk("adcsr=0x%02x dacsr-0x%02x supcsr=0x%02x\n",
-   adcsr, dacsr, supcsr); */
+
return IRQ_RETVAL(handled);
 }
 
-- 
1.8.4.4

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


[PATCH 51/60] staging: comedi: pcl816: tidy up the irq support in pcl816_attach()

2013-11-26 Thread H Hartley Sweeten
Tidy up the code that does the request_irq().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl816.c | 33 ++---
 1 file changed, 6 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c 
b/drivers/staging/comedi/drivers/pcl816.c
index 149a28b..ad75bb6 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -872,36 +872,15 @@ static int pcl816_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
if (!devpriv)
return -ENOMEM;
 
-   /* grab our IRQ */
-   irq = 0;
-   if (board->IRQbits != 0) {  /* board support IRQ */
-   irq = it->options[1];
-   if (irq) {  /* we want to use IRQ */
-   if (((1 << irq) & board->IRQbits) == 0) {
-   printk
-   (", IRQ %u is out of allowed range, "
-"DISABLING IT", irq);
-   irq = 0;/* Bad IRQ */
-   } else {
-   if (request_irq(irq, interrupt_pcl816, 0,
-   dev->board_name, dev)) {
-   printk
-   (", unable to allocate IRQ %u, "
-"DISABLING IT", irq);
-   irq = 0;/* Can't use IRQ */
-   } else {
-   printk(KERN_INFO ", irq=%u", irq);
-   }
-   }
+   if ((1 << it->options[1]) & board->IRQbits) {
+   ret = request_irq(board->IRQbits, interrupt_pcl816, 0,
+ dev->board_name, dev);
+   if (ret == 0) {
+   dev->irq = irq;
+   devpriv->irq_free = 1;
}
}
 
-   dev->irq = irq;
-   if (irq)/* 1=we have allocated irq */
-   devpriv->irq_free = 1;
-   else
-   devpriv->irq_free = 0;
-
devpriv->irq_blocked = 0;   /* number of subdevice which use IRQ */
devpriv->int816_mode = 0;   /* mode of irq */
 
-- 
1.8.4.4

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


[PATCH 42/60] staging: comedi: plx9080.h: remove unnecessary printk noise

2013-11-26 Thread H Hartley Sweeten
The timeouts will return -ETIMEDOUT. The printks are just added noise.
Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/plx9080.h | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/plx9080.h 
b/drivers/staging/comedi/drivers/plx9080.h
index 0d254a1..55e3c2e 100644
--- a/drivers/staging/comedi/drivers/plx9080.h
+++ b/drivers/staging/comedi/drivers/plx9080.h
@@ -402,12 +402,9 @@ static inline int plx9080_abort_dma(void __iomem *iobase, 
unsigned int channel)
udelay(1);
dma_status = readb(dma_cs_addr);
}
-   if (i == timeout) {
-   printk
-   ("plx9080: cancel() timed out waiting for dma %i done 
clear\n",
-channel);
+   if (i == timeout)
return -ETIMEDOUT;
-   }
+
/*  disable and abort channel */
writeb(PLX_DMA_ABORT_BIT, dma_cs_addr);
/*  wait for dma done bit */
@@ -416,12 +413,8 @@ static inline int plx9080_abort_dma(void __iomem *iobase, 
unsigned int channel)
udelay(1);
dma_status = readb(dma_cs_addr);
}
-   if (i == timeout) {
-   printk
-   ("plx9080: cancel() timed out waiting for dma %i done 
set\n",
-channel);
+   if (i == timeout)
return -ETIMEDOUT;
-   }
 
return 0;
 }
-- 
1.8.4.4

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


[PATCH 24/60] staging: comedi: dt2814: convert a printk(KERN_ERR into a dev_err()

2013-11-26 Thread H Hartley Sweeten
Convert this printk message into a dev_dev().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 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 3a05588..c3f8208 100644
--- a/drivers/staging/comedi/drivers/dt2814.c
+++ b/drivers/staging/comedi/drivers/dt2814.c
@@ -246,7 +246,7 @@ static int dt2814_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
outb(0, dev->iobase + DT2814_CSR);
udelay(100);
if (inb(dev->iobase + DT2814_CSR) & DT2814_ERR) {
-   printk(KERN_ERR "reset error (fatal)\n");
+   dev_err(dev->class_dev, "reset error (fatal)\n");
return -EIO;
}
i = inb(dev->iobase + DT2814_DATA);
-- 
1.8.4.4

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


[PATCH 41/60] staging: comedi: rtd520: remove commented out printk debug

2013-11-26 Thread H Hartley Sweeten
These messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/rtd520.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/rtd520.c 
b/drivers/staging/comedi/drivers/rtd520.c
index 44c8712..317c26e 100644
--- a/drivers/staging/comedi/drivers/rtd520.c
+++ b/drivers/staging/comedi/drivers/rtd520.c
@@ -495,8 +495,6 @@ static unsigned short rtd_convert_chan_gain(struct 
comedi_device *dev,
case AREF_OTHER:/* ??? */
break;
}
-   /*printk ("chan=%d r=%d a=%d -> 0x%x\n",
-  chan, range, aref, r); */
return r;
 }
 
@@ -606,7 +604,6 @@ static int rtd_ai_rinsn(struct comedi_device *dev,
 
/* read data */
d = readw(devpriv->las1 + LAS1_ADC_FIFO);
-   /*printk ("rtd520: Got 0x%x after %d usec\n", d, ii+1); */
d = d >> 3; /* low 3 bits are marker lines */
if (test_bit(0, devpriv->chan_is_bipolar))
/* convert to comedi unsigned data */
-- 
1.8.4.4

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


[PATCH 38/60] staging: comedi: mpc624: remove unnecessary test

2013-11-26 Thread H Hartley Sweeten
It's not necessaary to vaidate insn->n passed to the (*insn_read)
function. The for() loop following it will just be a NOP.

Remove the test as well as the printk noise.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/mpc624.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/mpc624.c 
b/drivers/staging/comedi/drivers/mpc624.c
index 2d6add4..b105dd9 100644
--- a/drivers/staging/comedi/drivers/mpc624.c
+++ b/drivers/staging/comedi/drivers/mpc624.c
@@ -159,10 +159,6 @@ static int mpc624_ai_rinsn(struct comedi_device *dev,
 *  We always write 0 to GNSWA bit, so the channel range is +-/10.1Vdc
 */
outb(insn->chanspec, dev->iobase + MPC624_GNMUXCH);
-   if (!insn->n) {
-   printk(KERN_INFO "MPC624: Warning, no data to acquire\n");
-   return 0;
-   }
 
for (n = 0; n < insn->n; n++) {
/*  Trigger the conversion */
-- 
1.8.4.4

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


[PATCH 22/60] staging: comedi: dt2814: remove unnecessary printk noise

2013-11-26 Thread H Hartley Sweeten
The ai read timeout will return -ETIMEDOUT. The printk is just added
noise. Remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2814.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt2814.c 
b/drivers/staging/comedi/drivers/dt2814.c
index 4b41478..90defd5 100644
--- a/drivers/staging/comedi/drivers/dt2814.c
+++ b/drivers/staging/comedi/drivers/dt2814.c
@@ -85,10 +85,8 @@ static int dt2814_ai_insn_read(struct comedi_device *dev,
if (status & DT2814_FINISH)
break;
}
-   if (i >= DT2814_TIMEOUT) {
-   printk(KERN_INFO "dt2814: status: %02x\n", status);
+   if (i >= DT2814_TIMEOUT)
return -ETIMEDOUT;
-   }
 
hi = inb(dev->iobase + DT2814_DATA);
lo = inb(dev->iobase + DT2814_DATA);
-- 
1.8.4.4

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


[PATCH 58/60] staging: comedi: ni_atmio16d: remove printk() noise in atmio16d_ai_insn_read()

2013-11-26 Thread H Hartley Sweeten
These printk messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_atmio16d.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_atmio16d.c 
b/drivers/staging/comedi/drivers/ni_atmio16d.c
index a9f7d40..95e98a8 100644
--- a/drivers/staging/comedi/drivers/ni_atmio16d.c
+++ b/drivers/staging/comedi/drivers/ni_atmio16d.c
@@ -495,18 +495,13 @@ static int atmio16d_ai_insn_read(struct comedi_device 
*dev,
break;
}
if (status & STAT_AD_OVERFLOW) {
-   printk(KERN_INFO "atmio16d: a/d FIFO 
overflow\n");
outw(0, dev->iobase + AD_CLEAR_REG);
-
return -ETIME;
}
}
/* end waiting, now check if it timed out */
-   if (t == ATMIO16D_TIMEOUT) {
-   printk(KERN_INFO "atmio16d: timeout\n");
-
+   if (t == ATMIO16D_TIMEOUT)
return -ETIME;
-   }
}
 
return i;
-- 
1.8.4.4

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


[PATCH 53/60] staging: comedi: pcl816: convert printk messages in pcl816_attach()

2013-11-26 Thread H Hartley Sweeten
Convert the printk messages in this function to dev_{level} mesages.

Remove the ones that are just added noise.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl816.c | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c 
b/drivers/staging/comedi/drivers/pcl816.c
index d38b9fd..c58812e 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -864,7 +864,7 @@ static int pcl816_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
return ret;
 
if (pcl816_check(dev->iobase)) {
-   printk(KERN_ERR ", I cann't detect board. FAIL!\n");
+   dev_err(dev->class_dev, "I can't detect board. FAIL!\n");
return -EIO;
}
 
@@ -896,23 +896,24 @@ static int pcl816_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
goto no_dma;/* DMA disabled */
 
if (((1 << dma) & board->DMAbits) == 0) {
-   printk(", DMA is out of allowed range, FAIL!\n");
+   dev_err(dev->class_dev,
+   "DMA is out of allowed range, FAIL!\n");
return -EINVAL; /* Bad DMA */
}
ret = request_dma(dma, dev->board_name);
if (ret) {
-   printk(KERN_ERR
-  ", unable to allocate DMA %u, FAIL!\n", dma);
+   dev_err(dev->class_dev,
+   "unable to allocate DMA %u, FAIL!\n", dma);
return -EBUSY;  /* DMA isn't free */
}
 
devpriv->dma = dma;
-   printk(KERN_INFO ", dma=%u", dma);
pages = 2;  /* we need 16KB */
devpriv->dmabuf[0] = __get_dma_pages(GFP_KERNEL, pages);
 
if (!devpriv->dmabuf[0]) {
-   printk(", unable to allocate DMA buffer, FAIL!\n");
+   dev_err(dev->class_dev,
+   "unable to allocate DMA buffer, FAIL!\n");
/*
 * maybe experiment with try_to_free_pages()
 * will help 
@@ -925,9 +926,8 @@ static int pcl816_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
 
devpriv->dmabuf[1] = __get_dma_pages(GFP_KERNEL, pages);
if (!devpriv->dmabuf[1]) {
-   printk(KERN_ERR
-   ", unable to allocate DMA buffer, "
-   "FAIL!\n");
+   dev_err(dev->class_dev,
+   "unable to allocate DMA buffer, FAIL!\n");
return -EBUSY;
}
devpriv->dmapages[1] = pages;
@@ -997,8 +997,6 @@ case COMEDI_SUBD_DO:
 
pcl816_reset(dev);
 
-   printk("\n");
-
return 0;
 }
 
-- 
1.8.4.4

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


[PATCH 57/60] staging: comedi: ni_pcimio: convert printk() to dev_dbg()

2013-11-26 Thread H Hartley Sweeten
Convert this printk messages to a dev_dbg().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_pcimio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c 
b/drivers/staging/comedi/drivers/ni_pcimio.c
index aa002b2..5711755 100644
--- a/drivers/staging/comedi/drivers/ni_pcimio.c
+++ b/drivers/staging/comedi/drivers/ni_pcimio.c
@@ -1176,9 +1176,9 @@ static void m_series_stc_writew(struct comedi_device 
*dev, uint16_t data,
offset = M_Offset_AO_FIFO_Clear;
break;
case DIO_Control_Register:
-   printk
-   ("%s: FIXME: register 0x%x does not map cleanly on to 
m-series boards.\n",
-__func__, reg);
+   dev_dbg(dev->class_dev,
+   "%s: FIXME: register 0x%x does not map cleanly on to 
m-series boards.\n",
+   __func__, reg);
return;
break;
case G_Autoincrement_Register(0):
-- 
1.8.4.4

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


[PATCH 44/60] staging: comedi: pcl818: remove commented out printk debug

2013-11-26 Thread H Hartley Sweeten
These messages are just added noise. Remove them.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl818.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index def79c5..5b96800 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -478,7 +478,6 @@ conv_finish:
 
s->async->cur_chan++;
if (s->async->cur_chan >= devpriv->ai_n_chan) {
-   /*  printk("E"); */
s->async->cur_chan = 0;
devpriv->ai_act_scan--;
}
@@ -562,7 +561,6 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, 
void *d)
pcl818_ai_cancel(dev, s);
s->async->events |= COMEDI_CB_EOA;
comedi_event(dev, s);
-   /*  printk("done int ai13 dma\n"); */
return IRQ_HANDLED;
}
}
@@ -661,7 +659,6 @@ static irqreturn_t interrupt_pcl818(int irq, void *d)
comedi_error(dev, "premature interrupt");
return IRQ_HANDLED;
}
-   /* printk("I\n"); */
 
if (devpriv->irq_blocked && devpriv->irq_was_now_closed) {
if ((devpriv->neverending_ai || (!devpriv->neverending_ai &&
@@ -824,7 +821,6 @@ static int pcl818_ai_cmd_mode(int mode, struct 
comedi_device *dev,
case 0:
if (!devpriv->usefifo) {
/* IRQ */
-   /* printk("IRQ\n"); */
if (mode == 1) {
devpriv->ai_mode = INT_TYPE_AI1_INT;
/* Pacer+IRQ */
@@ -899,10 +895,6 @@ static int check_channel_list(struct comedi_device *dev,
chansegment[0] = chanlist[0];
/*  build part of chanlist */
for (i = 1, seglen = 1; i < n_chan; i++, seglen++) {
-
-   /* printk("%d. %d * %d\n",i,
-* 
CR_CHAN(it->chanlist[i]),CR_RANGE(it->chanlist[i]));*/
-
/* we detect loop, this must by finish */
 
if (chanlist[0] == chanlist[i])
@@ -922,7 +914,6 @@ static int check_channel_list(struct comedi_device *dev,
 
/*  check whole chanlist */
for (i = 0, segpos = 0; i < n_chan; i++) {
-   /* printk("%d %d=%d 
%d\n",CR_CHAN(chansegment[i%seglen]),CR_RANGE(chansegment[i%seglen]),CR_CHAN(it->chanlist[i]),CR_RANGE(it->chanlist[i]));
 */
if (chanlist[i] != chansegment[i % seglen]) {
dev_dbg(dev->class_dev,
"bad channel or range number! 
chanlist[%i]=%d,%d,%d and not %d,%d,%d!\n",
@@ -1296,7 +1287,6 @@ static int pcl818_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
devpriv->dmapages[0] = pages;
devpriv->hwdmaptr[0] = virt_to_bus((void *)devpriv->dmabuf[0]);
devpriv->hwdmasize[0] = (1 << pages) * PAGE_SIZE;
-   /* printk("%d %d %ld, 
",devpriv->dmapages[0],devpriv->hwdmasize[0],PAGE_SIZE); */
devpriv->dmabuf[1] = __get_dma_pages(GFP_KERNEL, pages);
if (!devpriv->dmabuf[1])
return -EBUSY;
-- 
1.8.4.4

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


[PATCH 37/60] staging: comedi: mpc624: remove commented out printk

2013-11-26 Thread H Hartley Sweeten
This printk is just added noise. Remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/mpc624.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/mpc624.c 
b/drivers/staging/comedi/drivers/mpc624.c
index acbaeee..2d6add4 100644
--- a/drivers/staging/comedi/drivers/mpc624.c
+++ b/drivers/staging/comedi/drivers/mpc624.c
@@ -159,7 +159,6 @@ static int mpc624_ai_rinsn(struct comedi_device *dev,
 *  We always write 0 to GNSWA bit, so the channel range is +-/10.1Vdc
 */
outb(insn->chanspec, dev->iobase + MPC624_GNMUXCH);
-/* printk("Channel %d:\n", insn->chanspec); */
if (!insn->n) {
printk(KERN_INFO "MPC624: Warning, no data to acquire\n");
return 0;
-- 
1.8.4.4

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


[PATCH 40/60] staging: comedi: mpc624: convert printk messages in mpc624_ai_rinsn()

2013-11-26 Thread H Hartley Sweeten
There's no reason for these messages to be KERN_INFO. Convert them to
dev_dbg().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/mpc624.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/mpc624.c 
b/drivers/staging/comedi/drivers/mpc624.c
index 01b281e..fe4621e 100644
--- a/drivers/staging/comedi/drivers/mpc624.c
+++ b/drivers/staging/comedi/drivers/mpc624.c
@@ -238,11 +238,11 @@ static int mpc624_ai_rinsn(struct comedi_device *dev,
 */
 
if (data_in & MPC624_EOC_BIT)
-   printk(KERN_INFO "MPC624:EOC bit is set (data_in=%lu)!",
-  data_in);
+   dev_dbg(dev->class_dev,
+   "EOC bit is set (data_in=%lu)!", data_in);
if (data_in & MPC624_DMY_BIT)
-   printk(KERN_INFO "MPC624:DMY bit is set (data_in=%lu)!",
-  data_in);
+   dev_dbg(dev->class_dev,
+   "DMY bit is set (data_in=%lu)!", data_in);
if (data_in & MPC624_SGN_BIT) { /* Volatge is positive */
/*
 * comedi operates on unsigned numbers, so mask off EOC
-- 
1.8.4.4

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


[PATCH 49/60] staging: comedi: pcl816: remove commented out outb() macro

2013-11-26 Thread H Hartley Sweeten
This macro is commented out, thankfully... Remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl816.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c 
b/drivers/staging/comedi/drivers/pcl816.c
index 8776c59..e1a59f1 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -48,8 +48,6 @@ Configuration Options:
 /* IO space len */
 #define PCLx1x_RANGE 16
 
-/* #define outb(x,y)  printk("OUTB(%x, 200+%d)\n", x,y-0x200); outb(x,y) */
-
 /* INTEL 8254 counters */
 #define PCL816_CTR0 4
 #define PCL816_CTR1 5
-- 
1.8.4.4

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


[PATCH 50/60] staging: comedi: pcl816: remove TRIG_WAKE_EOS support stub

2013-11-26 Thread H Hartley Sweeten
The support code for this command flag is commented out. Just remove
it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl816.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c 
b/drivers/staging/comedi/drivers/pcl816.c
index e1a59f1..149a28b 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -539,15 +539,6 @@ static int pcl816_ai_cmd(struct comedi_device *dev, struct 
comedi_subdevice *s)
devpriv->ai_neverending = 1;
}
 
-   /*  don't we want wake up every scan? */
-   if ((cmd->flags & TRIG_WAKE_EOS)) {
-   printk(KERN_INFO
-  "pl816: You wankt WAKE_EOS but I dont want handle it");
-   /*   devpriv->ai_eos=1; */
-   /* if (devpriv->ai_n_chan==1) */
-   /*   devpriv->dma=0; // DMA is useless for this situation */
-   }
-
if (devpriv->dma) {
bytes = devpriv->hwdmasize[0];
if (!devpriv->ai_neverending) {
-- 
1.8.4.4

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


[PATCH 05/60] staging: comedi: pcl816: convert some printk's to dev_dbg()

2013-11-26 Thread H Hartley Sweeten
Convert these warning messages to dev_dbg() to minimize the noise.
Also, tidy them up a bit.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl816.c | 28 
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c 
b/drivers/staging/comedi/drivers/pcl816.c
index 7b92aa5..8776c59 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -800,12 +800,10 @@ check_channel_list(struct comedi_device *dev,
(CR_CHAN(chansegment[i - 1]) + 1) % chanlen;
if (nowmustbechan != CR_CHAN(chanlist[i])) {
/*  channel list isn't continuous :-( */
-   printk(KERN_WARNING
-  "comedi%d: pcl816: channel list must "
-  "be continuous! chanlist[%i]=%d but "
-  "must be %d or %d!\n", dev->minor,
-  i, CR_CHAN(chanlist[i]), nowmustbechan,
-  CR_CHAN(chanlist[0]));
+   dev_dbg(dev->class_dev,
+   "channel list must be continuous! 
chanlist[%i]=%d but must be %d or %d!\n",
+   i, CR_CHAN(chanlist[i]), nowmustbechan,
+   CR_CHAN(chanlist[0]));
return 0;
}
/*  well, this is next correct channel in list */
@@ -815,16 +813,14 @@ check_channel_list(struct comedi_device *dev,
/*  check whole chanlist */
for (i = 0, segpos = 0; i < chanlen; i++) {
if (chanlist[i] != chansegment[i % seglen]) {
-   printk(KERN_WARNING
-  "comedi%d: pcl816: bad channel or range"
-  " number! chanlist[%i]=%d,%d,%d and not"
-  " %d,%d,%d!\n", dev->minor, i,
-  CR_CHAN(chansegment[i]),
-  CR_RANGE(chansegment[i]),
-  CR_AREF(chansegment[i]),
-  CR_CHAN(chanlist[i % seglen]),
-  CR_RANGE(chanlist[i % seglen]),
-  CR_AREF(chansegment[i % seglen]));
+   dev_dbg(dev->class_dev,
+   "bad channel or range number! 
chanlist[%i]=%d,%d,%d and not %d,%d,%d!\n",
+   i, CR_CHAN(chansegment[i]),
+   CR_RANGE(chansegment[i]),
+   CR_AREF(chansegment[i]),
+   CR_CHAN(chanlist[i % seglen]),
+   CR_RANGE(chanlist[i % seglen]),
+   CR_AREF(chansegment[i % seglen]));
return 0;   /*  chan/gain list is strange */
}
}
-- 
1.8.4.4

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


[PATCH 04/60] staging: comedi: pcl812: convert some printk's to dev_dbg()

2013-11-26 Thread H Hartley Sweeten
Convert these debug messages to dev_dbg() and tidy them up a bit.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl812.c | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl812.c 
b/drivers/staging/comedi/drivers/pcl812.c
index 03315ab..e31cf44 100644
--- a/drivers/staging/comedi/drivers/pcl812.c
+++ b/drivers/staging/comedi/drivers/pcl812.c
@@ -404,9 +404,7 @@ static int pcl812_ai_insn_read(struct comedi_device *dev,
goto conv_finish;
udelay(1);
}
-   printk
-   ("comedi%d: pcl812: (%s at 0x%lx) A/D insn read timeout\n",
-dev->minor, dev->board_name, dev->iobase);
+   dev_dbg(dev->class_dev, "A/D insn read timeout\n");
outb(devpriv->mode_reg_int | 0, dev->iobase + PCL812_MODE);
return -ETIME;
 
@@ -441,9 +439,7 @@ static int acl8216_ai_insn_read(struct comedi_device *dev,
goto conv_finish;
udelay(1);
}
-   printk
-   ("comedi%d: pcl812: (%s at 0x%lx) A/D insn read timeout\n",
-dev->minor, dev->board_name, dev->iobase);
+   dev_dbg(dev->class_dev, "A/D insn read timeout\n");
outb(0, dev->iobase + PCL812_MODE);
return -ETIME;
 
@@ -786,10 +782,7 @@ static irqreturn_t interrupt_pcl812_ai_int(int irq, void 
*d)
}
 
if (err) {
-   printk
-   ("comedi%d: pcl812: (%s at 0x%lx) "
-"A/D cmd IRQ without DRDY!\n",
-dev->minor, dev->board_name, dev->iobase);
+   dev_dbg(dev->class_dev, "A/D cmd IRQ without DRDY!\n");
pcl812_ai_cancel(dev, s);
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
comedi_event(dev, s);
-- 
1.8.4.4

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


[PATCH 55/60] staging: comedi: pcl812: convert printk messages in pcl812_attach()

2013-11-26 Thread H Hartley Sweeten
Convert the printk messages in this function to dev_{level} mesages.

Remove the ones that are just added noise.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl812.c | 27 ---
 1 file changed, 8 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl812.c 
b/drivers/staging/comedi/drivers/pcl812.c
index 804174b..e1e4cd1 100644
--- a/drivers/staging/comedi/drivers/pcl812.c
+++ b/drivers/staging/comedi/drivers/pcl812.c
@@ -1115,21 +1115,22 @@ static int pcl812_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
if (board->DMAbits != 0) {  /* board support DMA */
dma = it->options[2];
if (((1 << dma) & board->DMAbits) == 0) {
-   printk(", DMA is out of allowed range, FAIL!\n");
+   dev_err(dev->class_dev,
+   "DMA is out of allowed range, FAIL!\n");
return -EINVAL; /* Bad DMA */
}
ret = request_dma(dma, dev->board_name);
if (ret) {
-   printk(KERN_ERR ", unable to allocate DMA %u, FAIL!\n",
-  dma);
+   dev_err(dev->class_dev,
+   "unable to allocate DMA %u, FAIL!\n", dma);
return -EBUSY;  /* DMA isn't free */
}
devpriv->dma = dma;
-   printk(KERN_INFO ", dma=%u", dma);
pages = 1;  /* we want 8KB */
devpriv->dmabuf[0] = __get_dma_pages(GFP_KERNEL, pages);
if (!devpriv->dmabuf[0]) {
-   printk(", unable to allocate DMA buffer, FAIL!\n");
+   dev_err(dev->class_dev,
+   "unable to allocate DMA buffer, FAIL!\n");
/*
 * maybe experiment with try_to_free_pages()
 * will help 
@@ -1141,7 +1142,8 @@ static int pcl812_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
devpriv->hwdmasize[0] = PAGE_SIZE * (1 << pages);
devpriv->dmabuf[1] = __get_dma_pages(GFP_KERNEL, pages);
if (!devpriv->dmabuf[1]) {
-   printk(KERN_ERR ", unable to allocate DMA buffer, 
FAIL!\n");
+   dev_err(dev->class_dev,
+   "unable to allocate DMA buffer, FAIL!\n");
return -EBUSY;
}
devpriv->dmapages[1] = pages;
@@ -1243,10 +1245,6 @@ no_dma:
default:
s->range_table = &range_bipolar10;
break;
-   printk
-   (", incorrect range number %d, changing "
-"to 0 (+/-10V)", it->options[4]);
-   break;
}
break;
break;
@@ -1273,10 +1271,6 @@ no_dma:
default:
s->range_table = &range_iso813_1_ai;
break;
-   printk
-   (", incorrect range number %d, "
-"changing to 0 ", it->options[1]);
-   break;
}
break;
case boardACL8113:
@@ -1298,10 +1292,6 @@ no_dma:
default:
s->range_table = &range_acl8113_1_ai;
break;
-   printk
-   (", incorrect range number %d, "
-"changing to 0 ", it->options[1]);
-   break;
}
break;
}
@@ -1387,7 +1377,6 @@ no_dma:
break;
}
 
-   printk(KERN_INFO "\n");
devpriv->valid = 1;
 
pcl812_reset(dev);
-- 
1.8.4.4

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


[PATCH 23/60] staging: comedi: dt2814: remove bad printk noise

2013-11-26 Thread H Hartley Sweeten
This printk could spew a lot of noise while waiting for the ai conversion
to complete. Just remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt2814.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/dt2814.c 
b/drivers/staging/comedi/drivers/dt2814.c
index 90defd5..3a05588 100644
--- a/drivers/staging/comedi/drivers/dt2814.c
+++ b/drivers/staging/comedi/drivers/dt2814.c
@@ -80,7 +80,6 @@ static int dt2814_ai_insn_read(struct comedi_device *dev,
outb(chan, dev->iobase + DT2814_CSR);
for (i = 0; i < DT2814_TIMEOUT; i++) {
status = inb(dev->iobase + DT2814_CSR);
-   printk(KERN_INFO "dt2814: status: %02x\n", status);
udelay(10);
if (status & DT2814_FINISH)
break;
-- 
1.8.4.4

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


[PATCH 12/60] staging: comedi: das16m1: tidy up the irq support in das16m1_attach()

2013-11-26 Thread H Hartley Sweeten
An irq is only needed by this driver in order to support async commands.
Since it is optional, modify the attach so that if an invalid irq is
selected by the user, or the request_irq() fails, the attach does not
fail.

Remove all the printk noise about the irq.

Only hookup the async command support if the request_irq() was successful.

Tidy up das16m1_irq_bits() a bit. This helper returns the value that needs
to be written to the DAS16M1_INTR_CONTROL register to setup the irq routing.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/das16m1.c | 78 +++-
 1 file changed, 26 insertions(+), 52 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das16m1.c 
b/drivers/staging/comedi/drivers/das16m1.c
index fce9acf..0081ee4 100644
--- a/drivers/staging/comedi/drivers/das16m1.c
+++ b/drivers/staging/comedi/drivers/das16m1.c
@@ -508,38 +508,26 @@ static irqreturn_t das16m1_interrupt(int irq, void *d)
 
 static int das16m1_irq_bits(unsigned int irq)
 {
-   int ret;
-
switch (irq) {
case 10:
-   ret = 0x0;
-   break;
+   return 0x0;
case 11:
-   ret = 0x1;
-   break;
+   return 0x1;
case 12:
-   ret = 0x2;
-   break;
+   return 0x2;
case 15:
-   ret = 0x3;
-   break;
+   return 0x3;
case 2:
-   ret = 0x4;
-   break;
+   return 0x4;
case 3:
-   ret = 0x5;
-   break;
+   return 0x5;
case 5:
-   ret = 0x6;
-   break;
+   return 0x6;
case 7:
-   ret = 0x7;
-   break;
+   return 0x7;
default:
-   return -1;
-   break;
+   return 0x0;
}
-   return ret << 4;
 }
 
 /*
@@ -553,7 +541,6 @@ static int das16m1_attach(struct comedi_device *dev,
struct das16m1_private_struct *devpriv;
struct comedi_subdevice *s;
int ret;
-   unsigned int irq;
 
devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
if (!devpriv)
@@ -569,24 +556,12 @@ static int das16m1_attach(struct comedi_device *dev,
return ret;
devpriv->extra_iobase = dev->iobase + DAS16M1_82C55;
 
-   /* now for the irq */
-   irq = it->options[1];
-   /*  make sure it is valid */
-   if (das16m1_irq_bits(irq) >= 0) {
-   ret = request_irq(irq, das16m1_interrupt, 0,
- dev->driver->driver_name, dev);
-   if (ret < 0)
-   return ret;
-   dev->irq = irq;
-   printk
-   ("irq %u\n", irq);
-   } else if (irq == 0) {
-   printk
-   (", no irq\n");
-   } else {
-   comedi_error(dev, "invalid irq\n"
-" valid irqs are 2, 3, 5, 7, 10, 11, 12, or 15\n");
-   return -EINVAL;
+   /* only irqs 2, 3, 4, 5, 6, 7, 10, 11, 12, 14, and 15 are valid */
+   if ((1 << it->options[1]) & 0xdcfc) {
+   ret = request_irq(it->options[1], das16m1_interrupt, 0,
+ dev->board_name, dev);
+   if (ret == 0)
+   dev->irq = it->options[1];
}
 
ret = comedi_alloc_subdevices(dev, 4);
@@ -594,20 +569,22 @@ static int das16m1_attach(struct comedi_device *dev,
return ret;
 
s = &dev->subdevices[0];
-   dev->read_subdev = s;
/* ai */
s->type = COMEDI_SUBD_AI;
-   s->subdev_flags = SDF_READABLE | SDF_CMD_READ;
+   s->subdev_flags = SDF_READABLE | SDF_DIFF;
s->n_chan = 8;
-   s->subdev_flags = SDF_DIFF;
-   s->len_chanlist = 256;
s->maxdata = (1 << 12) - 1;
s->range_table = &range_das16m1;
s->insn_read = das16m1_ai_rinsn;
-   s->do_cmdtest = das16m1_cmd_test;
-   s->do_cmd = das16m1_cmd_exec;
-   s->cancel = das16m1_cancel;
-   s->poll = das16m1_poll;
+   if (dev->irq) {
+   dev->read_subdev = s;
+   s->subdev_flags |= SDF_CMD_READ;
+   s->len_chanlist = 256;
+   s->do_cmdtest = das16m1_cmd_test;
+   s->do_cmd = das16m1_cmd_exec;
+   s->cancel = das16m1_cancel;
+   s->poll = das16m1_poll;
+   }
 
s = &dev->subdevices[1];
/* di */
@@ -640,10 +617,7 @@ static int das16m1_attach(struct comedi_device *dev,
outb(0, dev->iobase + DAS16M1_DIO);
 
/* set the interrupt level */
-   if (dev->irq)
-   devpriv->control_state = das16m1_irq_bits(dev->irq);
-   else
-   devpriv->control_state = 0;
+   devpriv->control_state = das16m1_irq_bits(dev->irq) << 4;
outb(devpriv->cont

[PATCH 31/60] staging: comedi: dt282x: remove unnecessary blank line message

2013-11-26 Thread H Hartley Sweeten
This blank line message is not needed. Remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt282x.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index 2e8d777..83e9d01 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -1221,8 +1221,6 @@ static int dt282x_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
s->maxdata = 1;
s->range_table = &range_digital;
 
-   printk(KERN_INFO "\n");
-
return 0;
 }
 
-- 
1.8.4.4

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


[PATCH 30/60] staging: comedi: dt282x: convert printk() in dt282x_attach to a dev_err()

2013-11-26 Thread H Hartley Sweeten
Convert this printk message into a dev_err().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt282x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index 7de9c44..2e8d777 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -1133,7 +1133,7 @@ static int dt282x_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
 != DT2821_SUPCSR_VAL) ||
((inw(dev->iobase + DT2821_TMRCTR) & DT2821_TMRCTR_MASK)
 != DT2821_TMRCTR_VAL)) {
-   printk(KERN_ERR " board not found");
+   dev_err(dev->class_dev, "board not found\n");
return -EIO;
}
/* should do board test */
-- 
1.8.4.4

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


[PATCH 59/60] staging: comedi: ni_atmio16d: tidy up the irq support in atmio16d_attach()

2013-11-26 Thread H Hartley Sweeten
Tidy up the code that does the request_irq().

Only hookup the commad support if the irq was sucessfully requested.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_atmio16d.c | 34 
 1 file changed, 14 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_atmio16d.c 
b/drivers/staging/comedi/drivers/ni_atmio16d.c
index 95e98a8..35cadc3 100644
--- a/drivers/staging/comedi/drivers/ni_atmio16d.c
+++ b/drivers/staging/comedi/drivers/ni_atmio16d.c
@@ -631,7 +631,6 @@ static int atmio16d_attach(struct comedi_device *dev,
const struct atmio16_board_t *board = comedi_board(dev);
struct atmio16d_private *devpriv;
struct comedi_subdevice *s;
-   unsigned int irq;
int ret;
 
ret = comedi_request_region(dev, it->options[0], ATMIO16D_SIZE);
@@ -649,19 +648,11 @@ static int atmio16d_attach(struct comedi_device *dev,
/* reset the atmio16d hardware */
reset_atmio16d(dev);
 
-   /* check if our interrupt is available and get it */
-   irq = it->options[1];
-   if (irq) {
-
-   ret = request_irq(irq, atmio16d_interrupt, 0, "atmio16d", dev);
-   if (ret < 0) {
-   printk(KERN_INFO "failed to allocate irq %u\n", irq);
-   return ret;
-   }
-   dev->irq = irq;
-   printk(KERN_INFO "( irq = %u )\n", irq);
-   } else {
-   printk(KERN_INFO "( no irq )");
+   if (it->options[1]) {
+   ret = request_irq(it->options[1], atmio16d_interrupt, 0,
+ dev->board_name, dev);
+   if (ret == 0)
+   dev->irq = it->options[1];
}
 
/* set device options */
@@ -677,16 +668,11 @@ static int atmio16d_attach(struct comedi_device *dev,
 
/* setup sub-devices */
s = &dev->subdevices[0];
-   dev->read_subdev = s;
/* ai subdevice */
s->type = COMEDI_SUBD_AI;
-   s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_CMD_READ;
+   s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = (devpriv->adc_mux ? 16 : 8);
-   s->len_chanlist = 16;
s->insn_read = atmio16d_ai_insn_read;
-   s->do_cmdtest = atmio16d_ai_cmdtest;
-   s->do_cmd = atmio16d_ai_cmd;
-   s->cancel = atmio16d_ai_cancel;
s->maxdata = 0xfff; /* 4095 decimal */
switch (devpriv->adc_range) {
case adc_bipolar10:
@@ -699,6 +685,14 @@ static int atmio16d_attach(struct comedi_device *dev,
s->range_table = &range_atmio16d_ai_unipolar;
break;
}
+   if (dev->irq) {
+   dev->read_subdev = s;
+   s->subdev_flags |= SDF_CMD_READ;
+   s->len_chanlist = 16;
+   s->do_cmdtest = atmio16d_ai_cmdtest;
+   s->do_cmd = atmio16d_ai_cmd;
+   s->cancel = atmio16d_ai_cancel;
+   }
 
/* ao subdevice */
s = &dev->subdevices[1];
-- 
1.8.4.4

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


[PATCH 06/60] staging: comedi: pcl818: convert some printk's to dev_dbg()

2013-11-26 Thread H Hartley Sweeten
Convert these messages to dev_dbg() and tidy them up a bit.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl818.c | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c 
b/drivers/staging/comedi/drivers/pcl818.c
index be9cb8d..def79c5 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -910,10 +910,10 @@ static int check_channel_list(struct comedi_device *dev,
nowmustbechan =
(CR_CHAN(chansegment[i - 1]) + 1) % s->n_chan;
if (nowmustbechan != CR_CHAN(chanlist[i])) {/*  
channel list isn't continuous :-( */
-   printk
-   ("comedi%d: pcl818: channel list must be 
continuous! chanlist[%i]=%d but must be %d or %d!\n",
-dev->minor, i, CR_CHAN(chanlist[i]),
-nowmustbechan, CR_CHAN(chanlist[0]));
+   dev_dbg(dev->class_dev,
+   "channel list must be continuous! 
chanlist[%i]=%d but must be %d or %d!\n",
+   i, CR_CHAN(chanlist[i]), nowmustbechan,
+   CR_CHAN(chanlist[0]));
return 0;
}
/*  well, this is next correct channel in list */
@@ -924,14 +924,14 @@ static int check_channel_list(struct comedi_device *dev,
for (i = 0, segpos = 0; i < n_chan; i++) {
/* printk("%d %d=%d 
%d\n",CR_CHAN(chansegment[i%seglen]),CR_RANGE(chansegment[i%seglen]),CR_CHAN(it->chanlist[i]),CR_RANGE(it->chanlist[i]));
 */
if (chanlist[i] != chansegment[i % seglen]) {
-   printk
-   ("comedi%d: pcl818: bad channel or range 
number! chanlist[%i]=%d,%d,%d and not %d,%d,%d!\n",
-dev->minor, i, CR_CHAN(chansegment[i]),
-CR_RANGE(chansegment[i]),
-CR_AREF(chansegment[i]),
-CR_CHAN(chanlist[i % seglen]),
-CR_RANGE(chanlist[i % seglen]),
-CR_AREF(chansegment[i % seglen]));
+   dev_dbg(dev->class_dev,
+   "bad channel or range number! 
chanlist[%i]=%d,%d,%d and not %d,%d,%d!\n",
+   i, CR_CHAN(chansegment[i]),
+   CR_RANGE(chansegment[i]),
+   CR_AREF(chansegment[i]),
+   CR_CHAN(chanlist[i % seglen]),
+   CR_RANGE(chanlist[i % seglen]),
+   CR_AREF(chansegment[i % seglen]));
return 0;   /*  chan/gain list is strange */
}
}
-- 
1.8.4.4

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


[PATCH 08/60] staging: comedi: c6xdigio: remove commented out subdevice code

2013-11-26 Thread H Hartley Sweeten
The code to initialize subdevice[2] is commented out and incomplete.
Just remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/c6xdigio.c | 31 ---
 1 file changed, 31 deletions(-)

diff --git a/drivers/staging/comedi/drivers/c6xdigio.c 
b/drivers/staging/comedi/drivers/c6xdigio.c
index a85b949..7512eaf 100644
--- a/drivers/staging/comedi/drivers/c6xdigio.c
+++ b/drivers/staging/comedi/drivers/c6xdigio.c
@@ -338,26 +338,6 @@ static int c6xdigio_pwmo_insn_write(struct comedi_device 
*dev,
return i;
 }
 
-/* static int c6xdigio_ei_init_insn_read(struct comedi_device *dev, */
-/* struct comedi_subdevice *s, */
-/* struct comedi_insn *insn, */
-/* unsigned int *data) */
-/* { */
-/* printk("c6xdigio_ei_init_insn_read %x\n", insn->n); */
-/* return insn->n; */
-/* } */
-
-/* static int c6xdigio_ei_init_insn_write(struct comedi_device *dev, */
-/* struct comedi_subdevice *s, */
-/* struct comedi_insn *insn, */
-/* unsigned int *data) */
-/* { */
-/* int i; */
-/* int chan = CR_CHAN(insn->chanspec); */
-  /*  *//* C6X_encResetAll( dev->iobase ); */
-  /*  *//* return insn->n; */
-/* } */
-
 static int c6xdigio_ei_insn_read(struct comedi_device *dev,
 struct comedi_subdevice *s,
 struct comedi_insn *insn, unsigned int *data)
@@ -432,17 +412,6 @@ static int c6xdigio_attach(struct comedi_device *dev,
s->maxdata = 0xff;
s->range_table = &range_unknown;
 
-   /*  s = &dev->subdevices[2]; */
-   /* pwm output subdevice */
-   /*  s->type = COMEDI_SUBD_COUNTER;  // Not sure what to put here */
-   /*  s->subdev_flags = SDF_WRITEABLE; */
-   /*  s->n_chan = 1; */
-   /*  s->trig[0] = c6xdigio_ei_init; */
-   /*  s->insn_read = c6xdigio_ei_init_insn_read; */
-   /*  s->insn_write = c6xdigio_ei_init_insn_write; */
-   /*  s->maxdata = 0x;  // Really just a don't care */
-   /*  s->range_table = &range_unknown; // Not sure what to put here */
-
/*  I will call this init anyway but more than likely the DSP board */
/*  will not be connected when device driver is loaded. */
board_init(dev);
-- 
1.8.4.4

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


[PATCH 34/60] staging: comedi: dt282x: convert dt282x_ai_dma_interrupt() messages

2013-11-26 Thread H Hartley Sweeten
Convert the messages in this function to dev_{level}().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt282x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index 822ce02..c8df18a 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -348,7 +348,7 @@ static void dt282x_ai_dma_interrupt(struct comedi_device 
*dev)
outw(devpriv->supcsr | DT2821_CLRDMADNE, dev->iobase + DT2821_SUPCSR);
 
if (!s->async->prealloc_buf) {
-   printk(KERN_ERR "async->data disappeared.  dang!\n");
+   dev_err(dev->class_dev, "no buffer in %s\n", __func__);
return;
}
 
@@ -369,7 +369,7 @@ static void dt282x_ai_dma_interrupt(struct comedi_device 
*dev)
devpriv->nread -= size / 2;
 
if (devpriv->nread < 0) {
-   printk(KERN_INFO "dt282x: off by one\n");
+   dev_info(dev->class_dev, "nread off by one\n");
devpriv->nread = 0;
}
if (!devpriv->nread) {
-- 
1.8.4.4

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


[PATCH 32/60] staging: comedi: dt282x: remove disable code that disables the irq

2013-11-26 Thread H Hartley Sweeten
The code that would disable the irq after getting a number of D/A errors
is disabled. Just remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt282x.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index 83e9d01..b15520b 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -479,13 +479,6 @@ static irqreturn_t dt282x_interrupt(int irq, void *d)
handled = 1;
}
if (dacsr & DT2821_DAERR) {
-#if 0
-   static int warn = 5;
-   if (--warn <= 0) {
-   disable_irq(dev->irq);
-   printk(KERN_INFO "disabling irq\n");
-   }
-#endif
comedi_error(dev, "D/A error");
dt282x_ao_cancel(dev, s_ao);
s->async->events |= COMEDI_CB_ERROR;
-- 
1.8.4.4

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


[PATCH 56/60] staging: comedi: ni_tio: remove commented out printk message

2013-11-26 Thread H Hartley Sweeten
This printk message is just added noise. Remove it.

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/ni_tio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_tio.c 
b/drivers/staging/comedi/drivers/ni_tio.c
index 9b120c7..cf8892b 100644
--- a/drivers/staging/comedi/drivers/ni_tio.c
+++ b/drivers/staging/comedi/drivers/ni_tio.c
@@ -1319,7 +1319,6 @@ static int ni_tio_set_other_src(struct ni_gpct *counter, 
unsigned index,
counter_dev->regs[abz_reg] &= ~mask;
counter_dev->regs[abz_reg] |= (source << shift) & mask;
write_register(counter, counter_dev->regs[abz_reg], abz_reg);
-/* printk("%s %x %d %d\n", __func__, counter_dev->regs[abz_reg], index, 
source); */
return 0;
}
return -EINVAL;
-- 
1.8.4.4

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


[PATCH 33/60] staging: comedi: dt282x: convert dt282x_ao_dma_interrupt() messages

2013-11-26 Thread H Hartley Sweeten
Convert the messages in this function to dev_err().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/dt282x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt282x.c 
b/drivers/staging/comedi/drivers/dt282x.c
index b15520b..822ce02 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -314,7 +314,7 @@ static void dt282x_ao_dma_interrupt(struct comedi_device 
*dev)
outw(devpriv->supcsr | DT2821_CLRDMADNE, dev->iobase + DT2821_SUPCSR);
 
if (!s->async->prealloc_buf) {
-   printk(KERN_ERR "async->data disappeared.  dang!\n");
+   dev_err(dev->class_dev, "no buffer in %s\n", __func__);
return;
}
 
@@ -327,7 +327,7 @@ static void dt282x_ao_dma_interrupt(struct comedi_device 
*dev)
 
size = cfc_read_array_from_buffer(s, ptr, devpriv->dma_maxsize);
if (size == 0) {
-   printk(KERN_ERR "dt282x: AO underrun\n");
+   dev_err(dev->class_dev, "AO underrun\n");
dt282x_ao_cancel(dev, s);
s->async->events |= COMEDI_CB_OVERFLOW;
return;
-- 
1.8.4.4

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


[PATCH 54/60] staging: comedi: pcl812: tidy up the irq support in pcl812_attach()

2013-11-26 Thread H Hartley Sweeten
Tidy up the code that does the request_irq().

Signed-off-by: H Hartley Sweeten 
Cc: Ian Abbott 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/comedi/drivers/pcl812.c | 31 ++-
 1 file changed, 6 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl812.c 
b/drivers/staging/comedi/drivers/pcl812.c
index e31cf44..804174b 100644
--- a/drivers/staging/comedi/drivers/pcl812.c
+++ b/drivers/staging/comedi/drivers/pcl812.c
@@ -1088,7 +1088,6 @@ static int pcl812_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
const struct pcl812_board *board = comedi_board(dev);
struct pcl812_private *devpriv;
int ret, subdev;
-   unsigned int irq;
unsigned int dma;
unsigned long pages;
struct comedi_subdevice *s;
@@ -1102,31 +1101,13 @@ static int pcl812_attach(struct comedi_device *dev, 
struct comedi_devconfig *it)
if (!devpriv)
return -ENOMEM;
 
-   irq = 0;
-   if (board->IRQbits != 0) {  /* board support IRQ */
-   irq = it->options[1];
-   if (irq) {  /* we want to use IRQ */
-   if (((1 << irq) & board->IRQbits) == 0) {
-   printk
-   (", IRQ %u is out of allowed range, "
-"DISABLING IT", irq);
-   irq = 0;/* Bad IRQ */
-   } else {
-   if (request_irq(irq, interrupt_pcl812, 0,
-   dev->board_name, dev)) {
-   printk
-   (", unable to allocate IRQ %u, "
-"DISABLING IT", irq);
-   irq = 0;/* Can't use IRQ */
-   } else {
-   printk(KERN_INFO ", irq=%u", irq);
-   }
-   }
-   }
+   if ((1 << it->options[1]) & board->IRQbits) {
+   ret = request_irq(it->options[1], interrupt_pcl812, 0,
+ dev->board_name, dev);
+   if (ret == 0)
+   dev->irq = it->options[1];
}
 
-   dev->irq = irq;
-
dma = 0;
devpriv->dma = dma;
if (!dev->irq)
@@ -1395,7 +1376,7 @@ no_dma:
break;
case boardA821:
devpriv->max_812_ai_mode0_rangewait = 1;
-   devpriv->mode_reg_int = (irq << 4) & 0xf0;
+   devpriv->mode_reg_int = (dev->irq << 4) & 0xf0;
break;
case boardPCL813B:
case boardPCL813:
-- 
1.8.4.4

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


[PATCH -next] staging: rts5208: fix error return code in rtsx_probe()

2013-11-26 Thread Wei Yongjun
From: Wei Yongjun 

Fix to return -ENOMEM instead of 0 when the memory alloc fail
in probe error handling path.

Signed-off-by: Wei Yongjun 
---
 drivers/staging/rts5208/rtsx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index 7882f57..8586ac5 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -896,8 +896,10 @@ static int rtsx_probe(struct pci_dev *pci,
memset(dev, 0, sizeof(struct rtsx_dev));
 
dev->chip = kzalloc(sizeof(struct rtsx_chip), GFP_KERNEL);
-   if (dev->chip == NULL)
+   if (dev->chip == NULL) {
+   err = -ENOMEM;
goto errout;
+   }
 
spin_lock_init(&dev->reg_lock);
mutex_init(&(dev->dev_mutex));

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


[PATCH V2] staging: dwc2: set up all module params

2013-11-26 Thread Stephen Warren
The DWC2 USB controller in the BCM2835 (Raspberry Pi) needs some non-
default parameters. Select these based on the compatible value from the
DT node. For all other HW, fall back to the default parameters currently
in use.

The values in params_bcm2835[] were posted to the mailing list by Paul
quite some time ago. I made a couple of minor modifications since then;
to set ahbcfg instead of ahb_single, and to set uframe_sched.

Signed-off-by: Stephen Warren 
---
v2:
* Handle !match->data correctly.
* Set uframe_sched core parameter.
---
 Documentation/devicetree/bindings/staging/dwc2.txt |4 +-
 drivers/staging/dwc2/platform.c|   58 
 2 files changed, 51 insertions(+), 11 deletions(-)

diff --git a/Documentation/devicetree/bindings/staging/dwc2.txt 
b/Documentation/devicetree/bindings/staging/dwc2.txt
index 1a1b7cf..8b60e90 100644
--- a/Documentation/devicetree/bindings/staging/dwc2.txt
+++ b/Documentation/devicetree/bindings/staging/dwc2.txt
@@ -2,7 +2,9 @@ Platform DesignWare HS OTG USB 2.0 controller
 -
 
 Required properties:
-- compatible : "snps,dwc2"
+- compatible : One of:
+  - brcm,bcm2835-usb: The DWC2 USB controller instance in the BCM2835 SoC.
+  - snps,dwc2: A generic DWC2 USB controller with default parameters.
 - reg : Should contain 1 register range (address and length)
 - interrupts : Should contain 1 interrupt
 
diff --git a/drivers/staging/dwc2/platform.c b/drivers/staging/dwc2/platform.c
index 4d9fac0..28a78fe 100644
--- a/drivers/staging/dwc2/platform.c
+++ b/drivers/staging/dwc2/platform.c
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "core.h"
@@ -46,6 +47,34 @@
 
 static const char dwc2_driver_name[] = "dwc2";
 
+static const struct dwc2_core_params params_bcm2835 = {
+   .otg_cap= 0,/* HNP/SRP capable */
+   .otg_ver= 0,/* 1.3 */
+   .dma_enable = 1,
+   .dma_desc_enable= 0,
+   .speed  = 0,/* High Speed */
+   .enable_dynamic_fifo= 1,
+   .en_multiple_tx_fifo= 1,
+   .host_rx_fifo_size  = 774,  /* 774 DWORDs */
+   .host_nperio_tx_fifo_size   = 256,  /* 256 DWORDs */
+   .host_perio_tx_fifo_size= 512,  /* 512 DWORDs */
+   .max_transfer_size  = 65535,
+   .max_packet_count   = 511,
+   .host_channels  = 8,
+   .phy_type   = 1,/* UTMI */
+   .phy_utmi_width = 8,/* 8 bits */
+   .phy_ulpi_ddr   = 0,/* Single */
+   .phy_ulpi_ext_vbus  = 0,
+   .i2c_enable = 0,
+   .ulpi_fs_ls = 0,
+   .host_support_fs_ls_low_power   = 0,
+   .host_ls_low_power_phy_clk  = 0,/* 48 MHz */
+   .ts_dline   = 0,
+   .reload_ctl = 0,
+   .ahbcfg = 0x10,
+   .uframe_sched   = 1,
+};
+
 /**
  * dwc2_driver_remove() - Called when the DWC_otg core is unregistered with the
  * DWC_otg driver
@@ -66,6 +95,13 @@ static int dwc2_driver_remove(struct platform_device *dev)
return 0;
 }
 
+static const struct of_device_id dwc2_of_match_table[] = {
+   { .compatible = "brcm,bcm2835-usb", .data = ¶ms_bcm2835 },
+   { .compatible = "snps,dwc2", .data = NULL },
+   {},
+};
+MODULE_DEVICE_TABLE(of, dwc2_of_match_table);
+
 /**
  * dwc2_driver_probe() - Called when the DWC_otg core is bound to the DWC_otg
  * driver
@@ -80,14 +116,22 @@ static int dwc2_driver_remove(struct platform_device *dev)
  */
 static int dwc2_driver_probe(struct platform_device *dev)
 {
+   const struct of_device_id *match;
+   const struct dwc2_core_params *params;
+   struct dwc2_core_params defparams;
struct dwc2_hsotg *hsotg;
struct resource *res;
int retval;
int irq;
-   struct dwc2_core_params params;
 
-   /* Default all params to autodetect */
-   dwc2_set_all_params(¶ms, -1);
+   match = of_match_device(dwc2_of_match_table, &dev->dev);
+   if (match && match->data) {
+   params = match->data;
+   } else {
+   /* Default all params to autodetect */
+   dwc2_set_all_params(&defparams, -1);
+   params = &defparams;
+   }
 
hsotg = devm_kzalloc(&dev->dev, sizeof(*hsotg), GFP_KERNEL);
if (!hsotg)
@@ -118,7 +162,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
dev_dbg(&dev->dev, "mapped PA %08lx to VA %p\n",
(unsigned long)res->start, hsotg->regs);
 
-   retval = dwc2_hcd_init(hsotg, irq, ¶ms);
+   retval = dwc2_hcd_init(hsotg, irq, params);
if (retval)
return retval;
 
@@ -127,12 +171,6 @@ sta

  1   2   >