linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS
@ 2023-04-19  8:48 Dhruva Gole
  2023-04-19 11:15 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Dhruva Gole @ 2023-04-19  8:48 UTC (permalink / raw)
  To: Mark Brown
  Cc: Dhruva Gole, Vaishnav Achath, Vignesh, Apurva Nandan,
	linux-arm-kernel, linux-spi, linux-kernel

Using this macro makes the code more readable.
It also inits the members of dev_pm_ops in the following manner
without us explicitly needing to:

.suspend = cqspi_suspend, \
.resume = cqspi_resume, \
.freeze = cqspi_suspend, \
.thaw = cqspi_resume, \
.poweroff = cqspi_suspend, \
.restore = cqspi_resume

Signed-off-by: Dhruva Gole <d-gole@ti.com>
---

Address comments from previously posted patch:
https://patchwork.kernel.org/project/spi-devel-general/patch/20230417091027.966146-2-d-gole@ti.com/

 drivers/spi/spi-cadence-quadspi.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 79ab7e309644..922026bb9380 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1829,12 +1829,7 @@ static int cqspi_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops cqspi__dev_pm_ops = {
-	.suspend = cqspi_suspend,
-	.resume = cqspi_resume,
-};
-
-#define CQSPI_DEV_PM_OPS	(&cqspi__dev_pm_ops)
+static DEFINE_SIMPLE_DEV_PM_OPS(cqspi_dev_pm_ops, cqspi_suspend, cqspi_resume);
 #else
 #define CQSPI_DEV_PM_OPS	NULL
 #endif
@@ -1912,7 +1907,7 @@ static struct platform_driver cqspi_platform_driver = {
 	.remove_new = cqspi_remove,
 	.driver = {
 		.name = CQSPI_NAME,
-		.pm = CQSPI_DEV_PM_OPS,
+		.pm = &cqspi_dev_pm_ops,
 		.of_match_table = cqspi_dt_ids,
 	},
 };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS
  2023-04-19  8:48 [PATCH V2] spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS Dhruva Gole
@ 2023-04-19 11:15 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-04-19 11:15 UTC (permalink / raw)
  To: Dhruva Gole, Mark Brown
  Cc: oe-kbuild-all, Dhruva Gole, Vaishnav Achath, Vignesh,
	Apurva Nandan, linux-arm-kernel, linux-spi, linux-kernel

Hi Dhruva,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20230418]
[also build test ERROR on linus/master v6.3-rc7]
[cannot apply to broonie-spi/for-next v6.3-rc7 v6.3-rc6 v6.3-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Dhruva-Gole/spi-cadence-quadspi-use-macro-DEFINE_SIMPLE_DEV_PM_OPS/20230419-165052
patch link:    https://lore.kernel.org/r/20230419084817.481136-1-d-gole%40ti.com
patch subject: [PATCH V2] spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230419/202304191900.2fARFQW9-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/83ce1615dd395c8034756cc6aa97b38c16c0b07d
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Dhruva-Gole/spi-cadence-quadspi-use-macro-DEFINE_SIMPLE_DEV_PM_OPS/20230419-165052
        git checkout 83ce1615dd395c8034756cc6aa97b38c16c0b07d
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304191900.2fARFQW9-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/spi/spi-cadence-quadspi.c:1918:24: error: 'cqspi_dev_pm_ops' undeclared here (not in a function); did you mean 'cqspi_mem_ops'?
    1918 |                 .pm = &cqspi_dev_pm_ops,
         |                        ^~~~~~~~~~~~~~~~
         |                        cqspi_mem_ops


vim +1918 drivers/spi/spi-cadence-quadspi.c

  1912	
  1913	static struct platform_driver cqspi_platform_driver = {
  1914		.probe = cqspi_probe,
  1915		.remove_new = cqspi_remove,
  1916		.driver = {
  1917			.name = CQSPI_NAME,
> 1918			.pm = &cqspi_dev_pm_ops,
  1919			.of_match_table = cqspi_dt_ids,
  1920		},
  1921	};
  1922	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-19 11:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19  8:48 [PATCH V2] spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS Dhruva Gole
2023-04-19 11:15 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).