Re: [PATCH] thermal/drivers/tsens: fix missing put_device error

From: kernel test robot
Date: Sun Apr 04 2021 - 02:09:23 EST


Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.12-rc5 next-20210401]
[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]

url: https://github.com/0day-ci/linux/commits/zhuguangqing83-gmail-com/thermal-drivers-tsens-fix-missing-put_device-error/20210404-123439
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2023a53bdf41b7646b1d384b6816af06309f73a5
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.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/0day-ci/linux/commit/8c940b4ee5ee1d96be026eee71f0c682262f94e4
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review zhuguangqing83-gmail-com/thermal-drivers-tsens-fix-missing-put_device-error/20210404-123439
git checkout 8c940b4ee5ee1d96be026eee71f0c682262f94e4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

drivers/thermal/qcom/tsens.c: In function 'init_common':
drivers/thermal/qcom/tsens.c:856:12: error: invalid storage class for function 'tsens_get_temp'
856 | static int tsens_get_temp(void *data, int *temp)
| ^~~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:856:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
856 | static int tsens_get_temp(void *data, int *temp)
| ^~~~~~
drivers/thermal/qcom/tsens.c:864:12: error: invalid storage class for function 'tsens_get_trend'
864 | static int tsens_get_trend(void *data, int trip, enum thermal_trend *trend)
| ^~~~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:875:28: error: invalid storage class for function 'tsens_suspend'
875 | static int __maybe_unused tsens_suspend(struct device *dev)
| ^~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:885:27: error: invalid storage class for function 'tsens_resume'
885 | static int __maybe_unused tsens_resume(struct device *dev)
| ^~~~~~~~~~~~
>> drivers/thermal/qcom/tsens.c:922:1: warning: 'alias' attribute ignored [-Wattributes]
922 | MODULE_DEVICE_TABLE(of, tsens_table);
| ^~~~~~~~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:925:14: error: initializer element is not constant
925 | .get_temp = tsens_get_temp,
| ^~~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:925:14: note: (near initialization for 'tsens_of_ops.get_temp')
drivers/thermal/qcom/tsens.c:926:15: error: initializer element is not constant
926 | .get_trend = tsens_get_trend,
| ^~~~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:926:15: note: (near initialization for 'tsens_of_ops.get_trend')
drivers/thermal/qcom/tsens.c:930:12: error: invalid storage class for function 'tsens_register_irq'
930 | static int tsens_register_irq(struct tsens_priv *priv, char *irqname,
| ^~~~~~~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:962:12: error: invalid storage class for function 'tsens_register'
962 | static int tsens_register(struct tsens_priv *priv)
| ^~~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:990:12: error: invalid storage class for function 'tsens_probe'
990 | static int tsens_probe(struct platform_device *pdev)
| ^~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1064:12: error: invalid storage class for function 'tsens_remove'
1064 | static int tsens_remove(struct platform_device *pdev)
| ^~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1077:11: error: initializer element is not constant
1077 | .probe = tsens_probe,
| ^~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1077:11: note: (near initialization for 'tsens_driver.probe')
drivers/thermal/qcom/tsens.c:1078:12: error: initializer element is not constant
1078 | .remove = tsens_remove,
| ^~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1078:12: note: (near initialization for 'tsens_driver.remove')
In file included from include/linux/device.h:32,
from include/linux/of_platform.h:9,
from drivers/thermal/qcom/tsens.c:14:
drivers/thermal/qcom/tsens.c:1085:24: error: invalid storage class for function 'tsens_driver_init'
1085 | module_platform_driver(tsens_driver);
| ^~~~~~~~~~~~
include/linux/device/driver.h:259:19: note: in definition of macro 'module_driver'
259 | static int __init __driver##_init(void) \
| ^~~~~~~~
drivers/thermal/qcom/tsens.c:1085:1: note: in expansion of macro 'module_platform_driver'
1085 | module_platform_driver(tsens_driver);
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/thermal/qcom/tsens.c:10:
>> include/linux/module.h:129:42: error: invalid storage class for function '__inittest'
129 | static inline initcall_t __maybe_unused __inittest(void) \
| ^~~~~~~~~~
include/linux/device/driver.h:263:1: note: in expansion of macro 'module_init'
263 | module_init(__driver##_init); \
| ^~~~~~~~~~~
include/linux/platform_device.h:257:2: note: in expansion of macro 'module_driver'
257 | module_driver(__platform_driver, platform_driver_register, \
| ^~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1085:1: note: in expansion of macro 'module_platform_driver'
1085 | module_platform_driver(tsens_driver);
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1085:1: warning: 'alias' attribute ignored [-Wattributes]
In file included from include/linux/device.h:32,
from include/linux/of_platform.h:9,
from drivers/thermal/qcom/tsens.c:14:
drivers/thermal/qcom/tsens.c:1085:24: error: invalid storage class for function 'tsens_driver_exit'
1085 | module_platform_driver(tsens_driver);
| ^~~~~~~~~~~~
include/linux/device/driver.h:264:20: note: in definition of macro 'module_driver'
264 | static void __exit __driver##_exit(void) \
| ^~~~~~~~
drivers/thermal/qcom/tsens.c:1085:1: note: in expansion of macro 'module_platform_driver'
1085 | module_platform_driver(tsens_driver);
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/device/driver.h:264:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
264 | static void __exit __driver##_exit(void) \
| ^~~~~~
include/linux/platform_device.h:257:2: note: in expansion of macro 'module_driver'
257 | module_driver(__platform_driver, platform_driver_register, \
| ^~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1085:1: note: in expansion of macro 'module_platform_driver'
1085 | module_platform_driver(tsens_driver);
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/thermal/qcom/tsens.c:10:
>> include/linux/module.h:135:42: error: invalid storage class for function '__exittest'
135 | static inline exitcall_t __maybe_unused __exittest(void) \
| ^~~~~~~~~~
include/linux/device/driver.h:268:1: note: in expansion of macro 'module_exit'
268 | module_exit(__driver##_exit);
| ^~~~~~~~~~~
include/linux/platform_device.h:257:2: note: in expansion of macro 'module_driver'
257 | module_driver(__platform_driver, platform_driver_register, \
| ^~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1085:1: note: in expansion of macro 'module_platform_driver'
1085 | module_platform_driver(tsens_driver);
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1085:1: warning: 'alias' attribute ignored [-Wattributes]
In file included from include/linux/module.h:21,
from drivers/thermal/qcom/tsens.c:10:
include/linux/moduleparam.h:24:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
24 | static const char __UNIQUE_ID(name)[] \
| ^~~~~~
include/linux/module.h:160:32: note: in expansion of macro '__MODULE_INFO'
160 | #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
| ^~~~~~~~~~~~~
include/linux/module.h:224:46: note: in expansion of macro 'MODULE_INFO'
224 | #define MODULE_LICENSE(_license) MODULE_FILE MODULE_INFO(license, _license)
| ^~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1087:1: note: in expansion of macro 'MODULE_LICENSE'
1087 | MODULE_LICENSE("GPL v2");
| ^~~~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1089:1: error: expected declaration or statement at end of input
1089 | MODULE_ALIAS("platform:qcom-tsens");
| ^~~~~~~~~~~~
drivers/thermal/qcom/tsens.c:1089:1: error: control reaches end of non-void function [-Werror=return-type]
1089 | MODULE_ALIAS("platform:qcom-tsens");
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors

Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for FRAME_POINTER
Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
Selected by
- FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86


vim +/alias +922 drivers/thermal/qcom/tsens.c

9066073c6c2799 Rajendra Nayak 2016-05-05 863
2cbcd2eab01b28 Amit Kucheria 2019-03-20 @864 static int tsens_get_trend(void *data, int trip, enum thermal_trend *trend)
9066073c6c2799 Rajendra Nayak 2016-05-05 865 {
8b71bce407b3f1 Amit Kucheria 2019-11-01 866 struct tsens_sensor *s = data;
69b628ac71f07d Amit Kucheria 2019-03-20 867 struct tsens_priv *priv = s->priv;
9066073c6c2799 Rajendra Nayak 2016-05-05 868
69b628ac71f07d Amit Kucheria 2019-03-20 869 if (priv->ops->get_trend)
8b71bce407b3f1 Amit Kucheria 2019-11-01 870 return priv->ops->get_trend(s, trend);
9066073c6c2799 Rajendra Nayak 2016-05-05 871
9066073c6c2799 Rajendra Nayak 2016-05-05 872 return -ENOTSUPP;
9066073c6c2799 Rajendra Nayak 2016-05-05 873 }
9066073c6c2799 Rajendra Nayak 2016-05-05 874
5b97469a55872a Arnd Bergmann 2016-07-04 875 static int __maybe_unused tsens_suspend(struct device *dev)
9066073c6c2799 Rajendra Nayak 2016-05-05 876 {
69b628ac71f07d Amit Kucheria 2019-03-20 877 struct tsens_priv *priv = dev_get_drvdata(dev);
9066073c6c2799 Rajendra Nayak 2016-05-05 878
69b628ac71f07d Amit Kucheria 2019-03-20 879 if (priv->ops && priv->ops->suspend)
69b628ac71f07d Amit Kucheria 2019-03-20 880 return priv->ops->suspend(priv);
9066073c6c2799 Rajendra Nayak 2016-05-05 881
9066073c6c2799 Rajendra Nayak 2016-05-05 882 return 0;
9066073c6c2799 Rajendra Nayak 2016-05-05 883 }
9066073c6c2799 Rajendra Nayak 2016-05-05 884
5b97469a55872a Arnd Bergmann 2016-07-04 885 static int __maybe_unused tsens_resume(struct device *dev)
9066073c6c2799 Rajendra Nayak 2016-05-05 886 {
69b628ac71f07d Amit Kucheria 2019-03-20 887 struct tsens_priv *priv = dev_get_drvdata(dev);
9066073c6c2799 Rajendra Nayak 2016-05-05 888
69b628ac71f07d Amit Kucheria 2019-03-20 889 if (priv->ops && priv->ops->resume)
69b628ac71f07d Amit Kucheria 2019-03-20 890 return priv->ops->resume(priv);
9066073c6c2799 Rajendra Nayak 2016-05-05 891
9066073c6c2799 Rajendra Nayak 2016-05-05 892 return 0;
9066073c6c2799 Rajendra Nayak 2016-05-05 893 }
9066073c6c2799 Rajendra Nayak 2016-05-05 894
9066073c6c2799 Rajendra Nayak 2016-05-05 895 static SIMPLE_DEV_PM_OPS(tsens_pm_ops, tsens_suspend, tsens_resume);
9066073c6c2799 Rajendra Nayak 2016-05-05 896
9066073c6c2799 Rajendra Nayak 2016-05-05 897 static const struct of_device_id tsens_table[] = {
9066073c6c2799 Rajendra Nayak 2016-05-05 898 {
9066073c6c2799 Rajendra Nayak 2016-05-05 899 .compatible = "qcom,msm8916-tsens",
840a5bd3ed3fdd Rajendra Nayak 2016-05-05 900 .data = &data_8916,
332bc8ebab2c0d Shawn Guo 2020-06-29 901 }, {
332bc8ebab2c0d Shawn Guo 2020-06-29 902 .compatible = "qcom,msm8939-tsens",
332bc8ebab2c0d Shawn Guo 2020-06-29 903 .data = &data_8939,
9066073c6c2799 Rajendra Nayak 2016-05-05 904 }, {
9066073c6c2799 Rajendra Nayak 2016-05-05 905 .compatible = "qcom,msm8974-tsens",
5e6703bd2d8354 Rajendra Nayak 2016-05-05 906 .data = &data_8974,
0e580290170dfb AngeloGioacchino Del Regno 2019-10-05 907 }, {
0e580290170dfb AngeloGioacchino Del Regno 2019-10-05 908 .compatible = "qcom,msm8976-tsens",
0e580290170dfb AngeloGioacchino Del Regno 2019-10-05 909 .data = &data_8976,
d059c739aacfbd Rajendra Nayak 2016-05-05 910 }, {
d059c739aacfbd Rajendra Nayak 2016-05-05 911 .compatible = "qcom,msm8996-tsens",
d059c739aacfbd Rajendra Nayak 2016-05-05 912 .data = &data_8996,
e8c24c6f5d1c7a Amit Kucheria 2019-03-20 913 }, {
e8c24c6f5d1c7a Amit Kucheria 2019-03-20 914 .compatible = "qcom,tsens-v1",
e8c24c6f5d1c7a Amit Kucheria 2019-03-20 915 .data = &data_tsens_v1,
191dc74bad60e1 Amit Kucheria 2018-07-18 916 }, {
191dc74bad60e1 Amit Kucheria 2018-07-18 917 .compatible = "qcom,tsens-v2",
191dc74bad60e1 Amit Kucheria 2018-07-18 918 .data = &data_tsens_v2,
9066073c6c2799 Rajendra Nayak 2016-05-05 919 },
9066073c6c2799 Rajendra Nayak 2016-05-05 920 {}
9066073c6c2799 Rajendra Nayak 2016-05-05 921 };
9066073c6c2799 Rajendra Nayak 2016-05-05 @922 MODULE_DEVICE_TABLE(of, tsens_table);
9066073c6c2799 Rajendra Nayak 2016-05-05 923

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip