From: Todd Poynor <toddpoynor@gmail.com>
To: Rob Springer <rspringer@google.com>,
John Joseph <jnjoseph@google.com>,
Ben Chan <benchan@chromium.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Todd Poynor <toddpoynor@google.com>
Subject: [PATCH 09/15] staging: gasket: core: delete device add and remove callbacks
Date: Sun, 5 Aug 2018 13:07:43 -0700 [thread overview]
Message-ID: <20180805200749.116693-10-toddpoynor@gmail.com> (raw)
In-Reply-To: <20180805200749.116693-1-toddpoynor@gmail.com>
From: Todd Poynor <toddpoynor@google.com>
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>
---
drivers/staging/gasket/gasket_core.c | 10 ----------
drivers/staging/gasket/gasket_core.h | 29 ----------------------------
2 files changed, 39 deletions(-)
diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index fad4883e6332c..0d76e18fcde5b 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -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 @@ int gasket_pci_add_device(struct pci_dev *pci_dev,
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);
}
diff --git a/drivers/staging/gasket/gasket_core.h b/drivers/staging/gasket/gasket_core.h
index 9c143ebeba452..0ef0a2640f0fe 100644
--- a/drivers/staging/gasket/gasket_core.h
+++ b/drivers/staging/gasket/gasket_core.h
@@ -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.
--
2.18.0.597.ga71716f1ad-goog
next prev parent reply other threads:[~2018-08-05 20:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-05 20:07 [PATCH 00/15] staging: gasket: unwrap pci core and more Todd Poynor
2018-08-05 20:07 ` [PATCH 01/15] staging: gasket: sysfs: clean up state if ENOMEM removing mapping Todd Poynor
2018-08-05 20:07 ` [PATCH 02/15] staging: gasket: core: move core PCI calls to device drivers Todd Poynor
2018-08-05 20:07 ` [PATCH 03/15] staging: gasket: apex: move PCI core calls to apex driver Todd Poynor
2018-08-05 20:07 ` [PATCH 04/15] staging: gasket: core: convert remaining info logs to debug Todd Poynor
2018-08-08 9:17 ` Greg Kroah-Hartman
2018-08-05 20:07 ` [PATCH 05/15] staging: gasket: core: remove device enable and disable callbacks Todd Poynor
2018-08-05 20:07 ` [PATCH 06/15] staging: gasket: apex: " Todd Poynor
2018-08-05 20:07 ` [PATCH 07/15] staging: gasket: core: let device driver enable/disable gasket device Todd Poynor
2018-08-05 20:07 ` [PATCH 08/15] staging: gasket: apex: enable/disable gasket device from apex Todd Poynor
2018-08-05 20:07 ` Todd Poynor [this message]
2018-08-05 20:07 ` [PATCH 10/15] staging: gasket: apex: fold device add/remove logic inline Todd Poynor
2018-08-05 20:07 ` [PATCH 11/15] staging: gasket: core: remove sysfs setup and cleanup callbacks Todd Poynor
2018-08-05 20:07 ` [PATCH 12/15] staging: gasket: apex: move sysfs setup code to probe function Todd Poynor
2018-08-05 20:07 ` [PATCH 13/15] staging: gasket: core: protect against races during unregister Todd Poynor
2018-08-05 20:07 ` [PATCH 14/15] staging: gasket: apex: place in low power reset until opened Todd Poynor
2018-08-05 20:07 ` [PATCH 15/15] staging: gasket: core: remove incorrect extraneous comment Todd Poynor
2018-08-08 9:20 ` [PATCH 00/15] staging: gasket: unwrap pci core and more Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180805200749.116693-10-toddpoynor@gmail.com \
--to=toddpoynor@gmail.com \
--cc=benchan@chromium.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jnjoseph@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rspringer@google.com \
--cc=toddpoynor@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome