diff --git a/bus.c b/bus.c index 01941b12c1e0fc9dd2d77313643330be76fd06d1..0fca09460e00dcb7237ed69b5666f18ab0c8170d 100644 --- a/bus.c +++ b/bus.c @@ -163,6 +163,7 @@ static int zio_drv_probe(struct device *dev) if (zdrv->probe) return zdrv->probe(zdev); pr_debug("%s:%d\n", __func__, __LINE__); + return 0; } diff --git a/doc/zio-manual.in b/doc/zio-manual.in index dc2d75b1b0d73ae42680921a3f03e4f7e7133c8e..1768a9edc22f6e5ed36eea5df06408b1ba5e9fa4 100644 --- a/doc/zio-manual.in +++ b/doc/zio-manual.in @@ -128,7 +128,7 @@ The ZIO code base is designed around three main items: See @ref{The Trigger}. @cindex buffer -@item Buffer +@item Buffer A buffer stores blocks, either input blocks generated by a trigger or output blocks generated by some injecting code. One end of the buffer is always connected to a @@ -306,7 +306,7 @@ ZIO framework at some time in the future. Some of them are already in @i{beta} stage, available from @i{git} branches in our @t{ohwr} repository. @itemize @bullet - + @cindex input subsystem and ZIO @item Supporting an @code{input_device} buffer type @@ -766,7 +766,7 @@ storage of blocks. This is the actual definition: void *data; size_t datalen; size_t uoff; - }; + }; @end example The meaning of the fields is as follows: @@ -775,7 +775,7 @@ The meaning of the fields is as follows: @item ctrl_flags The field includes a pointer to the control structure and one flag - bit, described below. + bit, described below. @item data @@ -865,7 +865,7 @@ the Linux kernel. @cindex meta-information The control is designed to offer the full meta-information needed to describe a block. In includes the unique global identification -of the channel, as well as the name and parameters for the +of the channel, as well as the name and parameters for the current trigger. Applications can thus pass around a block without knowing what it is; knowledge about device and trigger details can be concentrated in a single place, without the @@ -959,7 +959,7 @@ the fields are not yet being filled by the core. pipeline, and are persistent until cleared by means of a @i{sysfs} attribute. ZIO alarms are defined by the core, and we currently support ``lost block'' and ``lost - trigger''. + trigger''. @cindex sequence numbers in control structures @item seq_num @@ -1171,7 +1171,7 @@ The fields have the following meaning: The @code{dev_id} field is used differently by different drivers: software-only drivers like @t{zio-zero} and @t{zio-mini} just count starting from zero, while PCI cards use the @i{bus} and @i{defvn} - identifiers as geographical numbering. + identifiers as geographical numbering. For input, all fields are set by ZIO; for output they are ignored if data reaches ZIO through char devices. The network interface @@ -1359,7 +1359,7 @@ extensions using the suggested ZIO protocol. Such protocol already works with the unextended control. @c and actually it is already used @c by the example programs in the @i{tools} subdirectory. -Clearly, +Clearly, generic code that ignores metadata and only manages data, is not affected. For the input direction, generic code that reads a ZIO control device @@ -1502,7 +1502,7 @@ food items. The envelope describes the specific content (including the timestamp, name, item size and item count of each package), and you can choose to read the envelope or not; similarly, you can choose to eat the food or not, and sometimes you make the choice only after reading the -envelope. +envelope. @tindex mem_offset @cindex mmap for data access @@ -1519,7 +1519,7 @@ This is represented in @ref{fig:mmap}. @sp 1 @cindex vmalloc buffer type -An attribute of the @i{vmalloc} buffer, called @t{merge-data} +An attribute of the @i{vmalloc} buffer, called @t{merge-data} can turn it into a real circular buffer: a buffer instance, if so configured, can merge (stick together) @@ -1702,34 +1702,34 @@ preferred name for pointers to that data structure, used in the code. @headitem Struct name or C type @tab Name @tab Var name @tab Description @item zio_device -@tab full device -@tab zdev +@tab full device +@tab zdev @tab The overall I/O device, either a board or a chip. @item zio_cset @tab cset @tab cset -@tab Part of a device; a group of channels with the same physical features. +@tab Part of a device; a group of channels with the same physical features. @item zio_channel @tab channel @tab chan -@tab Part of a cset; it is the single data stream endpoint, input or output. +@tab Part of a cset; it is the single data stream endpoint, input or output. @item zio_device_operations @tab device operations @tab d_op -@tab Device-specific methods that act on attributes and data blocks. +@tab Device-specific methods that act on attributes and data blocks. @item zio_buffer_type @tab buffer type @tab zbuf -@tab Description of a buffer. +@tab Description of a buffer. @item zio_bi @tab buffer instance @tab bi -@tab Instance of a buffer type associated to a specific channel. +@tab Instance of a buffer type associated to a specific channel. @item zio_buffer_operations @tab buffer operations @@ -1965,17 +1965,6 @@ or used by the developer are: A private pointer for the device, in case it needs it. -@cindex cset, init and exit functions -@cindex init function for the cset -@cindex exit function for the cset -@item int (*init)(struct zio_cset *cset) -@itemx void (*exit)(struct zio_cset *cset) - - The function pointers, if not NULL, are called by ZIO at - cset registration and removal time, after allocating and before - removing, resp., the channel array. They may useful to channel - sets that need to setup and release the @code{priv_d} field. - @end table @c -------------------------------------------------------------------------- @@ -1999,9 +1988,7 @@ are: @cindex private pointers in the channel @item void *priv_d - A private pointer for the device (may be allocated by the - @code{init} function of the cset and released by the corresponding - @code{exit} function). + A private pointer for the device. @item void *priv_t @@ -2032,7 +2019,7 @@ struct zio_driver { The client module, thus, must specify a table of device types it is able to drive. When a match is found, the ZIO core calls the method @i{probe}, which can return success (zero) or failure (a negative error -code). Similarly, the core calls @i{remove} when the device disappears +code). Similarly, the core calls @i{remove} when the device disappears or the driver is unloaded. Both methods are optional (if missing, success is assumed). @@ -2325,7 +2312,7 @@ The detailed meaning of the operations is as follows: Abort, if defined, is called when an already-armed trigger event must be aborted. This happens, for example, because event parameters changed (e.g., the block size). The method must - call @t{cset->stop_io} if not NULL and + call @t{cset->stop_io} if not NULL and dispose the @i{active_block} for each channel, setting the pointer to NULL. Please check how it is used in @t{helpers.c}. The method @@ -2532,7 +2519,7 @@ This release of ZIO includes the following trigger types: slack to be used in programming the kernel resource. @cindex irq trigger -@cindex gpio as a trigger source +@cindex gpio as a trigger source @item irq External-interrupt. The module receives a @t{irq=} parameter, @@ -2543,7 +2530,7 @@ This release of ZIO includes the following trigger types: for demonstration purposes. @end table - + @c ========================================================================== @node Available Buffers diff --git a/include/linux/zio.h b/include/linux/zio.h index 7811e80c8b4187b3a27aa75433d396af7376cbb8..57b5a2c937ad659aeba6899d379fbfd68f80ffc7 100644 --- a/include/linux/zio.h +++ b/include/linux/zio.h @@ -188,9 +188,6 @@ struct zio_cset { struct zio_channel *chan; unsigned int n_chan; - int (*init)(struct zio_cset *cset); - void (*exit)(struct zio_cset *cset); - void *priv_d; /* private for the device */ struct list_head list_cset; /* for cset global list */ diff --git a/objects.c b/objects.c index 60ba990c5faef8a93391bcc416332d5d19bd844d..dca90329467309a0081244347864d7cf828dae9c 100644 --- a/objects.c +++ b/objects.c @@ -768,12 +768,7 @@ static int cset_register(struct zio_cset *cset, struct zio_cset *cset_t) if (err) goto out_reg; } - /* Private initialization function */ - if (cset->init) { - err = cset->init(cset); - if (err) - goto out_reg; - } + spin_lock(&zstat->lock); list_add(&cset->list_cset, &zstat->list_cset); spin_unlock(&zstat->lock); @@ -825,9 +820,6 @@ static void cset_unregister(struct zio_cset *cset) spin_unlock(&zstat->lock); /* Make it idle */ zio_trigger_abort_disable(cset, 1); - /* Private exit function */ - if (cset->exit) - cset->exit(cset); /* Unregister all child channels */ for (i = 0; i < cset->n_chan; i++) chan_unregister(&cset->chan[i]);