LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: x86@kernel.org, Aubrey Li <aubrey.li@linux.intel.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
"Kumar P, Mahesh" <mahesh.kumar.p@intel.com>,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v2 1/4] x86: pmc_atom: save struct device pointer in pmc
Date: Tue, 20 Jan 2015 23:50:00 +0200 [thread overview]
Message-ID: <1421790603-30097-2-git-send-email-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <1421790603-30097-1-git-send-email-andriy.shevchenko@linux.intel.com>
The change allows to use dev_printk() type of macros in the module functions.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/x86/kernel/pmc_atom.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/pmc_atom.c b/arch/x86/kernel/pmc_atom.c
index d66a4fe..d338222 100644
--- a/arch/x86/kernel/pmc_atom.c
+++ b/arch/x86/kernel/pmc_atom.c
@@ -26,6 +26,7 @@
#include <asm/pmc_atom.h>
struct pmc_dev {
+ struct device *dev;
u32 base_addr;
void __iomem *regmap;
#ifdef CONFIG_DEBUG_FS
@@ -250,7 +251,7 @@ static void pmc_dbgfs_unregister(struct pmc_dev *pmc)
debugfs_remove_recursive(pmc->dbgfs_dir);
}
-static int pmc_dbgfs_register(struct pmc_dev *pmc, struct pci_dev *pdev)
+static int pmc_dbgfs_register(struct pmc_dev *pmc)
{
struct dentry *dir, *f;
@@ -263,21 +264,21 @@ static int pmc_dbgfs_register(struct pmc_dev *pmc, struct pci_dev *pdev)
f = debugfs_create_file("dev_state", S_IFREG | S_IRUGO,
dir, pmc, &pmc_dev_state_ops);
if (!f) {
- dev_err(&pdev->dev, "dev_state register failed\n");
+ dev_err(pmc->dev, "dev_state register failed\n");
goto err;
}
f = debugfs_create_file("pss_state", S_IFREG | S_IRUGO,
dir, pmc, &pmc_pss_state_ops);
if (!f) {
- dev_err(&pdev->dev, "pss_state register failed\n");
+ dev_err(pmc->dev, "pss_state register failed\n");
goto err;
}
f = debugfs_create_file("sleep_state", S_IFREG | S_IRUGO,
dir, pmc, &pmc_sleep_tmr_ops);
if (!f) {
- dev_err(&pdev->dev, "sleep_state register failed\n");
+ dev_err(pmc->dev, "sleep_state register failed\n");
goto err;
}
@@ -287,7 +288,7 @@ err:
return -ENODEV;
}
#else
-static int pmc_dbgfs_register(struct pmc_dev *pmc, struct pci_dev *pdev)
+static int pmc_dbgfs_register(struct pmc_dev *pmc)
{
return 0;
}
@@ -315,10 +316,12 @@ static int pmc_setup_dev(struct pci_dev *pdev)
return -ENOMEM;
}
+ pmc->dev = &pdev->dev;
+
/* PMC hardware registers setup */
pmc_hw_reg_setup(pmc);
- ret = pmc_dbgfs_register(pmc, pdev);
+ ret = pmc_dbgfs_register(pmc);
if (ret) {
iounmap(pmc->regmap);
}
--
2.1.4
next prev parent reply other threads:[~2015-01-20 21:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-20 21:49 [PATCH v2 0/4] x86: pmc_atom: Add Cherrytrail support Andy Shevchenko
2015-01-20 21:50 ` Andy Shevchenko [this message]
2015-01-22 3:42 ` [PATCH v2 1/4] x86: pmc_atom: save struct device pointer in pmc Li, Aubrey
2015-01-22 9:29 ` Andy Shevchenko
2015-01-20 21:50 ` [PATCH v2 2/4] x86: pmc_atom: print index of device in loop Andy Shevchenko
2015-01-22 3:45 ` Li, Aubrey
2015-01-22 9:40 ` Andy Shevchenko
2015-01-20 21:50 ` [PATCH v2 3/4] x86: pmc_atom: supply register mappings via pmc object Andy Shevchenko
2015-01-20 21:50 ` [PATCH v2 4/4] PMC driver: Add Cherrytrail PMC interface Andy Shevchenko
2015-01-22 4:02 ` Li, Aubrey
2015-01-22 9:26 ` Andy Shevchenko
2015-01-26 2:30 ` Li, Aubrey
2015-02-23 12:45 ` [PATCH v2 0/4] x86: pmc_atom: Add Cherrytrail support Andy Shevchenko
2015-03-02 6:26 ` Li, Aubrey
2015-03-03 3:37 ` Li, Aubrey
2015-03-04 10:44 ` Andy Shevchenko
2015-03-30 13:05 ` Shevchenko, Andriy
2015-03-31 10:59 ` Ingo Molnar
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=1421790603-30097-2-git-send-email-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=aubrey.li@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mahesh.kumar.p@intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=x86@kernel.org \
--subject='Re: [PATCH v2 1/4] x86: pmc_atom: save struct device pointer in pmc' \
/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
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).