Re: [PATCH 2/2] hwmon: pmbus: adp1050 : Add driver support

kernel test robot
2024-03-18T21:29:18Z

Hi Radu,

kernel test robot noticed the following build errors:

[auto build test ERROR on groeck-staging/hwmon-next]
[also build test ERROR on robh/for-next linus/master v6.8 next-20240318]
[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/Radu-Sabau/dt-bindings-hwmon-pmbus-adp1050-add-bindings/20240318-202619
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link: https://lore.kernel.org/r/20240318112140.385244-3-radu.sabau%40analog.com
patch subject: [PATCH 2/2] hwmon: pmbus: adp1050 : Add driver support
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20240319/202403190552.U4RHYvqc-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240319/202403190552.U4RHYvqc-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/202403190552.U4RHYvqc-lkp@intel.com/

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

drivers/hwmon/pmbus/adp1050.c: In function 'adp1050_probe':
>> drivers/hwmon/pmbus/adp1050.c:47:45: warning: passing argument 2 of 'dev_err_probe' makes integer from pointer without a cast [-Wint-conversion]
47 | dev_err_probe(&client->dev, "Device can't be unlocked.\n");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| char *
In file included from include/linux/device.h:15,
from include/linux/acpi.h:14,
from include/linux/i2c.h:13,
from drivers/hwmon/pmbus/adp1050.c:9:
include/linux/dev_printk.h:277:64: note: expected 'int' but argument is of type 'char *'
277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ~~~~^~~
>> drivers/hwmon/pmbus/adp1050.c:47:17: error: too few arguments to function 'dev_err_probe'
47 | dev_err_probe(&client->dev, "Device can't be unlocked.\n");
| ^~~~~~~~~~~~~
include/linux/dev_printk.h:277:20: note: declared here
277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ^~~~~~~~~~~~~
drivers/hwmon/pmbus/adp1050.c:53:45: warning: passing argument 2 of 'dev_err_probe' makes integer from pointer without a cast [-Wint-conversion]
53 | dev_err_probe(&client->dev, "Device couldn't be unlocked.\n");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| char *
include/linux/dev_printk.h:277:64: note: expected 'int' but argument is of type 'char *'
277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ~~~~^~~
drivers/hwmon/pmbus/adp1050.c:53:17: error: too few arguments to function 'dev_err_probe'
53 | dev_err_probe(&client->dev, "Device couldn't be unlocked.\n");
| ^~~~~~~~~~~~~
include/linux/dev_printk.h:277:20: note: declared here
277 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ^~~~~~~~~~~~~

vim +/dev_err_probe +47 drivers/hwmon/pmbus/adp1050.c

> 9 #include <linux/i2c.h>
10 #include <linux/init.h>
11 #include <linux/kernel.h>
12 #include <linux/module.h>
13 #include <linux/of.h>
14 #include "pmbus.h"
15
16 #define ADP1050_CHIP_PASSWORD 0xD7
17
18 #define ADP1050_VIN_SCALE_MONITOR 0xD8
19 #define ADP1050_IIN_SCALE_MONITOR 0xD9
20
21 static struct pmbus_driver_info adp1050_info = {
22 .pages = 1,
23 .format[PSC_VOLTAGE_IN] = linear,
24 .format[PSC_VOLTAGE_OUT] = linear,
25 .format[PSC_CURRENT_IN] = linear,
26 .format[PSC_TEMPERATURE] = linear,
27 .func[0] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT
28 | PMBUS_HAVE_VIN | PMBUS_HAVE_STATUS_INPUT
29 | PMBUS_HAVE_IIN | PMBUS_HAVE_TEMP
30 | PMBUS_HAVE_STATUS_TEMP,
31 };
32
33 static int adp1050_probe(struct i2c_client *client)
34 {
35 u32 vin_scale_monitor, iin_scale_monitor;
36 int ret;
37
38 if (!i2c_check_functionality(client->adapter,
39 I2C_FUNC_SMBUS_WRITE_WORD_DATA))
40 return -ENODEV;
41
42 /* Unlock CHIP's password in order to be able to read/write to it's
43 * VIN_SCALE and IIN_SCALE registers.
44 */
45 ret = i2c_smbus_write_word_data(client, ADP1050_CHIP_PASSWORD, 0xFFFF);
46 if (ret < 0) {
> 47 dev_err_probe(&client->dev, "Device can't be unlocked.\n");
48 return ret;
49 }
50
51 ret = i2c_smbus_write_word_data(client, ADP1050_CHIP_PASSWORD, 0xFFFF);
52 if (ret < 0) {
53 dev_err_probe(&client->dev, "Device couldn't be unlocked.\n");
54 return ret;
55 }
56
57 /* If adi,vin-scale-monitor isn't set or is set to 0 means that the
58 * VIN monitor isn't used, therefore 0 is used as scale in order
59 * for the readings to return 0.
60 */
61 if (device_property_read_u32(&client->dev, "adi,vin-scale-monitor",
62 &vin_scale_monitor))
63 vin_scale_monitor = 0;
64
65 /* If adi,iin-scale-monitor isn't set or is set to 0 means that the
66 * IIN monitor isn't used, therefore 0 is used as scale in order
67 * for the readings to return 0.
68 */
69 if (device_property_read_u32(&client->dev, "adi,iin-scale-monitor",
70 &iin_scale_monitor))
71 iin_scale_monitor = 0;
72
73 ret = i2c_smbus_write_word_data(client, ADP1050_VIN_SCALE_MONITOR,
74 vin_scale_monitor);
75 if (ret < 0)
76 return ret;
77
78 ret = i2c_smbus_write_word_data(client, ADP1050_IIN_SCALE_MONITOR,
79 iin_scale_monitor);
80 if (ret < 0)
81 return ret;
82
83 return pmbus_do_probe(client, &adp1050_info);
84 }
85

--
0-DAY CI Kernel Test Service