linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 9894/11453] drivers/mfd/cs42l43.c:1138:12: warning: 'cs42l43_runtime_resume' defined but not used
@ 2023-08-21 14:59 kernel test robot
  2023-08-21 15:51 ` Charles Keepax
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-08-21 14:59 UTC (permalink / raw)
  To: Charles Keepax; +Cc: oe-kbuild-all, Linux Memory Management List, Lee Jones

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   47d9bb711707d15b19fad18c8e2b4b027a264a3a
commit: ace6d14481386ec6c1b63cc2b24c71433a583dc2 [9894/11453] mfd: cs42l43: Add support for cs42l43 core driver
config: openrisc-allyesconfig (https://download.01.org/0day-ci/archive/20230821/202308212225.fGjY1rr6-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230821/202308212225.fGjY1rr6-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308212225.fGjY1rr6-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/mfd/cs42l43.c:1138:12: warning: 'cs42l43_runtime_resume' defined but not used [-Wunused-function]
    1138 | static int cs42l43_runtime_resume(struct device *dev)
         |            ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/mfd/cs42l43.c:1124:12: warning: 'cs42l43_runtime_suspend' defined but not used [-Wunused-function]
    1124 | static int cs42l43_runtime_suspend(struct device *dev)
         |            ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mfd/cs42l43.c:1106:12: warning: 'cs42l43_resume' defined but not used [-Wunused-function]
    1106 | static int cs42l43_resume(struct device *dev)
         |            ^~~~~~~~~~~~~~
>> drivers/mfd/cs42l43.c:1076:12: warning: 'cs42l43_suspend' defined but not used [-Wunused-function]
    1076 | static int cs42l43_suspend(struct device *dev)
         |            ^~~~~~~~~~~~~~~


vim +/cs42l43_runtime_resume +1138 drivers/mfd/cs42l43.c

  1075	
> 1076	static int cs42l43_suspend(struct device *dev)
  1077	{
  1078		struct cs42l43 *cs42l43 = dev_get_drvdata(dev);
  1079		int ret;
  1080	
  1081		/*
  1082		 * Don't care about being resumed here, but the driver does want
  1083		 * force_resume to always trigger an actual resume, so that register
  1084		 * state for the MCU/GPIOs is returned as soon as possible after system
  1085		 * resume. force_resume will resume if the reference count is resumed on
  1086		 * suspend hence the get_noresume.
  1087		 */
  1088		pm_runtime_get_noresume(dev);
  1089	
  1090		ret = pm_runtime_force_suspend(dev);
  1091		if (ret) {
  1092			dev_err(cs42l43->dev, "Failed to force suspend: %d\n", ret);
  1093			pm_runtime_put_noidle(dev);
  1094			return ret;
  1095		}
  1096	
  1097		pm_runtime_put_noidle(dev);
  1098	
  1099		ret = cs42l43_power_down(cs42l43);
  1100		if (ret)
  1101			return ret;
  1102	
  1103		return 0;
  1104	}
  1105	
> 1106	static int cs42l43_resume(struct device *dev)
  1107	{
  1108		struct cs42l43 *cs42l43 = dev_get_drvdata(dev);
  1109		int ret;
  1110	
  1111		ret = cs42l43_power_up(cs42l43);
  1112		if (ret)
  1113			return ret;
  1114	
  1115		ret = pm_runtime_force_resume(dev);
  1116		if (ret) {
  1117			dev_err(cs42l43->dev, "Failed to force resume: %d\n", ret);
  1118			return ret;
  1119		}
  1120	
  1121		return 0;
  1122	}
  1123	
> 1124	static int cs42l43_runtime_suspend(struct device *dev)
  1125	{
  1126		struct cs42l43 *cs42l43 = dev_get_drvdata(dev);
  1127	
  1128		/*
  1129		 * Whilst the driver doesn't power the chip down here, going into runtime
  1130		 * suspend lets the SoundWire bus power down, which means the driver
  1131		 * can't communicate with the device any more.
  1132		 */
  1133		regcache_cache_only(cs42l43->regmap, true);
  1134	
  1135		return 0;
  1136	}
  1137	
> 1138	static int cs42l43_runtime_resume(struct device *dev)
  1139	{
  1140		struct cs42l43 *cs42l43 = dev_get_drvdata(dev);
  1141		unsigned int reset_canary;
  1142		int ret;
  1143	
  1144		ret = cs42l43_wait_for_attach(cs42l43);
  1145		if (ret)
  1146			return ret;
  1147	
  1148		ret = regmap_read(cs42l43->regmap, CS42L43_RELID, &reset_canary);
  1149		if (ret) {
  1150			dev_err(cs42l43->dev, "Failed to check reset canary: %d\n", ret);
  1151			goto err;
  1152		}
  1153	
  1154		if (!reset_canary) {
  1155			/*
  1156			 * If the canary has cleared the chip has reset, re-handle the
  1157			 * MCU and mark the cache as dirty to indicate the chip reset.
  1158			 */
  1159			ret = cs42l43_mcu_update(cs42l43);
  1160			if (ret)
  1161				goto err;
  1162	
  1163			regcache_mark_dirty(cs42l43->regmap);
  1164		}
  1165	
  1166		ret = regcache_sync(cs42l43->regmap);
  1167		if (ret) {
  1168			dev_err(cs42l43->dev, "Failed to restore register cache: %d\n", ret);
  1169			goto err;
  1170		}
  1171	
  1172		return 0;
  1173	
  1174	err:
  1175		regcache_cache_only(cs42l43->regmap, true);
  1176	
  1177		return ret;
  1178	}
  1179	

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


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

* Re: [linux-next:master 9894/11453] drivers/mfd/cs42l43.c:1138:12: warning: 'cs42l43_runtime_resume' defined but not used
  2023-08-21 14:59 [linux-next:master 9894/11453] drivers/mfd/cs42l43.c:1138:12: warning: 'cs42l43_runtime_resume' defined but not used kernel test robot
@ 2023-08-21 15:51 ` Charles Keepax
  0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2023-08-21 15:51 UTC (permalink / raw)
  To: kernel test robot; +Cc: oe-kbuild-all, Linux Memory Management List, Lee Jones

