• Federico Vaga's avatar
    core: ZIO is now based on the bus abstraction · b0b0d428
    Federico Vaga authored
    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: 's avatarFederico Vaga <federico.vaga@gmail.com>
    Acked-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    b0b0d428
zio-cdev.c 14.3 KB