core: ZIO is now based on the bus abstraction
This patch introduces zio_driver and zio_device_id structure, which are used to define a zio's driver. ZIO uses these structures to handle the match between devices and drivers connected on the zio bus. To make ZIO work on the Linux bus mechanism, ZIO creates two zio_device structures. The first zio_device is allocated and it is registered by the module which wants to declare the existence of a new ZIO device. This first zio_device is only used by ZIO to match the device with a driver. When the first zio device matchs with a driver, ZIO creates a new zio device child of the first one. The new device is filled with all the device information and sysfs attributes. This second zio device represents the real device to use; ZIO passes this zio device as argument to the driver probe function, so the driver can use the real zio device for its operations. From the user space point of view, both ZIO devices are available at /sys/bus/zio/devices/; the first zio device has the prefix "hwdev-", the second zio device (the real one) has the prefix "zio-" Signed-off-by:Federico Vaga <federico.vaga@gmail.com> Acked-by:
Alessandro Rubini <rubini@gnudd.com>
Showing
- drivers/zio-ad788x.c 95 additions, 64 deletionsdrivers/zio-ad788x.c
- drivers/zio-gpio.c 36 additions, 6 deletionsdrivers/zio-gpio.c
- drivers/zio-zero.c 41 additions, 5 deletionsdrivers/zio-zero.c
- include/linux/zio.h 28 additions, 6 deletionsinclude/linux/zio.h
- zio-cdev.c 2 additions, 2 deletionszio-cdev.c
- zio-sys.c 481 additions, 340 deletionszio-sys.c
This diff is collapsed.
Please register or sign in to comment