Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1298375 > unrolled thread

[PATCH 01/10] PM / devfreq: exynos: use to_platform_device()

Started byGeliang Tang <geliangtang@163.com>
First post2015-12-27 14:20 +0100
Last post2015-12-27 14:20 +0100
Articles 17 — 7 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 01/10] PM / devfreq: exynos: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
    [PATCH 02/10] spi: cadence, zynq: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
      Re: [PATCH 02/10] spi: cadence, zynq: use to_platform_device() Moritz Fischer <moritz.fischer@ettus.com> - 2015-12-29 19:10 +0100
        [PATCH 1/2] spi: cadence: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-30 16:00 +0100
          Re: [PATCH 1/2] spi: cadence: use to_platform_device() Mark Brown <broonie@kernel.org> - 2015-12-30 18:10 +0100
    [PATCH 03/10] dmaengine: ppc4xx: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
    [PATCH 08/10] staging: fbtft: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
    [PATCH 06/10] net: hns: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
      Re: [PATCH 06/10] net: hns: use to_platform_device() Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-12-27 14:30 +0100
        Re: [PATCH 06/10] net: hns: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-28 03:50 +0100
      Re: [PATCH 06/10] net: hns: use to_platform_device() David Miller <davem@davemloft.net> - 2015-12-29 21:50 +0100
    [PATCH 07/10] platform/chrome: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
    [PATCH 10/10] ARM: plat-samsung: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
      Re: [PATCH 10/10] ARM: plat-samsung: use to_platform_device() Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-28 03:50 +0100
    [PATCH 05/10] mmc: cb710: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
      Re: [PATCH 05/10] mmc: cb710: use to_platform_device() Ulf Hansson <ulf.hansson@linaro.org> - 2015-12-28 14:30 +0100
    [PATCH 04/10] i2c: st: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100

#1298375 — [PATCH 01/10] PM / devfreq: exynos: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 14:20 +0100
Subject[PATCH 01/10] PM / devfreq: exynos: use to_platform_device()
Message-ID<qKjoR-7uf-5@gated-at.bofh.it>
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/devfreq/exynos/exynos4_bus.c | 3 +--
 drivers/devfreq/exynos/exynos5_bus.c | 9 +++------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c
