Re: [PATCH v3 3/3] hwmon: Add Baikal-T1 PVT sensor driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Serge,

I love your patch! Yet something to improve:

[auto build test ERROR on v5.7-rc7]
[cannot apply to hwmon/hwmon-next next-20200526]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Serge-Semin/hwmon-Add-Baikal-T1-SoC-Process-Voltage-and-Temp-sensor-support/20200526-214218
base:    9cb1fd0efd195590b828b9b865421ad345a4a145
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
        # 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: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>, old ones prefixed by <<):

drivers/hwmon/bt1-pvt.c:65:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
65 | const static struct pvt_poly poly_temp_to_N = {
| ^~~~~
drivers/hwmon/bt1-pvt.c:76:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
76 | const static struct pvt_poly poly_N_to_temp = {
| ^~~~~
drivers/hwmon/bt1-pvt.c:97:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
97 | const static struct pvt_poly poly_volt_to_N = {
| ^~~~~
drivers/hwmon/bt1-pvt.c:105:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
105 | const static struct pvt_poly poly_N_to_volt = {
| ^~~~~
drivers/hwmon/bt1-pvt.c:795:5: warning: no previous prototype for 'pvt_hwmon_write' [-Wmissing-prototypes]
795 | int pvt_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
|     ^~~~~~~~~~~~~~~
drivers/hwmon/bt1-pvt.c: In function 'pvt_init_iface':
drivers/hwmon/bt1-pvt.c:1013:7: error: implicit declaration of function 'of_property_read_u32' [-Werror=implicit-function-declaration]
1013 |  if (!of_property_read_u32(pvt->dev->of_node,
|       ^~~~~~~~~~~~~~~~~~~~
drivers/hwmon/bt1-pvt.c: At top level:
>> drivers/hwmon/bt1-pvt.c:1138:34: error: array type has incomplete element type 'struct of_device_id'
1138 | static const struct of_device_id pvt_of_match[] = {
|                                  ^~~~~~~~~~~~
>> drivers/hwmon/bt1-pvt.c:1139:4: error: field name not in record or union initializer
1139 |  { .compatible = "baikal,bt1-pvt" },
|    ^
drivers/hwmon/bt1-pvt.c:1139:4: note: (near initialization for 'pvt_of_match')
cc1: some warnings being treated as errors

vim +1138 drivers/hwmon/bt1-pvt.c

   992	
   993	static void pvt_init_iface(struct pvt_hwmon *pvt)
   994	{
   995		unsigned int temp;
   996		u32 trim;
   997	
   998		/*
   999		 * Make sure all interrupts and controller are disabled so not to
  1000		 * accidentally have ISR executed before the driver data is fully
  1001		 * initialized. Clear the IRQ status as well.
  1002		 */
  1003		pvt_update(pvt->regs + PVT_INTR_MASK, PVT_INTR_ALL, PVT_INTR_ALL);
  1004		pvt_update(pvt->regs + PVT_CTRL, PVT_CTRL_EN, 0);
  1005		readl(pvt->regs + PVT_CLR_INTR);
  1006		readl(pvt->regs + PVT_DATA);
  1007	
  1008		/* Setup default sensor mode, timeout and temperature trim. */
  1009		pvt_set_mode(pvt, pvt_info[pvt->sensor].mode);
  1010		pvt_set_tout(pvt, PVT_TOUT_DEF);
  1011	
  1012		trim = PVT_TRIM_DEF;
> 1013		if (!of_property_read_u32(pvt->dev->of_node,
  1014		     "baikal,pvt-temp-trim-millicelsius", &temp))
  1015			trim = pvt_calc_trim(temp);
  1016	
  1017		pvt_set_trim(pvt, trim);
  1018	}
  1019	
  1020	static int pvt_request_irq(struct pvt_hwmon *pvt)
  1021	{
  1022		struct platform_device *pdev = to_platform_device(pvt->dev);
  1023		int ret;
  1024	
  1025		pvt->irq = platform_get_irq(pdev, 0);
  1026		if (pvt->irq < 0)
  1027			return pvt->irq;
  1028	
  1029		ret = devm_request_threaded_irq(pvt->dev, pvt->irq,
  1030						pvt_hard_isr, pvt_soft_isr,
  1031	#if defined(CONFIG_SENSORS_BT1_PVT_ALARMS)
  1032						IRQF_SHARED | IRQF_TRIGGER_HIGH |
  1033						IRQF_ONESHOT,
  1034	#else
  1035						IRQF_SHARED | IRQF_TRIGGER_HIGH,
  1036	#endif
  1037						"pvt", pvt);
  1038		if (ret) {
  1039			dev_err(pvt->dev, "Couldn't request PVT IRQ\n");
  1040			return ret;
  1041		}
  1042	
  1043		return 0;
  1044	}
  1045	
  1046	static int pvt_create_hwmon(struct pvt_hwmon *pvt)
  1047	{
  1048		pvt->hwmon = devm_hwmon_device_register_with_info(pvt->dev, "pvt", pvt,
  1049			&pvt_hwmon_info, pvt_hwmon_groups);
  1050		if (IS_ERR(pvt->hwmon)) {
  1051			dev_err(pvt->dev, "Couldn't create hwmon device\n");
  1052			return PTR_ERR(pvt->hwmon);
  1053		}
  1054	
  1055		return 0;
  1056	}
  1057	
  1058	#if defined(CONFIG_SENSORS_BT1_PVT_ALARMS)
  1059	
  1060	static void pvt_disable_iface(void *data)
  1061	{
  1062		struct pvt_hwmon *pvt = data;
  1063	
  1064		mutex_lock(&pvt->iface_mtx);
  1065		pvt_update(pvt->regs + PVT_CTRL, PVT_CTRL_EN, 0);
  1066		pvt_update(pvt->regs + PVT_INTR_MASK, PVT_INTR_DVALID,
  1067			   PVT_INTR_DVALID);
  1068		mutex_unlock(&pvt->iface_mtx);
  1069	}
  1070	
  1071	static int pvt_enable_iface(struct pvt_hwmon *pvt)
  1072	{
  1073		int ret;
  1074	
  1075		ret = devm_add_action(pvt->dev, pvt_disable_iface, pvt);
  1076		if (ret) {
  1077			dev_err(pvt->dev, "Can't add PVT disable interface action\n");
  1078			return ret;
  1079		}
  1080	
  1081		/*
  1082		 * Enable sensors data conversion and IRQ. We need to lock the
  1083		 * interface mutex since hwmon has just been created and the
  1084		 * corresponding sysfs files are accessible from user-space,
  1085		 * which theoretically may cause races.
  1086		 */
  1087		mutex_lock(&pvt->iface_mtx);
  1088		pvt_update(pvt->regs + PVT_INTR_MASK, PVT_INTR_DVALID, 0);
  1089		pvt_update(pvt->regs + PVT_CTRL, PVT_CTRL_EN, PVT_CTRL_EN);
  1090		mutex_unlock(&pvt->iface_mtx);
  1091	
  1092		return 0;
  1093	}
  1094	
  1095	#else /* !CONFIG_SENSORS_BT1_PVT_ALARMS */
  1096	
  1097	static int pvt_enable_iface(struct pvt_hwmon *pvt)
  1098	{
  1099		return 0;
  1100	}
  1101	
  1102	#endif /* !CONFIG_SENSORS_BT1_PVT_ALARMS */
  1103	
  1104	static int pvt_probe(struct platform_device *pdev)
  1105	{
  1106		struct pvt_hwmon *pvt;
  1107		int ret;
  1108	
  1109		pvt = pvt_create_data(pdev);
  1110		if (IS_ERR(pvt))
  1111			return PTR_ERR(pvt);
  1112	
  1113		ret = pvt_request_regs(pvt);
  1114		if (ret)
  1115			return ret;
  1116	
  1117		ret = pvt_request_clks(pvt);
  1118		if (ret)
  1119			return ret;
  1120	
  1121		pvt_init_iface(pvt);
  1122	
  1123		ret = pvt_request_irq(pvt);
  1124		if (ret)
  1125			return ret;
  1126	
  1127		ret = pvt_create_hwmon(pvt);
  1128		if (ret)
  1129			return ret;
  1130	
  1131		ret = pvt_enable_iface(pvt);
  1132		if (ret)
  1133			return ret;
  1134	
  1135		return 0;
  1136	}
  1137	
> 1138	static const struct of_device_id pvt_of_match[] = {
> 1139		{ .compatible = "baikal,bt1-pvt" },
  1140		{ }
  1141	};
  1142	MODULE_DEVICE_TABLE(of, pvt_of_match);
  1143	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux