Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
---
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
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
---
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
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
---
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
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
---
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
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
---
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
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
---
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
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
---
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
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
---
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
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
---
drivers/watchdog/cadence_wdt.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index abf64eb..4dda902 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -421,8 +421,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev)
*/
static int __maybe_unused cdns_wdt_suspend(struct device *dev)
{
- struct platform_device *pdev = container_of(dev,
- struct platform_device, dev);
+ struct platform_device *pdev = to_platform_device(dev);
struct cdns_wdt *wdt = platform_get_drvdata(pdev);
cdns_wdt_stop(&wdt->cdns_wdt_device);
@@ -440,8 +439,7 @@ static int __maybe_unused cdns_wdt_suspend(struct device *dev)
static int __maybe_unused cdns_wdt_resume(struct device *dev)
{
int ret;
- struct platform_device *pdev = container_of(dev,
- struct platform_device, dev);
+ struct platform_device *pdev = to_platform_device(dev);
struct cdns_wdt *wdt = platform_get_drvdata(pdev);
ret = clk_prepare_enable(wdt->clk);
--
2.5.0
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
---
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
On Sun, Dec 27, 2015 at 3:15 PM, Geliang Tang <[email protected]> wrote:
> Use to_platform_device() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <[email protected]>
> ---
> 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 [email protected]
> 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
On Sun, Dec 27, 2015 at 09:15:47PM +0800, Geliang Tang wrote:
> Use to_platform_device() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
> ---
> drivers/watchdog/cadence_wdt.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index abf64eb..4dda902 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -421,8 +421,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev)
> */
> static int __maybe_unused cdns_wdt_suspend(struct device *dev)
> {
> - struct platform_device *pdev = container_of(dev,
> - struct platform_device, dev);
> + struct platform_device *pdev = to_platform_device(dev);
> struct cdns_wdt *wdt = platform_get_drvdata(pdev);
>
> cdns_wdt_stop(&wdt->cdns_wdt_device);
> @@ -440,8 +439,7 @@ static int __maybe_unused cdns_wdt_suspend(struct device *dev)
> static int __maybe_unused cdns_wdt_resume(struct device *dev)
> {
> int ret;
> - struct platform_device *pdev = container_of(dev,
> - struct platform_device, dev);
> + struct platform_device *pdev = to_platform_device(dev);
> struct cdns_wdt *wdt = platform_get_drvdata(pdev);
>
> ret = clk_prepare_enable(wdt->clk);
> --
> 2.5.0
>
>
On Sun, Dec 27, 2015 at 03:23:30PM +0200, Andy Shevchenko wrote:
> On Sun, Dec 27, 2015 at 3:15 PM, Geliang Tang <[email protected]> wrote:
> > Use to_platform_device() instead of open-coding it.
> >
> > Signed-off-by: Geliang Tang <[email protected]>
> > ---
> > 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
Hi Geliang,
> Use to_platform_device() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <[email protected]>
> ---
> drivers/watchdog/cadence_wdt.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index abf64eb..4dda902 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -421,8 +421,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev)
> */
> static int __maybe_unused cdns_wdt_suspend(struct device *dev)
> {
> - struct platform_device *pdev = container_of(dev,
> - struct platform_device, dev);
> + struct platform_device *pdev = to_platform_device(dev);
> struct cdns_wdt *wdt = platform_get_drvdata(pdev);
>
> cdns_wdt_stop(&wdt->cdns_wdt_device);
> @@ -440,8 +439,7 @@ static int __maybe_unused cdns_wdt_suspend(struct device *dev)
> static int __maybe_unused cdns_wdt_resume(struct device *dev)
> {
> int ret;
> - struct platform_device *pdev = container_of(dev,
> - struct platform_device, dev);
> + struct platform_device *pdev = to_platform_device(dev);
> struct cdns_wdt *wdt = platform_get_drvdata(pdev);
>
> ret = clk_prepare_enable(wdt->clk);
> --
> 2.5.0
>
>
Patch added to linux-watchdog-next.
Kind regards,
Wim.
On 27.12.2015 22:17, Geliang Tang wrote:
> Use to_platform_device() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <[email protected]>
> ---
> arch/arm/plat-samsung/adc.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Thanks!
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof
On 27 December 2015 at 14:15, Geliang Tang <[email protected]> wrote:
> Use to_platform_device() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <[email protected]>
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
>
>
Hi,
On Sun, Dec 27, 2015 at 5:15 AM, Geliang Tang <[email protected]> wrote:
> Use to_platform_device() instead of open-coding it.
>
Reviewed-by: Moritz Fischer <[email protected]>
> Signed-off-by: Geliang Tang <[email protected]>
Looks good to me, maybe (nit) split it up into two commits.
Cheers,
Moritz
From: Geliang Tang <[email protected]>
Date: Sun, 27 Dec 2015 21:15:44 +0800
> Use to_platform_device() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <[email protected]>
Applied.
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
Reviewed-by: Moritz Fischer <[email protected]>
---
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
Use to_platform_device() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
Reviewed-by: Moritz Fischer <[email protected]>
---
drivers/spi/spi-zynqmp-gqspi.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
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
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.
On Sun, Dec 27, 2015 at 09:15:45PM +0800, Geliang Tang wrote:
> Use to_platform_device() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <[email protected]>
Applied, thanks.
-Olof