All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Li, Aubrey" <aubrey.li@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	x86@kernel.org, "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
Subject: Re: [PATCH v2 1/4] x86: pmc_atom: save struct device pointer in pmc
Date: Thu, 22 Jan 2015 11:42:08 +0800	[thread overview]
Message-ID: <54C07190.3090403@linux.intel.com> (raw)
In-Reply-To: <1421790603-30097-2-git-send-email-andriy.shevchenko@linux.intel.com>

On 2015/1/21 5:50, Andy Shevchenko wrote:
> The change allows to use dev_printk() type of macros in the module functions.

The patch itself looks good to me, but not sure why do we need this
change, will we use dev_prink in the subsequent patches?

Thanks,
-Aubrey
> 
> 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);
>  	}
> 


  reply	other threads:[~2015-01-22  3:42 UTC|newest]

Thread overview: 19+ 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 ` [PATCH v2 1/4] x86: pmc_atom: save struct device pointer in pmc Andy Shevchenko
2015-01-22  3:42   ` Li, Aubrey [this message]
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-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=54C07190.3090403@linux.intel.com \
    --to=aubrey.li@linux.intel.com \
    --cc=andriy.shevchenko@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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.