index da95092..e3124bf 100644
--- a/drivers/devfreq/exynos/exynos4_bus.c
+++ b/drivers/devfreq/exynos/exynos4_bus.c
@@ -566,8 +566,7 @@ static int exynos4_bus_target(struct device *dev, unsigned long *_freq,
 			      u32 flags)
 {
 	int err = 0;
-	struct platform_device *pdev = container_of(dev, struct platform_device,
-						    dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct busfreq_data *data = platform_get_drvdata(pdev);
 	struct dev_pm_opp *opp;
 	unsigned long freq;
diff --git a/drivers/devfreq/exynos/exynos5_bus.c b/drivers/devfreq/exynos/exynos5_bus.c
index 297ea30..81da78e 100644
--- a/drivers/devfreq/exynos/exynos5_bus.c
+++ b/drivers/devfreq/exynos/exynos5_bus.c
@@ -85,8 +85,7 @@ static int exynos5_busfreq_int_target(struct device *dev, unsigned long *_freq,
 			      u32 flags)
 {
 	int err = 0;
-	struct platform_device *pdev = container_of(dev, struct platform_device,
-						    dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct busfreq_data_int *data = platform_get_drvdata(pdev);
 	struct dev_pm_opp *opp;
 	unsigned long old_freq, freq;
@@ -145,8 +144,7 @@ out:
 static int exynos5_int_get_dev_status(struct device *dev,
 				      struct devfreq_dev_status *stat)
 {
-	struct platform_device *pdev = container_of(dev, struct platform_device,
-						    dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct busfreq_data_int *data = platform_get_drvdata(pdev);
 	struct busfreq_ppmu_data *ppmu_data = &data->ppmu_data;
 	int busier_dmc;
@@ -370,8 +368,7 @@ static int exynos5_busfreq_int_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int exynos5_busfreq_int_resume(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev, struct platform_device,
-						    dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct busfreq_data_int *data = platform_get_drvdata(pdev);
 	struct busfreq_ppmu_data *ppmu_data = &data->ppmu_data;
 
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1298377 — [PATCH 02/10] spi: cadence, zynq: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 14:20 +0100
Subject[PATCH 02/10] spi: cadence, zynq: use to_platform_device()
Message-ID<qKjoS-7uf-15@gated-at.bofh.it>
In reply to#1298375
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/spi/spi-cadence.c      | 6 ++----
 drivers/spi/spi-zynqmp-gqspi.c | 8 ++------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c
index 5a67498..121a413 100644
--- a/drivers/spi/spi-cadence.c
+++ b/drivers/spi/spi-cadence.c
@@ -617,8 +617,7 @@ static int cdns_spi_remove(struct platform_device *pdev)
  */
 static int __maybe_unused cdns_spi_suspend(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev,
-			struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct cdns_spi *xspi = spi_master_get_devdata(master);
 
@@ -641,8 +640,7 @@ static int __maybe_unused cdns_spi_suspend(struct device *dev)
  */
 static int __maybe_unused cdns_spi_resume(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev,
-			struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct cdns_spi *xspi = spi_master_get_devdata(master);
 	int ret = 0;
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
index f23f36e..aab9b49 100644
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -917,9 +917,7 @@ static int zynqmp_qspi_start_transfer(struct spi_master *master,
  */
 static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev,
-						    struct platform_device,
-						    dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct spi_master *master = platform_get_drvdata(pdev);
 
 	spi_master_suspend(master);
@@ -940,9 +938,7 @@ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)
  */
 static int __maybe_unused zynqmp_qspi_resume(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev,
-						    struct platform_device,
-						    dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct zynqmp_qspi *xqspi = spi_master_get_devdata(master);
 	int ret = 0;
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1299066 — Re: [PATCH 02/10] spi: cadence, zynq: use to_platform_device()

FromMoritz Fischer <moritz.fischer@ettus.com>
Date2015-12-29 19:10 +0100
SubjectRe: [PATCH 02/10] spi: cadence, zynq: use to_platform_device()
Message-ID<qL6SC-405-19@gated-at.bofh.it>
In reply to#1298377
Hi,

On Sun, Dec 27, 2015 at 5:15 AM, Geliang Tang <geliangtang@163.com> wrote:
> Use to_platform_device() instead of open-coding it.
>
Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
> Signed-off-by: Geliang Tang <geliangtang@163.com>

Looks good to me, maybe (nit) split it up into two commits.

Cheers,

Moritz
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1299386 — [PATCH 1/2] spi: cadence: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-30 16:00 +0100
Subject[PATCH 1/2] spi: cadence: use to_platform_device()
Message-ID<qLqoh-7VK-3@gated-at.bofh.it>
In reply to#1299066
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
---
 drivers/spi/spi-cadence.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c
index 5a67498..121a413 100644
--- a/drivers/spi/spi-cadence.c
+++ b/drivers/spi/spi-cadence.c
@@ -617,8 +617,7 @@ static int cdns_spi_remove(struct platform_device *pdev)
  */
 static int __maybe_unused cdns_spi_suspend(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev,
-			struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct cdns_spi *xspi = spi_master_get_devdata(master);
 
@@ -641,8 +640,7 @@ static int __maybe_unused cdns_spi_suspend(struct device *dev)
  */
 static int __maybe_unused cdns_spi_resume(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev,
-			struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct cdns_spi *xspi = spi_master_get_devdata(master);
 	int ret = 0;
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1299427 — Re: [PATCH 1/2] spi: cadence: use to_platform_device()

FromMark Brown <broonie@kernel.org>
Date2015-12-30 18:10 +0100
SubjectRe: [PATCH 1/2] spi: cadence: use to_platform_device()
Message-ID<qLsq7-YR-23@gated-at.bofh.it>
In reply to#1299386

[Multipart message — attachments visible in raw view] — view raw

On Wed, Dec 30, 2015 at 10:57:35PM +0800, Geliang Tang wrote:
> Use to_platform_device() instead of open-coding it.

Please don't send new patches in reply to the middle of other serieses,
it gets confusing working out what the currently propose series is.
Send new patches as new patches.

[toc] | [prev] | [next] | [standalone]


#1298380 — [PATCH 03/10] dmaengine: ppc4xx: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 14:20 +0100
Subject[PATCH 03/10] dmaengine: ppc4xx: use to_platform_device()
Message-ID<qKjoS-7uf-21@gated-at.bofh.it>
In reply to#1298375
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/dma/ppc4xx/adma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index 9217f89..039803a 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -3887,7 +3887,7 @@ static int ppc440spe_adma_setup_irqs(struct ppc440spe_adma_device *adev,
 	struct device_node *np;
 	int ret;
 
-	ofdev = container_of(adev->dev, struct platform_device, dev);
+	ofdev = to_platform_device(adev->dev);
 	np = ofdev->dev.of_node;
 	if (adev->id != PPC440SPE_XOR_ID) {
 		adev->err_irq = irq_of_parse_and_map(np, 1);
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298381 — [PATCH 08/10] staging: fbtft: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 14:20 +0100
Subject[PATCH 08/10] staging: fbtft: use to_platform_device()
Message-ID<qKjoS-7uf-23@gated-at.bofh.it>
In reply to#1298375
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/staging/fbtft/fbtft_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c b/drivers/staging/fbtft/fbtft_device.c
index 071f79b..50d5735 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1305,7 +1305,7 @@ static void pr_spi_devices(void)
 static int p_device_found(struct device *dev, void *data)
 {
 	struct platform_device
-	*pdev = container_of(dev, struct platform_device, dev);
+	*pdev = to_platform_device(dev);
 
 	if (strstr(pdev->name, "fb"))
 		dev_info(dev, "%s id=%d pdata? %s\n", pdev->name, pdev->id,
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298382 — [PATCH 06/10] net: hns: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 14:20 +0100
Subject[PATCH 06/10] net: hns: use to_platform_device()
Message-ID<qKjoS-7uf-25@gated-at.bofh.it>
In reply to#1298375
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
index 8c30cec..d2263c7 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
@@ -499,8 +499,7 @@ void hns_rcb_get_cfg(struct rcb_common_cb *rcb_common)
 	int base_irq_idx = hns_rcb_get_base_irq_idx(rcb_common);
 	struct device_node *np = rcb_common->dsaf_dev->dev->of_node;
 	struct platform_device *pdev =
-		container_of(rcb_common->dsaf_dev->dev,
-			     struct platform_device, dev);
+		to_platform_device(rcb_common->dsaf_dev->dev);
 	bool is_ver1 = AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver);
 
 	for (i = 0; i < ring_num; i++) {
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298388 — Re: [PATCH 06/10] net: hns: use to_platform_device()

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2015-12-27 14:30 +0100
SubjectRe: [PATCH 06/10] net: hns: use to_platform_device()
Message-ID<qKjyz-7y5-21@gated-at.bofh.it>
In reply to#1298382
On Sun, Dec 27, 2015 at 3:15 PM, Geliang Tang <geliangtang@163.com> wrote:
> Use to_platform_device() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
> index 8c30cec..d2263c7 100644
> --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
> +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
> @@ -499,8 +499,7 @@ void hns_rcb_get_cfg(struct rcb_common_cb *rcb_common)
>         int base_irq_idx = hns_rcb_get_base_irq_idx(rcb_common);
>         struct device_node *np = rcb_common->dsaf_dev->dev->of_node;
>         struct platform_device *pdev =
> -               container_of(rcb_common->dsaf_dev->dev,
> -                            struct platform_device, dev);
> +               to_platform_device(rcb_common->dsaf_dev->dev);

Can it be one line after all? Please, check this for all your patches
of such kind.

>         bool is_ver1 = AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver);
>
>         for (i = 0; i < ring_num; i++) {
> --
> 2.5.0
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298432 — Re: [PATCH 06/10] net: hns: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-28 03:50 +0100
SubjectRe: [PATCH 06/10] net: hns: use to_platform_device()
Message-ID<qKw2X-3Io-335@gated-at.bofh.it>
In reply to#1298388
On Sun, Dec 27, 2015 at 03:23:30PM +0200, Andy Shevchenko wrote:
> On Sun, Dec 27, 2015 at 3:15 PM, Geliang Tang <geliangtang@163.com> wrote:
> > Use to_platform_device() instead of open-coding it.
> >
> > Signed-off-by: Geliang Tang <geliangtang@163.com>
> > ---
> >  drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
> > index 8c30cec..d2263c7 100644
> > --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
> > +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
> > @@ -499,8 +499,7 @@ void hns_rcb_get_cfg(struct rcb_common_cb *rcb_common)
> >         int base_irq_idx = hns_rcb_get_base_irq_idx(rcb_common);
> >         struct device_node *np = rcb_common->dsaf_dev->dev->of_node;
> >         struct platform_device *pdev =
> > -               container_of(rcb_common->dsaf_dev->dev,
> > -                            struct platform_device, dev);
> > +               to_platform_device(rcb_common->dsaf_dev->dev);
> 
> Can it be one line after all? Please, check this for all your patches
> of such kind.
> 

Thanks for your review.

It's over 80 characters in one line:

 WARNING: line over 80 characters
 #22: FILE: drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c:501:
 +	struct platform_device *pdev = to_platform_device(rcb_common->dsaf_dev->dev);

 total: 0 errors, 1 warnings, 0 checks, 10 lines checked

	Geliang

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1299133 — Re: [PATCH 06/10] net: hns: use to_platform_device()

FromDavid Miller <davem@davemloft.net>
Date2015-12-29 21:50 +0100
SubjectRe: [PATCH 06/10] net: hns: use to_platform_device()
Message-ID<qL9ns-5p3-19@gated-at.bofh.it>
In reply to#1298382
From: Geliang Tang <geliangtang@163.com>
Date: Sun, 27 Dec 2015 21:15:44 +0800

> Use to_platform_device() instead of open-coding it.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298383 — [PATCH 07/10] platform/chrome: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 14:20 +0100
Subject[PATCH 07/10] platform/chrome: use to_platform_device()
Message-ID<qKjoT-7uf-35@gated-at.bofh.it>
In reply to#1298375
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/platform/chrome/cros_ec_lightbar.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_lightbar.c b/drivers/platform/chrome/cros_ec_lightbar.c
index ff76405..a79fb86 100644
--- a/drivers/platform/chrome/cros_ec_lightbar.c
+++ b/drivers/platform/chrome/cros_ec_lightbar.c
@@ -412,8 +412,7 @@ static umode_t cros_ec_lightbar_attrs_are_visible(struct kobject *kobj,
 	struct device *dev = container_of(kobj, struct device, kobj);
 	struct cros_ec_dev *ec = container_of(dev,
 					      struct cros_ec_dev, class_dev);
-	struct platform_device *pdev = container_of(ec->dev,
-						   struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(ec->dev);
 	if (pdev->id != 0)
 		return 0;
 
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298384 — [PATCH 10/10] ARM: plat-samsung: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 14:20 +0100
Subject[PATCH 10/10] ARM: plat-samsung: use to_platform_device()
Message-ID<qKjoT-7uf-37@gated-at.bofh.it>
In reply to#1298375
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 arch/arm/plat-samsung/adc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index efa6e85..daf3db9 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -422,8 +422,7 @@ static int s3c_adc_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM
 static int s3c_adc_suspend(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev,
-			struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct adc_device *adc = platform_get_drvdata(pdev);
 	unsigned long flags;
 	u32 con;
@@ -444,8 +443,7 @@ static int s3c_adc_suspend(struct device *dev)
 
 static int s3c_adc_resume(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev,
-			struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct adc_device *adc = platform_get_drvdata(pdev);
 	enum s3c_cpu_type cpu = platform_get_device_id(pdev)->driver_data;
 	int ret;
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298423 — Re: [PATCH 10/10] ARM: plat-samsung: use to_platform_device()

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2015-12-28 03:50 +0100
SubjectRe: [PATCH 10/10] ARM: plat-samsung: use to_platform_device()
Message-ID<qKw2S-3Io-249@gated-at.bofh.it>
In reply to#1298384
On 27.12.2015 22:17, Geliang Tang wrote:
> Use to_platform_device() instead of open-coding it.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  arch/arm/plat-samsung/adc.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Thanks!

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298385 — [PATCH 05/10] mmc: cb710: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 14:20 +0100
Subject[PATCH 05/10] mmc: cb710: use to_platform_device()
Message-ID<qKjoT-7uf-41@gated-at.bofh.it>
In reply to#1298375
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/mmc/host/cb710-mmc.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mmc/host/cb710-mmc.h b/drivers/mmc/host/cb710-mmc.h
index 8984ec8..8ecd9e5 100644
--- a/drivers/mmc/host/cb710-mmc.h
+++ b/drivers/mmc/host/cb710-mmc.h
@@ -29,8 +29,7 @@ static inline struct mmc_host *cb710_slot_to_mmc(struct cb710_slot *slot)
 
 static inline struct cb710_slot *cb710_mmc_to_slot(struct mmc_host *mmc)
 {
-	struct platform_device *pdev = container_of(mmc_dev(mmc),
-		struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(mmc_dev(mmc));
 	return cb710_pdev_to_slot(pdev);
 }
 
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298634 — Re: [PATCH 05/10] mmc: cb710: use to_platform_device()

FromUlf Hansson <ulf.hansson@linaro.org>
Date2015-12-28 14:30 +0100
SubjectRe: [PATCH 05/10] mmc: cb710: use to_platform_device()
Message-ID<qKG27-2xG-17@gated-at.bofh.it>
In reply to#1298385
On 27 December 2015 at 14:15, Geliang Tang <geliangtang@163.com> wrote:
> Use to_platform_device() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/cb710-mmc.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/cb710-mmc.h b/drivers/mmc/host/cb710-mmc.h
> index 8984ec8..8ecd9e5 100644
> --- a/drivers/mmc/host/cb710-mmc.h
> +++ b/drivers/mmc/host/cb710-mmc.h
> @@ -29,8 +29,7 @@ static inline struct mmc_host *cb710_slot_to_mmc(struct cb710_slot *slot)
>
>  static inline struct cb710_slot *cb710_mmc_to_slot(struct mmc_host *mmc)
>  {
> -       struct platform_device *pdev = container_of(mmc_dev(mmc),
> -               struct platform_device, dev);
> +       struct platform_device *pdev = to_platform_device(mmc_dev(mmc));
>         return cb710_pdev_to_slot(pdev);
>  }
>
> --
> 2.5.0
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298386 — [PATCH 04/10] i2c: st: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 14:20 +0100
Subject[PATCH 04/10] i2c: st: use to_platform_device()
Message-ID<qKjoT-7uf-43@gated-at.bofh.it>
In reply to#1298375
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/i2c/busses/i2c-st.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c
index 25020ec..6ee7715 100644
--- a/drivers/i2c/busses/i2c-st.c
+++ b/drivers/i2c/busses/i2c-st.c
@@ -708,8 +708,7 @@ static int st_i2c_xfer(struct i2c_adapter *i2c_adap,
 #ifdef CONFIG_PM_SLEEP
 static int st_i2c_suspend(struct device *dev)
 {
-	struct platform_device *pdev =
-		container_of(dev, struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct st_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
 
 	if (i2c_dev->busy)
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web