Re: [PATCH 1/4] drivers/hwmon/pmbus: Add IBM power supply hwmon driver
From: kbuild test robot
Date: Thu Aug 03 2017 - 04:26:10 EST
Hi Edward,
[auto build test ERROR on hwmon/hwmon-next]
[also build test ERROR on v4.13-rc3 next-20170803]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Eddie-James/drivers-hwmon-pmbus-Add-IBM-power-supply-hwmon-driver/20170803-122545
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
In file included from drivers/hwmon/pmbus/ibmps.c:13:0:
>> drivers/hwmon/pmbus/ibmps.c:148:25: error: 'p8_i2c_occ_of_match' undeclared here (not in a function)
MODULE_DEVICE_TABLE(of, p8_i2c_occ_of_match);
^
include/linux/module.h:212:21: note: in definition of macro 'MODULE_DEVICE_TABLE'
extern const typeof(name) __mod_##type##__##name##_device_table \
^~~~
>> include/linux/module.h:212:27: error: '__mod_of__p8_i2c_occ_of_match_device_table' aliased to undefined symbol 'p8_i2c_occ_of_match'
extern const typeof(name) __mod_##type##__##name##_device_table \
^
>> drivers/hwmon/pmbus/ibmps.c:148:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
MODULE_DEVICE_TABLE(of, p8_i2c_occ_of_match);
^~~~~~~~~~~~~~~~~~~
--
In file included from drivers/hwmon//pmbus/ibmps.c:13:0:
drivers/hwmon//pmbus/ibmps.c:148:25: error: 'p8_i2c_occ_of_match' undeclared here (not in a function)
MODULE_DEVICE_TABLE(of, p8_i2c_occ_of_match);
^
include/linux/module.h:212:21: note: in definition of macro 'MODULE_DEVICE_TABLE'
extern const typeof(name) __mod_##type##__##name##_device_table \
^~~~
>> include/linux/module.h:212:27: error: '__mod_of__p8_i2c_occ_of_match_device_table' aliased to undefined symbol 'p8_i2c_occ_of_match'
extern const typeof(name) __mod_##type##__##name##_device_table \
^
drivers/hwmon//pmbus/ibmps.c:148:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
MODULE_DEVICE_TABLE(of, p8_i2c_occ_of_match);
^~~~~~~~~~~~~~~~~~~
vim +/p8_i2c_occ_of_match +148 drivers/hwmon/pmbus/ibmps.c
> 13 #include <linux/module.h>
14
15 #include "pmbus.h"
16
17 #define IBMPS_MFR_FAN_FAULT BIT(0)
18 #define IBMPS_MFR_THERMAL_FAULT BIT(1)
19 #define IBMPS_MFR_OV_FAULT BIT(2)
20 #define IBMPS_MFR_UV_FAULT BIT(3)
21 #define IBMPS_MFR_PS_KILL BIT(4)
22 #define IBMPS_MFR_OC_FAULT BIT(5)
23 #define IBMPS_MFR_VAUX_FAULT BIT(6)
24 #define IBMPS_MFR_CURRENT_SHARE_WARNING BIT(7)
25
26 static int ibmps_read_word_data(struct i2c_client *client, int page, int reg);
27
28 static int ibmps_read_byte_data(struct i2c_client *client, int page, int reg)
29 {
30 int rc, mfr;
31
32 switch (reg) {
33 case PMBUS_STATUS_BYTE:
34 case PMBUS_STATUS_WORD:
35 rc = ibmps_read_word_data(client, page, PMBUS_STATUS_WORD);
36 break;
37 case PMBUS_STATUS_VOUT:
38 case PMBUS_STATUS_IOUT:
39 case PMBUS_STATUS_TEMPERATURE:
40 case PMBUS_STATUS_FAN_12:
41 rc = pmbus_read_byte_data(client, page, reg);
42 if (rc < 0)
43 return rc;
44
45 mfr = pmbus_read_byte_data(client, page,
46 PMBUS_STATUS_MFR_SPECIFIC);
47 if (mfr < 0)
48 return rc;
49
50 if (reg == PMBUS_STATUS_FAN_12) {
51 if (mfr & IBMPS_MFR_FAN_FAULT)
52 rc |= PB_FAN_FAN1_FAULT;
53 } else if (reg == PMBUS_STATUS_TEMPERATURE) {
54 if (mfr & IBMPS_MFR_THERMAL_FAULT)
55 rc |= PB_TEMP_OT_FAULT;
56 } else if (reg == PMBUS_STATUS_VOUT) {
57 if (mfr & (IBMPS_MFR_OV_FAULT | IBMPS_MFR_VAUX_FAULT))
58 rc |= PB_VOLTAGE_OV_FAULT;
59 if (mfr & IBMPS_MFR_UV_FAULT)
60 rc |= PB_VOLTAGE_UV_FAULT;
61 } else if (reg == PMBUS_STATUS_IOUT) {
62 if (mfr & IBMPS_MFR_OC_FAULT)
63 rc |= PB_IOUT_OC_FAULT;
64 if (mfr & IBMPS_MFR_CURRENT_SHARE_WARNING)
65 rc |= PB_CURRENT_SHARE_FAULT;
66 }
67 break;
68 default:
69 if (reg >= PMBUS_VIRT_BASE)
70 return -ENXIO;
71
72 rc = pmbus_read_byte_data(client, page, reg);
73 break;
74 }
75
76 return rc;
77 }
78
79 static int ibmps_read_word_data(struct i2c_client *client, int page, int reg)
80 {
81 int rc, mfr;
82
83 switch (reg) {
84 case PMBUS_STATUS_BYTE:
85 case PMBUS_STATUS_WORD:
86 rc = pmbus_read_word_data(client, page, PMBUS_STATUS_WORD);
87 if (rc < 0)
88 return rc;
89
90 mfr = pmbus_read_byte_data(client, page,
91 PMBUS_STATUS_MFR_SPECIFIC);
92 if (mfr < 0)
93 return rc;
94
95 if (mfr & IBMPS_MFR_PS_KILL)
96 rc |= PB_STATUS_OFF;
97
98 if (mfr)
99 rc |= PB_STATUS_WORD_MFR;
100 break;
101 default:
102 if (reg >= PMBUS_VIRT_BASE)
103 return -ENXIO;
104
105 rc = pmbus_read_word_data(client, page, reg);
106 if (rc < 0)
107 rc = ibmps_read_byte_data(client, page, reg);
108 break;
109 }
110
111 return rc;
112 }
113
114 static struct pmbus_driver_info ibmps_info = {
115 .pages = 1,
116 .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_IOUT |
117 PMBUS_HAVE_PIN | PMBUS_HAVE_FAN12 | PMBUS_HAVE_TEMP |
118 PMBUS_HAVE_TEMP2 | PMBUS_HAVE_TEMP3 | PMBUS_HAVE_STATUS_VOUT |
119 PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_STATUS_INPUT |
120 PMBUS_HAVE_STATUS_TEMP | PMBUS_HAVE_STATUS_FAN12,
121 .read_byte_data = ibmps_read_byte_data,
122 .read_word_data = ibmps_read_word_data,
123 };
124
125 static int ibmps_probe(struct i2c_client *client,
126 const struct i2c_device_id *id)
127 {
128 return pmbus_do_probe(client, id, &ibmps_info);
129 }
130
131 static int ibmps_remove(struct i2c_client *client)
132 {
133 return pmbus_do_remove(client);
134 }
135
136 enum chips { witherspoon };
137
138 static const struct i2c_device_id ibmps_id[] = {
139 { "witherspoon", witherspoon },
140 { }
141 };
142 MODULE_DEVICE_TABLE(i2c, ibmps_id);
143
144 static const struct of_device_id ibmps_of_match[] = {
145 { .compatible = "ibm,ibmps" },
146 {}
147 };
> 148 MODULE_DEVICE_TABLE(of, p8_i2c_occ_of_match);
149
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip