mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 12/15] staging: gasket: apex: move sysfs setup code to probe function
Date: Sun,  5 Aug 2018 13:07:46 -0700	[thread overview]
Message-ID: <20180805200749.116693-13-toddpoynor@gmail.com> (raw)
In-Reply-To: <20180805200749.116693-1-toddpoynor@gmail.com>

From: Todd Poynor <toddpoynor@google.com>

The gasket framework no longer provides callbacks to the device driver
for sysfs setup and teardown.  Move the sysfs setup code to the device
probe function.  Apex does not implement sysfs cleanup code.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
---
 drivers/staging/gasket/apex_driver.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c
index 69ca7fb10eddc..55319619b2e66 100644
--- a/drivers/staging/gasket/apex_driver.c
+++ b/drivers/staging/gasket/apex_driver.c
@@ -568,12 +568,6 @@ static struct gasket_sysfs_attribute apex_sysfs_attrs[] = {
 	GASKET_END_OF_ATTR_ARRAY
 };
 
-static int apex_sysfs_setup_cb(struct gasket_dev *gasket_dev)
-{
-	return gasket_sysfs_create_entries(gasket_dev->dev_info.device,
-					   apex_sysfs_attrs);
-}
-
 /* On device open, perform a core reinit reset. */
 static int apex_device_open_cb(struct gasket_dev *gasket_dev)
 {
@@ -639,6 +633,11 @@ static int apex_pci_probe(struct pci_dev *pci_dev,
 		goto remove_device;
 	}
 
+	ret = gasket_sysfs_create_entries(gasket_dev->dev_info.device,
+					  apex_sysfs_attrs);
+	if (ret)
+		dev_err(&pci_dev->dev, "error creating device sysfs entries\n");
+
 	ret = gasket_enable_device(gasket_dev);
 	if (ret) {
 		dev_err(&pci_dev->dev, "error enabling gasket device\n");
@@ -695,9 +694,6 @@ static struct gasket_driver_desc apex_desc = {
 	.interrupts = apex_interrupts,
 	.interrupt_pack_width = 7,
 
-	.sysfs_setup_cb = apex_sysfs_setup_cb,
-	.sysfs_cleanup_cb = NULL,
-
 	.device_open_cb = apex_device_open_cb,
 	.device_close_cb = apex_device_cleanup,
 
-- 
2.18.0.597.ga71716f1ad-goog


  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 ` [PATCH 09/15] staging: gasket: core: delete device add and remove callbacks Todd Poynor
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 ` Todd Poynor [this message]
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-13-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