Re: [PATCH v1 1/1] mux: consumer: Add dummy functions for !CONFIG_MULTIPLEXER case

From: kbuild test robot
Date: Sat Jul 08 2017 - 11:34:13 EST


Hi Kuppuswamy,

[auto build test ERROR on linus/master]
[also build test ERROR on next-20170707]
[cannot apply to v4.12]
[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/sathyanarayanan-kuppuswamy-linux-intel-com/mux-consumer-Add-dummy-functions-for-CONFIG_MULTIPLEXER-case/20170708-194501
config: i386-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=i386

All errors (new ones prefixed by >>):

>> drivers/mux/mux-core.c:290:14: error: redefinition of 'mux_control_states'
unsigned int mux_control_states(struct mux_control *mux)
^~~~~~~~~~~~~~~~~~
In file included from drivers/mux/mux-core.c:21:0:
include/linux/mux/consumer.h:34:14: note: previous definition of 'mux_control_states' was here
unsigned int mux_control_states(struct mux_control *mux)
^~~~~~~~~~~~~~~~~~
>> drivers/mux/mux-core.c:337:5: error: redefinition of 'mux_control_select'
int mux_control_select(struct mux_control *mux, unsigned int state)
^~~~~~~~~~~~~~~~~~
In file included from drivers/mux/mux-core.c:21:0:
include/linux/mux/consumer.h:39:18: note: previous definition of 'mux_control_select' was here
int __must_check mux_control_select(struct mux_control *mux,
^~~~~~~~~~~~~~~~~~
>> drivers/mux/mux-core.c:369:5: error: redefinition of 'mux_control_try_select'
int mux_control_try_select(struct mux_control *mux, unsigned int state)
^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/mux/mux-core.c:21:0:
include/linux/mux/consumer.h:45:18: note: previous definition of 'mux_control_try_select' was here
int __must_check mux_control_try_select(struct mux_control *mux,
^~~~~~~~~~~~~~~~~~~~~~
>> drivers/mux/mux-core.c:397:5: error: redefinition of 'mux_control_deselect'
int mux_control_deselect(struct mux_control *mux)
^~~~~~~~~~~~~~~~~~~~
In file included from drivers/mux/mux-core.c:21:0:
include/linux/mux/consumer.h:51:5: note: previous definition of 'mux_control_deselect' was here
int mux_control_deselect(struct mux_control *mux)
^~~~~~~~~~~~~~~~~~~~
>> drivers/mux/mux-core.c:432:21: error: redefinition of 'mux_control_get'
struct mux_control *mux_control_get(struct device *dev, const char *mux_name)
^~~~~~~~~~~~~~~
In file included from drivers/mux/mux-core.c:21:0:
include/linux/mux/consumer.h:56:21: note: previous definition of 'mux_control_get' was here
struct mux_control *mux_control_get(struct device *dev, const char *mux_name)
^~~~~~~~~~~~~~~
>> drivers/mux/mux-core.c:493:6: error: redefinition of 'mux_control_put'
void mux_control_put(struct mux_control *mux)
^~~~~~~~~~~~~~~
In file included from drivers/mux/mux-core.c:21:0:
include/linux/mux/consumer.h:61:6: note: previous definition of 'mux_control_put' was here
void mux_control_put(struct mux_control *mux) {}
^~~~~~~~~~~~~~~
>> drivers/mux/mux-core.c:514:21: error: redefinition of 'devm_mux_control_get'
struct mux_control *devm_mux_control_get(struct device *dev,
^~~~~~~~~~~~~~~~~~~~
In file included from drivers/mux/mux-core.c:21:0:
include/linux/mux/consumer.h:63:21: note: previous definition of 'devm_mux_control_get' was here
struct mux_control *devm_mux_control_get(struct device *dev,
^~~~~~~~~~~~~~~~~~~~

vim +/mux_control_states +290 drivers/mux/mux-core.c

a3b02a9c Peter Rosin 2017-05-14 284 /**
a3b02a9c Peter Rosin 2017-05-14 285 * mux_control_states() - Query the number of multiplexer states.
a3b02a9c Peter Rosin 2017-05-14 286 * @mux: The mux-control to query.
a3b02a9c Peter Rosin 2017-05-14 287 *
a3b02a9c Peter Rosin 2017-05-14 288 * Return: The number of multiplexer states.
a3b02a9c Peter Rosin 2017-05-14 289 */
a3b02a9c Peter Rosin 2017-05-14 @290 unsigned int mux_control_states(struct mux_control *mux)
a3b02a9c Peter Rosin 2017-05-14 291 {
a3b02a9c Peter Rosin 2017-05-14 292 return mux->states;
a3b02a9c Peter Rosin 2017-05-14 293 }
a3b02a9c Peter Rosin 2017-05-14 294 EXPORT_SYMBOL_GPL(mux_control_states);
a3b02a9c Peter Rosin 2017-05-14 295
a3b02a9c Peter Rosin 2017-05-14 296 /*
a3b02a9c Peter Rosin 2017-05-14 297 * The mux->lock must be down when calling this function.
a3b02a9c Peter Rosin 2017-05-14 298 */
a3b02a9c Peter Rosin 2017-05-14 299 static int __mux_control_select(struct mux_control *mux, int state)
a3b02a9c Peter Rosin 2017-05-14 300 {
a3b02a9c Peter Rosin 2017-05-14 301 int ret;
a3b02a9c Peter Rosin 2017-05-14 302
a3b02a9c Peter Rosin 2017-05-14 303 if (WARN_ON(state < 0 || state >= mux->states))
a3b02a9c Peter Rosin 2017-05-14 304 return -EINVAL;
a3b02a9c Peter Rosin 2017-05-14 305
a3b02a9c Peter Rosin 2017-05-14 306 if (mux->cached_state == state)
a3b02a9c Peter Rosin 2017-05-14 307 return 0;
a3b02a9c Peter Rosin 2017-05-14 308
a3b02a9c Peter Rosin 2017-05-14 309 ret = mux_control_set(mux, state);
a3b02a9c Peter Rosin 2017-05-14 310 if (ret >= 0)
a3b02a9c Peter Rosin 2017-05-14 311 return 0;
a3b02a9c Peter Rosin 2017-05-14 312
a3b02a9c Peter Rosin 2017-05-14 313 /* The mux update failed, try to revert if appropriate... */
a3b02a9c Peter Rosin 2017-05-14 314 if (mux->idle_state != MUX_IDLE_AS_IS)
a3b02a9c Peter Rosin 2017-05-14 315 mux_control_set(mux, mux->idle_state);
a3b02a9c Peter Rosin 2017-05-14 316
a3b02a9c Peter Rosin 2017-05-14 317 return ret;
a3b02a9c Peter Rosin 2017-05-14 318 }
a3b02a9c Peter Rosin 2017-05-14 319
a3b02a9c Peter Rosin 2017-05-14 320 /**
a3b02a9c Peter Rosin 2017-05-14 321 * mux_control_select() - Select the given multiplexer state.
a3b02a9c Peter Rosin 2017-05-14 322 * @mux: The mux-control to request a change of state from.
a3b02a9c Peter Rosin 2017-05-14 323 * @state: The new requested state.
a3b02a9c Peter Rosin 2017-05-14 324 *
a3b02a9c Peter Rosin 2017-05-14 325 * On successfully selecting the mux-control state, it will be locked until
a3b02a9c Peter Rosin 2017-05-14 326 * there is a call to mux_control_deselect(). If the mux-control is already
a3b02a9c Peter Rosin 2017-05-14 327 * selected when mux_control_select() is called, the caller will be blocked
a3b02a9c Peter Rosin 2017-05-14 328 * until mux_control_deselect() is called (by someone else).
a3b02a9c Peter Rosin 2017-05-14 329 *
a3b02a9c Peter Rosin 2017-05-14 330 * Therefore, make sure to call mux_control_deselect() when the operation is
a3b02a9c Peter Rosin 2017-05-14 331 * complete and the mux-control is free for others to use, but do not call
a3b02a9c Peter Rosin 2017-05-14 332 * mux_control_deselect() if mux_control_select() fails.
a3b02a9c Peter Rosin 2017-05-14 333 *
a3b02a9c Peter Rosin 2017-05-14 334 * Return: 0 when the mux-control state has the requested state or a negative
a3b02a9c Peter Rosin 2017-05-14 335 * errno on error.
a3b02a9c Peter Rosin 2017-05-14 336 */
a3b02a9c Peter Rosin 2017-05-14 @337 int mux_control_select(struct mux_control *mux, unsigned int state)
a3b02a9c Peter Rosin 2017-05-14 338 {
a3b02a9c Peter Rosin 2017-05-14 339 int ret;
a3b02a9c Peter Rosin 2017-05-14 340
a3b02a9c Peter Rosin 2017-05-14 341 ret = down_killable(&mux->lock);
a3b02a9c Peter Rosin 2017-05-14 342 if (ret < 0)
a3b02a9c Peter Rosin 2017-05-14 343 return ret;
a3b02a9c Peter Rosin 2017-05-14 344
a3b02a9c Peter Rosin 2017-05-14 345 ret = __mux_control_select(mux, state);
a3b02a9c Peter Rosin 2017-05-14 346
a3b02a9c Peter Rosin 2017-05-14 347 if (ret < 0)
a3b02a9c Peter Rosin 2017-05-14 348 up(&mux->lock);
a3b02a9c Peter Rosin 2017-05-14 349
a3b02a9c Peter Rosin 2017-05-14 350 return ret;
a3b02a9c Peter Rosin 2017-05-14 351 }
a3b02a9c Peter Rosin 2017-05-14 352 EXPORT_SYMBOL_GPL(mux_control_select);
a3b02a9c Peter Rosin 2017-05-14 353
a3b02a9c Peter Rosin 2017-05-14 354 /**
a3b02a9c Peter Rosin 2017-05-14 355 * mux_control_try_select() - Try to select the given multiplexer state.
a3b02a9c Peter Rosin 2017-05-14 356 * @mux: The mux-control to request a change of state from.
a3b02a9c Peter Rosin 2017-05-14 357 * @state: The new requested state.
a3b02a9c Peter Rosin 2017-05-14 358 *
a3b02a9c Peter Rosin 2017-05-14 359 * On successfully selecting the mux-control state, it will be locked until
a3b02a9c Peter Rosin 2017-05-14 360 * mux_control_deselect() called.
a3b02a9c Peter Rosin 2017-05-14 361 *
a3b02a9c Peter Rosin 2017-05-14 362 * Therefore, make sure to call mux_control_deselect() when the operation is
a3b02a9c Peter Rosin 2017-05-14 363 * complete and the mux-control is free for others to use, but do not call
a3b02a9c Peter Rosin 2017-05-14 364 * mux_control_deselect() if mux_control_try_select() fails.
a3b02a9c Peter Rosin 2017-05-14 365 *
a3b02a9c Peter Rosin 2017-05-14 366 * Return: 0 when the mux-control state has the requested state or a negative
a3b02a9c Peter Rosin 2017-05-14 367 * errno on error. Specifically -EBUSY if the mux-control is contended.
a3b02a9c Peter Rosin 2017-05-14 368 */
a3b02a9c Peter Rosin 2017-05-14 @369 int mux_control_try_select(struct mux_control *mux, unsigned int state)
a3b02a9c Peter Rosin 2017-05-14 370 {
a3b02a9c Peter Rosin 2017-05-14 371 int ret;
a3b02a9c Peter Rosin 2017-05-14 372
a3b02a9c Peter Rosin 2017-05-14 373 if (down_trylock(&mux->lock))
a3b02a9c Peter Rosin 2017-05-14 374 return -EBUSY;
a3b02a9c Peter Rosin 2017-05-14 375
a3b02a9c Peter Rosin 2017-05-14 376 ret = __mux_control_select(mux, state);
a3b02a9c Peter Rosin 2017-05-14 377
a3b02a9c Peter Rosin 2017-05-14 378 if (ret < 0)
a3b02a9c Peter Rosin 2017-05-14 379 up(&mux->lock);
a3b02a9c Peter Rosin 2017-05-14 380
a3b02a9c Peter Rosin 2017-05-14 381 return ret;
a3b02a9c Peter Rosin 2017-05-14 382 }
a3b02a9c Peter Rosin 2017-05-14 383 EXPORT_SYMBOL_GPL(mux_control_try_select);
a3b02a9c Peter Rosin 2017-05-14 384
a3b02a9c Peter Rosin 2017-05-14 385 /**
a3b02a9c Peter Rosin 2017-05-14 386 * mux_control_deselect() - Deselect the previously selected multiplexer state.
a3b02a9c Peter Rosin 2017-05-14 387 * @mux: The mux-control to deselect.
a3b02a9c Peter Rosin 2017-05-14 388 *
a3b02a9c Peter Rosin 2017-05-14 389 * It is required that a single call is made to mux_control_deselect() for
a3b02a9c Peter Rosin 2017-05-14 390 * each and every successful call made to either of mux_control_select() or
a3b02a9c Peter Rosin 2017-05-14 391 * mux_control_try_select().
a3b02a9c Peter Rosin 2017-05-14 392 *
a3b02a9c Peter Rosin 2017-05-14 393 * Return: 0 on success and a negative errno on error. An error can only
a3b02a9c Peter Rosin 2017-05-14 394 * occur if the mux has an idle state. Note that even if an error occurs, the
a3b02a9c Peter Rosin 2017-05-14 395 * mux-control is unlocked and is thus free for the next access.
a3b02a9c Peter Rosin 2017-05-14 396 */
a3b02a9c Peter Rosin 2017-05-14 @397 int mux_control_deselect(struct mux_control *mux)
a3b02a9c Peter Rosin 2017-05-14 398 {
a3b02a9c Peter Rosin 2017-05-14 399 int ret = 0;
a3b02a9c Peter Rosin 2017-05-14 400
a3b02a9c Peter Rosin 2017-05-14 401 if (mux->idle_state != MUX_IDLE_AS_IS &&
a3b02a9c Peter Rosin 2017-05-14 402 mux->idle_state != mux->cached_state)
a3b02a9c Peter Rosin 2017-05-14 403 ret = mux_control_set(mux, mux->idle_state);
a3b02a9c Peter Rosin 2017-05-14 404
a3b02a9c Peter Rosin 2017-05-14 405 up(&mux->lock);
a3b02a9c Peter Rosin 2017-05-14 406
a3b02a9c Peter Rosin 2017-05-14 407 return ret;
a3b02a9c Peter Rosin 2017-05-14 408 }
a3b02a9c Peter Rosin 2017-05-14 409 EXPORT_SYMBOL_GPL(mux_control_deselect);
a3b02a9c Peter Rosin 2017-05-14 410
a3b02a9c Peter Rosin 2017-05-14 411 static int of_dev_node_match(struct device *dev, const void *data)
a3b02a9c Peter Rosin 2017-05-14 412 {
a3b02a9c Peter Rosin 2017-05-14 413 return dev->of_node == data;
a3b02a9c Peter Rosin 2017-05-14 414 }
a3b02a9c Peter Rosin 2017-05-14 415
a3b02a9c Peter Rosin 2017-05-14 416 static struct mux_chip *of_find_mux_chip_by_node(struct device_node *np)
a3b02a9c Peter Rosin 2017-05-14 417 {
a3b02a9c Peter Rosin 2017-05-14 418 struct device *dev;
a3b02a9c Peter Rosin 2017-05-14 419
a3b02a9c Peter Rosin 2017-05-14 420 dev = class_find_device(&mux_class, NULL, np, of_dev_node_match);
a3b02a9c Peter Rosin 2017-05-14 421
a3b02a9c Peter Rosin 2017-05-14 422 return dev ? to_mux_chip(dev) : NULL;
a3b02a9c Peter Rosin 2017-05-14 423 }
a3b02a9c Peter Rosin 2017-05-14 424
a3b02a9c Peter Rosin 2017-05-14 425 /**
a3b02a9c Peter Rosin 2017-05-14 426 * mux_control_get() - Get the mux-control for a device.
a3b02a9c Peter Rosin 2017-05-14 427 * @dev: The device that needs a mux-control.
a3b02a9c Peter Rosin 2017-05-14 428 * @mux_name: The name identifying the mux-control.
a3b02a9c Peter Rosin 2017-05-14 429 *
a3b02a9c Peter Rosin 2017-05-14 430 * Return: A pointer to the mux-control, or an ERR_PTR with a negative errno.
a3b02a9c Peter Rosin 2017-05-14 431 */
a3b02a9c Peter Rosin 2017-05-14 @432 struct mux_control *mux_control_get(struct device *dev, const char *mux_name)
a3b02a9c Peter Rosin 2017-05-14 433 {
a3b02a9c Peter Rosin 2017-05-14 434 struct device_node *np = dev->of_node;
a3b02a9c Peter Rosin 2017-05-14 435 struct of_phandle_args args;

:::::: The code at line 290 was first introduced by commit
:::::: a3b02a9c6591ce154cd44e2383406390a45b530c mux: minimal mux subsystem

:::::: TO: Peter Rosin <peda@xxxxxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip