mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 18:23:53 +08:00
staging: gasket: core: delete device add and remove callbacks
Gasket device drivers are now in charge of orchestrating the device add and removal sequences, so the callbacks from the framework to the device drivers for these events are no longer needed. Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
38da89d5cc
commit
4420ea9366
@ -1468,12 +1468,6 @@ int gasket_pci_add_device(struct pci_dev *pci_dev,
|
||||
if (ret)
|
||||
goto fail2;
|
||||
|
||||
ret = check_and_invoke_callback(gasket_dev, driver_desc->add_dev_cb);
|
||||
if (ret) {
|
||||
dev_err(gasket_dev->dev, "Error in add device cb: %d\n", ret);
|
||||
goto fail2;
|
||||
}
|
||||
|
||||
ret = gasket_sysfs_create_mapping(gasket_dev->dev_info.device,
|
||||
gasket_dev);
|
||||
if (ret)
|
||||
@ -1512,7 +1506,6 @@ fail3:
|
||||
gasket_sysfs_remove_mapping(gasket_dev->dev_info.device);
|
||||
fail2:
|
||||
gasket_cleanup_pci(gasket_dev);
|
||||
check_and_invoke_callback(gasket_dev, driver_desc->remove_dev_cb);
|
||||
device_destroy(internal_desc->class, gasket_dev->dev_info.devt);
|
||||
fail1:
|
||||
gasket_free_dev(gasket_dev);
|
||||
@ -1559,9 +1552,6 @@ void gasket_pci_remove_device(struct pci_dev *pci_dev)
|
||||
|
||||
check_and_invoke_callback(gasket_dev, driver_desc->sysfs_cleanup_cb);
|
||||
gasket_sysfs_remove_mapping(gasket_dev->dev_info.device);
|
||||
|
||||
check_and_invoke_callback(gasket_dev, driver_desc->remove_dev_cb);
|
||||
|
||||
device_destroy(internal_desc->class, gasket_dev->dev_info.devt);
|
||||
gasket_free_dev(gasket_dev);
|
||||
}
|
||||
|
@ -302,12 +302,6 @@ struct gasket_dev {
|
||||
/* Hardware revision value for this device. */
|
||||
int hardware_revision;
|
||||
|
||||
/*
|
||||
* Device-specific data; allocated in gasket_driver_desc.add_dev_cb()
|
||||
* and freed in gasket_driver_desc.remove_dev_cb().
|
||||
*/
|
||||
void *cb_data;
|
||||
|
||||
/* Protects access to per-device data (i.e. this structure). */
|
||||
struct mutex mutex;
|
||||
|
||||
@ -415,29 +409,6 @@ struct gasket_driver_desc {
|
||||
int interrupt_pack_width;
|
||||
|
||||
/* Driver callback functions - all may be NULL */
|
||||
/*
|
||||
* add_dev_cb: Callback when a device is found.
|
||||
* @dev: The gasket_dev struct for this driver instance.
|
||||
*
|
||||
* This callback should initialize the device-specific cb_data.
|
||||
* Called when a device is found by the driver,
|
||||
* before any BAR ranges have been mapped. If this call fails (returns
|
||||
* nonzero), remove_dev_cb will be called.
|
||||
*
|
||||
*/
|
||||
int (*add_dev_cb)(struct gasket_dev *dev);
|
||||
|
||||
/*
|
||||
* remove_dev_cb: Callback for when a device is removed from the system.
|
||||
* @dev: The gasket_dev struct for this driver instance.
|
||||
*
|
||||
* This callback should free data allocated in add_dev_cb.
|
||||
* Called immediately before a device is unregistered by the driver.
|
||||
* All framework-managed resources will have been cleaned up by the time
|
||||
* this callback is invoked (PCI BARs, character devices, ...).
|
||||
*/
|
||||
int (*remove_dev_cb)(struct gasket_dev *dev);
|
||||
|
||||
/*
|
||||
* device_open_cb: Callback for when a device node is opened in write
|
||||
* mode.
|
||||
|
Loading…
Reference in New Issue
Block a user