On Mon, Aug 21, 2023 at 10:59:02PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   47d9bb711707d15b19fad18c8e2b4b027a264a3a
> commit: ace6d14481386ec6c1b63cc2b24c71433a583dc2 [9894/11453] mfd: cs42l43: Add support for cs42l43 core driver
> config: openrisc-allyesconfig (https://download.01.org/0day-ci/archive/20230821/202308212225.fGjY1rr6-lkp@intel.com/config)
> compiler: or1k-linux-gcc (GCC) 12.3.0
> reproduce: (https://download.01.org/0day-ci/archive/20230821/202308212225.fGjY1rr6-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202308212225.fGjY1rr6-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> >> drivers/mfd/cs42l43.c:1138:12: warning: 'cs42l43_runtime_resume' defined but not used [-Wunused-function]
>     1138 | static int cs42l43_runtime_resume(struct device *dev)
>          |            ^~~~~~~~~~~~~~~~~~~~~~
> >> drivers/mfd/cs42l43.c:1124:12: warning: 'cs42l43_runtime_suspend' defined but not used [-Wunused-function]
>     1124 | static int cs42l43_runtime_suspend(struct device *dev)
>          |            ^~~~~~~~~~~~~~~~~~~~~~~
> >> drivers/mfd/cs42l43.c:1106:12: warning: 'cs42l43_resume' defined but not used [-Wunused-function]
>     1106 | static int cs42l43_resume(struct device *dev)
>          |            ^~~~~~~~~~~~~~
> >> drivers/mfd/cs42l43.c:1076:12: warning: 'cs42l43_suspend' defined but not used [-Wunused-function]
>     1076 | static int cs42l43_suspend(struct device *dev)
>          |            ^~~~~~~~~~~~~~~
> 

Will check this and get a fixup sent out tomorrow, my
understanding was that the __maybe_unused shouldn't have been
necessary with the new style pm macros but it seems I have got
something wrong on that front.

Thanks,
Charles


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

end of thread, other threads:[~2023-08-21 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-21 14:59 [linux-next:master 9894/11453] drivers/mfd/cs42l43.c:1138:12: warning: 'cs42l43_runtime_resume' defined but not used kernel test robot
2023-08-21 15:51 ` Charles Keepax

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox