From: kernel test robot <lkp@intel.com>
To: Marek Vasut <marex@denx.de>, linux-leds@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev,
Isai Gaspar <isaiezequiel.gaspar@nxp.com>,
Marek Vasut <marex@denx.de>, Conor Dooley <conor+dt@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>, Lee Jones <lee@kernel.org>,
Pavel Machek <pavel@ucw.cz>, Rob Herring <robh+dt@kernel.org>,
devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] leds: pca995x: Add support for PCA995X chips
Date: Wed, 5 Jul 2023 07:30:05 +0800 [thread overview]
Message-ID: <202307050752.XBy4Li9L-lkp@intel.com> (raw)
In-Reply-To: <20230704202843.91867-2-marex@denx.de>
Hi Marek,
kernel test robot noticed the following build warnings:
[auto build test WARNING on lee-leds/for-leds-next]
[also build test WARNING on krzk-dt/for-next pavel-leds/for-next linus/master v6.4 next-20230704]
[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/Marek-Vasut/leds-pca995x-Add-support-for-PCA995X-chips/20230705-043046
base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
patch link: https://lore.kernel.org/r/20230704202843.91867-2-marex%40denx.de
patch subject: [PATCH 2/2] leds: pca995x: Add support for PCA995X chips
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20230705/202307050752.XBy4Li9L-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230705/202307050752.XBy4Li9L-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/202307050752.XBy4Li9L-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/leds/leds-pca995x.c: In function 'pca995x_probe':
>> drivers/leds/leds-pca995x.c:103:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
103 | btype = (int)device_get_match_data(&client->dev);
| ^
drivers/leds/leds-pca995x.c: At top level:
drivers/leds/leds-pca995x.c:190:18: error: initialization of 'int (*)(struct i2c_client *)' from incompatible pointer type 'int (*)(struct i2c_client *, const struct i2c_device_id *)' [-Werror=incompatible-pointer-types]
190 | .probe = pca995x_probe,
| ^~~~~~~~~~~~~
drivers/leds/leds-pca995x.c:190:18: note: (near initialization for 'pca995x_driver.<anonymous>.probe')
cc1: some warnings being treated as errors
vim +103 drivers/leds/leds-pca995x.c
93
94 static int pca995x_probe(struct i2c_client *client, const struct i2c_device_id *id)
95 {
96 struct fwnode_handle *led_fwnodes[PCA995X_MAX_OUTPUTS] = { 0 };
97 struct fwnode_handle *np, *child;
98 struct device *dev = &client->dev;
99 struct pca995x_chip *chip;
100 struct pca995x_led *led;
101 int i, btype, reg, ret;
102
> 103 btype = (int)device_get_match_data(&client->dev);
104
105 np = dev_fwnode(dev);
106 if (!np)
107 return -ENODEV;
108
109 chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
110 if (!chip)
111 return -ENOMEM;
112
113 chip->btype = btype;
114 chip->regmap = devm_regmap_init_i2c(client, &pca995x_regmap);
115 if (IS_ERR(chip->regmap))
116 return PTR_ERR(chip->regmap);
117
118 i2c_set_clientdata(client, chip);
119
120 fwnode_for_each_available_child_node(np, child) {
121 ret = fwnode_property_read_u32(child, "reg", ®);
122 if (ret) {
123 fwnode_handle_put(child);
124 return ret;
125 }
126
127 if (reg < 0 || reg >= PCA995X_MAX_OUTPUTS || led_fwnodes[reg]) {
128 fwnode_handle_put(child);
129 return -EINVAL;
130 }
131
132 led = &chip->leds[reg];
133 led_fwnodes[reg] = child;
134 led->chip = chip;
135 led->led_no = reg;
136 led->ldev.brightness_set_blocking = pca995x_brightness_set;
137 led->ldev.max_brightness = 255;
138 }
139
140 for (i = 0; i < PCA995X_MAX_OUTPUTS; i++) {
141 struct led_init_data init_data = {};
142
143 if (!led_fwnodes[i])
144 continue;
145
146 init_data.fwnode = led_fwnodes[i];
147
148 ret = devm_led_classdev_register_ext(dev,
149 &chip->leds[i].ldev,
150 &init_data);
151 if (ret < 0) {
152 fwnode_handle_put(child);
153 return dev_err_probe(dev, ret,
154 "Could not register LED %s\n",
155 chip->leds[i].ldev.name);
156 }
157 }
158
159 /* Disable LED all-call address and set normal mode */
160 ret = regmap_write(chip->regmap, PCA995X_MODE1, PCA995X_MODE_1_CFG);
161 if (ret)
162 return ret;
163
164 /* IREF Output current value for all LEDn outputs */
165 return regmap_write(chip->regmap,
166 btype ? PCA9955B_IREFALL : PCA9952_IREFALL,
167 PCA995X_IREFALL_CFG);
168 }
169
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2023-07-04 23:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-04 20:28 [PATCH 1/2] dt-bindings: leds: pca995x: Add binding document for PCA995X chips Marek Vasut
2023-07-04 20:28 ` [PATCH 2/2] leds: pca995x: Add support " Marek Vasut
2023-07-04 23:30 ` kernel test robot [this message]
2023-07-04 23:50 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202307050752.XBy4Li9L-lkp@intel.com \
--to=lkp@intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=isaiezequiel.gaspar@nxp.com \
--cc=krzk@kernel.org \
--cc=lee@kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=marex@denx.de \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).