All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Geliang Tang <geliangtang@163.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] PCI: use to_pci_dev
Date: Fri, 8 Jan 2016 12:08:58 -0600	[thread overview]
Message-ID: <20160108180858.GC5354@localhost> (raw)
In-Reply-To: <8ab09476f7fb0283031b973808740f40522bebe1.1450873511.git.geliangtang@163.com>

On Wed, Dec 23, 2015 at 08:28:12PM +0800, Geliang Tang wrote:
> Use to_pci_dev() instead of open-coding it.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>

Both patches applied to pci/trivial for v4.5, thanks a lot, Geliang!

> ---
>  drivers/pci/hotplug/shpchp_sysfs.c | 2 +-
>  drivers/pci/pci.c                  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c
> index 52875b3..392a40b 100644
> --- a/drivers/pci/hotplug/shpchp_sysfs.c
> +++ b/drivers/pci/hotplug/shpchp_sysfs.c
> @@ -43,7 +43,7 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha
>  	struct resource *res;
>  	struct pci_bus *bus;
>  
> -	pdev = container_of (dev, struct pci_dev, dev);
> +	pdev = to_pci_dev(dev);
>  	bus = pdev->subordinate;
>  
>  	out += sprintf(buf, "Free resources: memory\n");
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index d1a7105..9356f90 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1417,7 +1417,7 @@ struct pci_devres {
>  
>  static void pcim_release(struct device *gendev, void *res)
>  {
> -	struct pci_dev *dev = container_of(gendev, struct pci_dev, dev);
> +	struct pci_dev *dev = to_pci_dev(gendev);
>  	struct pci_devres *this = res;
>  	int i;
>  
> -- 
> 2.5.0
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2016-01-08 18:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23 12:28 [PATCH 1/2] PCI: use to_pci_dev Geliang Tang
2015-12-23 12:28 ` [PATCH 2/2] PCI: label, sysfs: use kobj_to_dev Geliang Tang
2016-01-08 18:08 ` Bjorn Helgaas [this message]

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=20160108180858.GC5354@localhost \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=geliangtang@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.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.