mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martyn Welch <martyn@welchs.me.uk>
To: Geliang Tang <geliangtang@163.com>,
	Manohar Vanga <manohar.vanga@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 8/9] vme: vme_ca91cx42.c: use to_pci_dev()
Date: Sun, 27 Dec 2015 16:46:26 +0000	[thread overview]
Message-ID: <568015E2.6050405@welchs.me.uk> (raw)
In-Reply-To: <def5535beed3614e1dc10b46cbf7bc4f8d6714fb.1451211133.git.geliangtang@163.com>

On 27/12/15 10:46, Geliang Tang wrote:
> Use to_pci_dev() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>

Acked-by: Martyn Welch <martyn@welchs.me.uk>

> ---
>   drivers/vme/bridges/vme_ca91cx42.c | 11 +++++------
>   1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/vme/bridges/vme_ca91cx42.c b/drivers/vme/bridges/vme_ca91cx42.c
> index b79a74a..5fbeab3 100644
> --- a/drivers/vme/bridges/vme_ca91cx42.c
> +++ b/drivers/vme/bridges/vme_ca91cx42.c
> @@ -202,7 +202,7 @@ static int ca91cx42_irq_init(struct vme_bridge *ca91cx42_bridge)
>   	bridge = ca91cx42_bridge->driver_priv;
>   
>   	/* Need pdev */
> -	pdev = container_of(ca91cx42_bridge->parent, struct pci_dev, dev);
> +	pdev = to_pci_dev(ca91cx42_bridge->parent);
>   
>   	INIT_LIST_HEAD(&ca91cx42_bridge->vme_error_handlers);
>   
> @@ -293,8 +293,7 @@ static void ca91cx42_irq_set(struct vme_bridge *ca91cx42_bridge, int level,
>   	iowrite32(tmp, bridge->base + LINT_EN);
>   
>   	if ((state == 0) && (sync != 0)) {
> -		pdev = container_of(ca91cx42_bridge->parent, struct pci_dev,
> -			dev);
> +		pdev = to_pci_dev(ca91cx42_bridge->parent);
>   
>   		synchronize_irq(pdev->irq);
>   	}
> @@ -518,7 +517,7 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
>   		dev_err(ca91cx42_bridge->parent, "Dev entry NULL\n");
>   		return -EINVAL;
>   	}
> -	pdev = container_of(ca91cx42_bridge->parent, struct pci_dev, dev);
> +	pdev = to_pci_dev(ca91cx42_bridge->parent);
>   
>   	existing_size = (unsigned long long)(image->bus_resource.end -
>   		image->bus_resource.start);
> @@ -1519,7 +1518,7 @@ static void *ca91cx42_alloc_consistent(struct device *parent, size_t size,
>   	struct pci_dev *pdev;
>   
>   	/* Find pci_dev container of dev */
> -	pdev = container_of(parent, struct pci_dev, dev);
> +	pdev = to_pci_dev(parent);
>   
>   	return pci_alloc_consistent(pdev, size, dma);
>   }
> @@ -1530,7 +1529,7 @@ static void ca91cx42_free_consistent(struct device *parent, size_t size,
>   	struct pci_dev *pdev;
>   
>   	/* Find pci_dev container of dev */
> -	pdev = container_of(parent, struct pci_dev, dev);
> +	pdev = to_pci_dev(parent);
>   
>   	pci_free_consistent(pdev, size, vaddr, dma);
>   }


  reply	other threads:[~2015-12-27 16:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-27 10:45 [PATCH 1/9] atm: solos-pci: " Geliang Tang
2015-12-27 10:45 ` [PATCH 2/9] drm/gma500: " Geliang Tang
2016-01-04  6:59   ` Daniel Vetter
2015-12-27 10:45 ` [PATCH 3/9] i2c: designware: " Geliang Tang
2015-12-27 12:40   ` Andy Shevchenko
2016-01-03 18:54   ` Wolfram Sang
2015-12-27 10:46 ` [PATCH 4/9] mmc: sdhci-pci: " Geliang Tang
2015-12-28 13:29   ` Ulf Hansson
2015-12-27 10:46 ` [PATCH 5/9] ipw2x00: " Geliang Tang
2015-12-31  8:30   ` Kalle Valo
2015-12-27 10:46 ` [PATCH 6/9] ssb: " Geliang Tang
2015-12-27 10:46 ` [PATCH 7/9] serial: 8250_pci: " Geliang Tang
2015-12-27 12:39   ` Andy Shevchenko
2015-12-27 14:29     ` [PATCH 7/9 v2] " Geliang Tang
2015-12-27 10:46 ` [PATCH 8/9] vme: vme_ca91cx42.c: " Geliang Tang
2015-12-27 16:46   ` Martyn Welch [this message]
2015-12-27 10:46 ` [PATCH 9/9] devres: " Geliang Tang
2015-12-28 16:19   ` Tejun Heo
2015-12-29 20:47 ` [PATCH 1/9] atm: solos-pci: " David Miller

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=568015E2.6050405@welchs.me.uk \
    --to=martyn@welchs.me.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=geliangtang@163.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manohar.vanga@gmail.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

all inboxes | Powered by JetHome®