linux-kernel.vger.kernel.org archive mirror
 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 01/10] staging: gasket: save struct device for a gasket device
Date: Thu, 26 Jul 2018 20:07:28 -0700	[thread overview]
Message-ID: <20180727030737.231268-2-toddpoynor@gmail.com> (raw)
In-Reply-To: <20180727030737.231268-1-toddpoynor@gmail.com>

From: Todd Poynor <toddpoynor@google.com>

Save the struct device pointer to a gasket device in gasket's metadata,
to facilitate use of standard logging calls and in anticipation of
non-PCI gasket devices in the future.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
---
 drivers/staging/gasket/gasket_core.c | 5 +++--
 drivers/staging/gasket/gasket_core.h | 3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 732218773c3c6..e8f3b021c20d1 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -450,6 +450,7 @@ static int gasket_alloc_dev(
 	gasket_dev->internal_desc = internal_desc;
 	gasket_dev->dev_idx = dev_idx;
 	snprintf(gasket_dev->kobj_name, GASKET_NAME_MAX, "%s", kobj_name);
+	gasket_dev->dev = parent;
 	/* gasket_bar_data is uninitialized. */
 	gasket_dev->num_page_tables = driver_desc->num_page_tables;
 	/* max_page_table_size and *page table are uninit'ed */
@@ -925,7 +926,7 @@ static int gasket_enable_dev(
 			&gasket_dev->bar_data[
 				driver_desc->page_table_bar_index],
 			&driver_desc->page_table_configs[tbl_idx],
-			&gasket_dev->pci_dev->dev, gasket_dev->pci_dev, true);
+			gasket_dev->dev, gasket_dev->pci_dev, true);
 		if (ret) {
 			gasket_log_error(
 				gasket_dev,
@@ -2028,7 +2029,7 @@ const struct gasket_driver_desc *gasket_get_driver_desc(struct gasket_dev *dev)
  */
 struct device *gasket_get_device(struct gasket_dev *dev)
 {
-	return &dev->pci_dev->dev;
+	return dev->dev;
 }
 
 /**
diff --git a/drivers/staging/gasket/gasket_core.h b/drivers/staging/gasket/gasket_core.h
index bf4ed3769efb2..8bd431ad3b58b 100644
--- a/drivers/staging/gasket/gasket_core.h
+++ b/drivers/staging/gasket/gasket_core.h
@@ -263,6 +263,9 @@ struct gasket_dev {
 	/* Pointer to the internal driver description for this device. */
 	struct gasket_internal_desc *internal_desc;
 
+	/* Device info */
+	struct device *dev;
+
 	/* PCI subsystem metadata. */
 	struct pci_dev *pci_dev;
 
-- 
2.18.0.345.g5c9ce644c3-goog


  reply	other threads:[~2018-07-27  3:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27  3:07 [PATCH 00/10] staging: gasket: logging cleanups Todd Poynor
2018-07-27  3:07 ` Todd Poynor [this message]
2018-07-27 15:08   ` [PATCH 01/10] staging: gasket: save struct device for a gasket device Greg Kroah-Hartman
2018-07-27 17:02     ` Todd Poynor
2018-07-27  3:07 ` [PATCH 02/10] staging: gasket: core: convert to standard logging Todd Poynor
2018-07-27  3:07 ` [PATCH 03/10] staging: gasket: interrupt: " Todd Poynor
2018-07-27  3:07 ` [PATCH 04/10] staging: gasket: ioctl: " Todd Poynor
2018-07-27  3:07 ` [PATCH 05/10] staging: gasket: page table: " Todd Poynor
2018-07-27  3:07 ` [PATCH 06/10] staging: gasket: sysfs: " Todd Poynor
2018-07-27 15:07   ` Greg Kroah-Hartman
2018-07-27 17:00     ` Todd Poynor
2018-07-27  3:07 ` [PATCH 07/10] staging: gasket: apex: " Todd Poynor
2018-07-27  3:07 ` [PATCH 08/10] staging: gasket: remove gasket logging header Todd Poynor
2018-07-27  3:07 ` [PATCH 09/10] staging: gasket: TODO: remove entry for convert to standard logging Todd Poynor
2018-07-27  3:07 ` [PATCH 10/10] staging: gasket: don't print device addresses as kernel pointers Todd Poynor

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=20180727030737.231268-2-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;
as well as URLs for NNTP newsgroup(s).