diff options
author | Hector Palacios <hector.palacios@digi.com> | 2011-01-25 10:01:34 +0100 |
---|---|---|
committer | Hector Palacios <hector.palacios@digi.com> | 2011-01-26 12:21:45 +0100 |
commit | f30c42c96ac299f44cec24c0493f2d2406e45988 (patch) | |
tree | 693f024be9d7bcd411e0c831e935284dfc0c4f9d /drivers/fims | |
parent | 7b5bacb4ffa555f85d4834619a25b7fc8e1faf09 (diff) |
fims: remove extra blank lines
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Diffstat (limited to 'drivers/fims')
-rw-r--r-- | drivers/fims/fim.c | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/drivers/fims/fim.c b/drivers/fims/fim.c index a76aa93b7fc5..9cc69986704a 100644 --- a/drivers/fims/fim.c +++ b/drivers/fims/fim.c @@ -78,7 +78,6 @@ MODULE_VERSION("0.1"); # define printk_debug(fmt, args...) #endif - #define PIC_IS_LOCKED(pic) (atomic_read(&pic->requested)) #define PIC_LOCK_REQUEST(pic) do { atomic_set(&pic->requested, 1); } while (0) #define PIC_FREE_REQUEST(pic) do { atomic_set(&pic->requested, 0); } while (0) @@ -87,7 +86,6 @@ MODULE_VERSION("0.1"); #define PIC_TX_FREE(pic) do { atomic_set(&pic->tx_tasked, 0); } while (0) #define PIC_TX_IS_FREE(pic) (!atomic_read(&pic->tx_tasked)) - /* Use the same function for all the binary attributes */ #define FIM_SYSFS_ATTR(_name) \ { \ @@ -99,7 +97,6 @@ MODULE_VERSION("0.1"); .read = fim_sysfs_attr_read, \ } - struct fims_t { struct pic_t pics[FIM_NR_PICS]; struct bus_type *bus_type; @@ -109,17 +106,14 @@ struct fims_t { static struct fims_t *the_fims; - static int pic_config_output_clock_divisor(struct pic_t *pic, struct fim_program_t *program); static int pic_send_interrupt(struct pic_t *pic, unsigned int code); - static int pic_download_firmware(struct pic_t *pic, const unsigned char *buffer); static int pic_stop_and_reset(struct pic_t *pic); static int pic_start_at_zero(struct pic_t *pic); - static int fim_remove(struct device *dev); static int fim_probe(struct device *dev); static irqreturn_t pic_irq(int irq, void *tpic); @@ -127,14 +121,12 @@ static int pic_dma_init(struct pic_t *pic, struct fim_dma_cfg_t *cfg); static void pic_dma_stop(struct pic_t *pic); static int pic_is_running(struct pic_t *pic); - /* Interrupt handlers */ static void isr_from_pic(struct pic_t *pic, int irqnr); static void isr_dma_tx(struct pic_t *pic, int irqnr); static void isr_dma_rx(struct pic_t *pic, int irqnr); static int fim_start_tx_dma(struct pic_t *pic); - /* * Be aware with this function, we have max. one PAGE available for writing into * the return buffer @@ -211,7 +203,6 @@ static ssize_t fim_sysfs_attr_read(struct file *filp, struct kobject *kobj, return size; } - /* These are the non-default binary attributes for the FIMs */ static struct bin_attribute fim_sysfs_attrs[] = { FIM_SYSFS_ATTR(irq), @@ -224,8 +215,6 @@ static struct bin_attribute fim_sysfs_attrs[] = { FIM_SYSFS_ATTR(rxdma), }; - - /* * This tasklet will search for full receive DMA-buffers * Only if the PIC has an associated driver the corresponding callback will be started @@ -288,8 +277,6 @@ static void pic_rx_tasklet_func(unsigned long data) spin_unlock(&pic->rx_lock); } - - inline static struct pic_t *get_pic_by_index(int index) { if (index < FIM_MIN_PIC_INDEX || index > FIM_MAX_PIC_INDEX) @@ -299,7 +286,6 @@ inline static struct pic_t *get_pic_by_index(int index) return &the_fims->pics[index]; } - static struct pic_t *get_pic_from_driver(struct fim_driver *driver) { if (!driver) @@ -308,7 +294,6 @@ static struct pic_t *get_pic_from_driver(struct fim_driver *driver) return get_pic_by_index(driver->picnr); } - static int pic_get_ctrl_reg(struct pic_t *pic, int reg, unsigned int *val) { if (NS92XX_FIM_CTRL_REG_CHECK(reg)) @@ -318,7 +303,6 @@ static int pic_get_ctrl_reg(struct pic_t *pic, int reg, unsigned int *val) return 0; } - static void pic_set_ctrl_reg(struct pic_t *pic, int reg, unsigned int val) { if (NS92XX_FIM_CTRL_REG_CHECK(reg)) @@ -327,7 +311,6 @@ static void pic_set_ctrl_reg(struct pic_t *pic, int reg, unsigned int val) writel(val, pic->reg_addr + NS92XX_FIM_CTRL_REG(reg)); } - static int pic_is_running(struct pic_t *pic) { unsigned int regval; @@ -349,13 +332,11 @@ int fim_is_running(struct fim_driver *driver) return pic_is_running(pic); } - static void fim_pic_release(struct device *dev) { /* @TODO: Nothing to do here? */ } - /* * Returns the number of available bytes that can be theoretically requested * for a TX-transfer with more than one buffer descriptor @@ -381,8 +362,6 @@ int fim_tx_buffers_room(struct fim_driver *driver) return retval; } - - int fim_tx_buffers_level(struct fim_driver *driver) { int retval, cnt; @@ -402,14 +381,11 @@ int fim_tx_buffers_level(struct fim_driver *driver) return retval; } - int fim_number_pics(void) { return FIM_NR_PICS; } - - /* * Allocate a new FIM-buffer * @TODO: Bind this buffer to an internal list of the driver, so that we can free @@ -446,7 +422,6 @@ void fim_free_buffer(struct fim_driver *driver, struct fim_buffer_t *buffer) kfree(buffer); } - /* * Be sure that you protect this function correctly. * Use the spinlock tx_lock for this purpose. @@ -467,7 +442,6 @@ inline static void pic_reset_tx_fifo(struct pic_t *pic) } } - /* * Check if there are enough buffers for the requested memory size * In success then will try to restart the DMA-channel @@ -560,7 +534,6 @@ int fim_send_buffer(struct fim_driver *driver, const struct fim_buffer_t *bufdes return retval; } - /* @TODO: Please test this function before using it */ void fim_flush_rx(struct fim_driver *driver) { @@ -589,7 +562,6 @@ void fim_flush_rx(struct fim_driver *driver) fim_dma_reset_fifo(fifo); } - /* * Drain the TX-buffers by first aborting the DMA-channel. The DMA-descriptors * will be reseted inside the interrupt routine @@ -606,8 +578,6 @@ void fim_flush_tx(struct fim_driver *driver) writel(IOHUB_RX_DMA_CTRL_CA, pic->iohub_addr + IOHUB_TX_DMA_CTRL_REG); } - - /* * This function is responsible for restarting the DMA-channel with the correct index * If the DMA-channel is transferring data it will returns inmediately, but the @@ -698,9 +668,6 @@ static int fim_start_tx_dma(struct pic_t *pic) return retval; } - - - /* DONT poll with this function. We need another function for this purpose. */ int fim_get_exp_reg(struct fim_driver *driver, int nr, unsigned int *value) { @@ -717,8 +684,6 @@ int fim_get_exp_reg(struct fim_driver *driver, int nr, unsigned int *value) return 0; } - - /* Called when the PIC interrupts the ARM-processor */ static void isr_from_pic(struct pic_t *pic, int irqnr) { @@ -756,8 +721,6 @@ static void isr_from_pic(struct pic_t *pic, int irqnr) NS92XX_FIM_GEN_CTRL_REG); } - - static void isr_dma_tx(struct pic_t *pic, int irqnr) { struct iohub_dma_fifo_t *fifo; @@ -809,7 +772,6 @@ static void isr_dma_tx(struct pic_t *pic, int irqnr) return; } - /* * If no NC interrupt pending then return immediately. * @FIXME: Is possible that a driver is waiting for the TXNCIP on this case? @@ -842,7 +804,6 @@ static void isr_dma_tx(struct pic_t *pic, int irqnr) desc = fim_dma_get_next(fifo, desc); } while (desc != fim_dma_get_next(fifo, fifo->dma_last)); - /* Now give the control to the driver's callback function */ if (driver->dma_tx_isr) driver->dma_tx_isr(driver, pic->irq, &buffer); @@ -854,11 +815,8 @@ static void isr_dma_tx(struct pic_t *pic, int irqnr) /* Check if another descriptors are waiting in the FIFO */ if (fifo->dma_next != fifo->dma_last) fim_start_tx_dma(pic); - } - - /* Only check that no errors ocurred by the last buffer descriptor */ static void isr_dma_rx(struct pic_t *pic, int irqnr) { @@ -919,7 +877,6 @@ static void isr_dma_rx(struct pic_t *pic, int irqnr) tasklet_hi_schedule(&pic->rx_tasklet); } - /* This is the main ISR for the PIC-interrupts */ static irqreturn_t pic_irq(int irq, void *tpic) { @@ -942,8 +899,6 @@ static irqreturn_t pic_irq(int irq, void *tpic) return IRQ_HANDLED; } - - int fim_enable_irq(struct fim_driver *driver) { struct pic_t *pic; @@ -963,7 +918,6 @@ int fim_enable_irq(struct fim_driver *driver) return 0; } - int fim_disable_irq(struct fim_driver *driver) { struct pic_t *pic; @@ -1056,7 +1010,6 @@ int fim_download_firmware(struct fim_driver *driver) return retval; } - int fim_register_driver(struct fim_driver *driver) { struct pic_t *pic; @@ -1172,7 +1125,6 @@ int fim_register_driver(struct fim_driver *driver) return retval; } - int fim_unregister_driver(struct fim_driver *driver) { int ret; @@ -1210,7 +1162,6 @@ int fim_unregister_driver(struct fim_driver *driver) return 0; } - /* * Return a PIC-pointer for low level operations * The driver structure contains the number of the pointer @@ -1231,7 +1182,6 @@ struct pic_t *fim_request_pic(int picnr) return pic; } - /* * Free the PIC that was requested with the above function fim_request_pic() */ @@ -1246,7 +1196,6 @@ void fim_free_pic(struct pic_t *pic) PIC_FREE_REQUEST(pic); } - /* * This function can be used for downloading a firmware to the PIC. * Please note that this function will reset the complete IOHUB-module, included the @@ -1338,8 +1287,6 @@ static int pic_download_firmware(struct pic_t *pic, const unsigned char *buffer) return 0; } - - static int pic_start_at_zero(struct pic_t *pic) { unsigned int regval; @@ -1364,7 +1311,6 @@ static int pic_start_at_zero(struct pic_t *pic) return 0; } - static int pic_stop_and_reset(struct pic_t *pic) { unsigned int regval; @@ -1467,7 +1413,6 @@ int fim_send_reset(struct fim_driver *driver) return retval; } - int fim_send_start(struct fim_driver *driver) { ulong reg; @@ -1527,7 +1472,6 @@ int fim_send_interrupt2(struct fim_driver *driver, unsigned int code) return pic_send_interrupt(pic, code); } - /* * This function provides the access to the control registers of the PICs * reg : Number of the control register (from 0 to 15) @@ -1543,7 +1487,6 @@ void fim_set_ctrl_reg(struct fim_driver *driver, int reg, unsigned int val) writel(val, pic->reg_addr + NS92XX_FIM_CTRL_REG(reg)); } - /* Provides the read access to the control registers of the PICs */ int fim_get_ctrl_reg(struct fim_driver *driver, int reg, unsigned int *val) { @@ -1559,8 +1502,6 @@ int fim_get_ctrl_reg(struct fim_driver *driver, int reg, unsigned int *val) return 0; } - - int fim_get_stat_reg(struct fim_driver *driver, int reg, unsigned int *val) { struct pic_t *pic; @@ -1575,8 +1516,6 @@ int fim_get_stat_reg(struct fim_driver *driver, int reg, unsigned int *val) return 0; } - - /* Interrupt the PIC sending the interrput with the number `code' */ static int pic_send_interrupt(struct pic_t *pic, u32 code) { @@ -1626,7 +1565,6 @@ static int pic_send_interrupt(struct pic_t *pic, u32 code) return 0; } - /* Set the HWA PIC clock (see PIC module specification, page 19) */ static int pic_config_output_clock_divisor(struct pic_t *pic, struct fim_program_t *program) @@ -1680,7 +1618,6 @@ static int pic_config_output_clock_divisor(struct pic_t *pic, return 0; } - static int fim_probe(struct device *dev) { int i, cnt, retval; @@ -1749,11 +1686,9 @@ static int fim_probe(struct device *dev) if (pic->iohub_addr) iounmap(pic->iohub_addr); pic->reg_addr = pic->instr_addr = pic->hwa_addr = pic->iohub_addr = NULL; - return retval; } - /* This function will be called for each PIC-device (but not for the parent device) */ static int fim_remove(struct device *dev) { @@ -1786,7 +1721,6 @@ static int fim_remove(struct device *dev) return 0; } - /* This function returns a non-zero value if the device correspond to our fim-bus */ static int fim_bus_match(struct device *dev, struct device_driver *driver) { @@ -1794,13 +1728,11 @@ static int fim_bus_match(struct device *dev, struct device_driver *driver) return 1; } - struct bus_type fim_bus_type = { .name = FIM_BUS_TYPE_NAME, .match = fim_bus_match, }; - /* * Bus parent that will be registered without calling the probe function * the sys file is under: /sys/devices/fims/ @@ -1809,7 +1741,6 @@ struct device fim_bus_dev = { .release = fim_pic_release }; - static struct device_driver fims_driver = { .probe = fim_probe, .remove = fim_remove, @@ -1818,8 +1749,6 @@ static struct device_driver fims_driver = { .bus = &fim_bus_type, }; - - /* * These are the two PIC devices that we currently have in the NS9215 * With the help of the `bus type' the probe function will be called when @@ -1839,7 +1768,6 @@ static struct device fim_pics[] = { } }; - /* * If no configuration for the DMA-buffer descriptors is passed (cfg = NULL), * then use the default values. These are defined under the header file 'fim.h' @@ -1869,7 +1797,6 @@ inline static int pic_dma_check_config(struct pic_t *pic, struct fim_dma_cfg_t * return 0; } - /* * This function starts the DMA-buffers and -fifos for the passed PIC * rxs : Number of RX-buffer descriptors to use @@ -2012,7 +1939,6 @@ static int pic_dma_init(struct pic_t *pic, struct fim_dma_cfg_t *cfg) return retval; } - static void pic_dma_stop(struct pic_t *pic) { int cnt; @@ -2171,7 +2097,6 @@ static int __devinit fim_init_module(void) return ret; } - static void __devexit fim_exit_module(void) { int i; @@ -2189,11 +2114,9 @@ static void __devexit fim_exit_module(void) the_fims = NULL; } - module_init(fim_init_module); module_exit(fim_exit_module); - EXPORT_SYMBOL(fim_register_driver); EXPORT_SYMBOL(fim_unregister_driver); EXPORT_SYMBOL(fim_get_exp_reg); |