Staging: ipack: Make ipack_device_register() analogous to device_register().
ipack_device_register() is no longer creating the struct ipack_device
but only registering it. Instead of releasing memory directly the new
ipack_device->release callback is called.
This is preparational work for later patches.
Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/staging/ipack/ipack.h b/drivers/staging/ipack/ipack.h
index 33fdea5..e2987d5 100644
--- a/drivers/staging/ipack/ipack.h
+++ b/drivers/staging/ipack/ipack.h
@@ -71,6 +71,7 @@
struct ipack_addr_space int_space;
struct ipack_addr_space mem_space;
struct device dev;
+ void (*release) (struct ipack_device *dev);
u8 *id;
size_t id_avail;
u32 id_vendor;
@@ -179,15 +180,17 @@
void ipack_driver_unregister(struct ipack_driver *edrv);
/**
- * ipack_device_register -- register a new mezzanine device
+ * ipack_device_register -- register an IPack device with the kernel
+ * @dev: the new device to register.
*
- * @bus: ipack bus device it is plugged to.
- * @slot: slot position in the bus device.
+ * Register a new IPack device ("module" in IndustryPack jargon). The call
+ * is done by the carrier driver. The carrier should populate the fields
+ * bus and slot of @dev prior to calling this function. The rest of the
+ * fields will be allocated and populated during registration.
*
- * Register a new ipack device (mezzanine device). The call is done by
- * the carrier device driver.
+ * Return zero on success or error code on failure.
*/
-struct ipack_device *ipack_device_register(struct ipack_bus_device *bus, int slot);
+int ipack_device_register(struct ipack_device *dev);
void ipack_device_unregister(struct ipack_device *dev);
/**