drivers/base/power/opp/core.c:1389:19: error: redefinition of 'dev_pm_opp_set_regulators'

From: kbuild test robot
Date: Sun Feb 12 2017 - 17:13:21 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7089db84e356562f8ba737c29e472cc42d530dbc
commit: dfbe4678d709e25e0f36e6b6333e2a7a67aefb7e PM / OPP: Add infrastructure to manage multiple regulators
date: 10 weeks ago
config: x86_64-randconfig-x008-201707 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout dfbe4678d709e25e0f36e6b6333e2a7a67aefb7e
# save the attached .config to linux build tree
make ARCH=x86_64

All errors (new ones prefixed by >>):

from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:115:29: note: previous definition of 'dev_pm_opp_get_max_volt_latency' was here
static inline unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:323:15: error: redefinition of 'dev_pm_opp_get_max_transition_latency'
unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:120:29: note: previous definition of 'dev_pm_opp_get_max_transition_latency' was here
static inline unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:343:20: error: redefinition of 'dev_pm_opp_get_suspend_opp'
struct dev_pm_opp *dev_pm_opp_get_suspend_opp(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:125:34: note: previous definition of 'dev_pm_opp_get_suspend_opp' was here
static inline struct dev_pm_opp *dev_pm_opp_get_suspend_opp(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:367:5: error: redefinition of 'dev_pm_opp_get_opp_count'
int dev_pm_opp_get_opp_count(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:105:19: note: previous definition of 'dev_pm_opp_get_opp_count' was here
static inline int dev_pm_opp_get_opp_count(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:420:20: error: redefinition of 'dev_pm_opp_find_freq_exact'
struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:130:34: note: previous definition of 'dev_pm_opp_find_freq_exact' was here
static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:486:20: error: redefinition of 'dev_pm_opp_find_freq_ceil'
struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:142:34: note: previous definition of 'dev_pm_opp_find_freq_ceil' was here
static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:527:20: error: redefinition of 'dev_pm_opp_find_freq_floor'
struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:136:34: note: previous definition of 'dev_pm_opp_find_freq_floor' was here
static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:623:5: error: redefinition of 'dev_pm_opp_set_rate'
int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
^~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:197:19: note: previous definition of 'dev_pm_opp_set_rate' was here
static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
^~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:941:6: error: redefinition of 'dev_pm_opp_remove'
void dev_pm_opp_remove(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:154:20: note: previous definition of 'dev_pm_opp_remove' was here
static inline void dev_pm_opp_remove(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1168:5: error: redefinition of 'dev_pm_opp_set_supported_hw'
int dev_pm_opp_set_supported_hw(struct device *dev, const u32 *versions,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:174:19: note: previous definition of 'dev_pm_opp_set_supported_hw' was here
static inline int dev_pm_opp_set_supported_hw(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1228:6: error: redefinition of 'dev_pm_opp_put_supported_hw'
void dev_pm_opp_put_supported_hw(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:181:20: note: previous definition of 'dev_pm_opp_put_supported_hw' was here
static inline void dev_pm_opp_put_supported_hw(struct device *dev) {}
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1280:5: error: redefinition of 'dev_pm_opp_set_prop_name'
int dev_pm_opp_set_prop_name(struct device *dev, const char *name)
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:183:19: note: previous definition of 'dev_pm_opp_set_prop_name' was here
static inline int dev_pm_opp_set_prop_name(struct device *dev, const char *name)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1337:6: error: redefinition of 'dev_pm_opp_put_prop_name'
void dev_pm_opp_put_prop_name(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:188:20: note: previous definition of 'dev_pm_opp_put_prop_name' was here
static inline void dev_pm_opp_put_prop_name(struct device *dev) {}
^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/base/power/opp/core.c:1389:19: error: redefinition of 'dev_pm_opp_set_regulators'
struct opp_table *dev_pm_opp_set_regulators(struct device *dev,
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:190:33: note: previous definition of 'dev_pm_opp_set_regulators' was here
static inline struct opp_table *dev_pm_opp_set_regulators(struct device *dev, const char * const names[], unsigned int count)
^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/base/power/opp/core.c:1468:6: error: redefinition of 'dev_pm_opp_put_regulators'
void dev_pm_opp_put_regulators(struct opp_table *opp_table)
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:195:20: note: previous definition of 'dev_pm_opp_put_regulators' was here
static inline void dev_pm_opp_put_regulators(struct opp_table *opp_table) {}
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1520:5: error: redefinition of 'dev_pm_opp_add'
int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
^~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:148:19: note: previous definition of 'dev_pm_opp_add' was here
static inline int dev_pm_opp_add(struct device *dev, unsigned long freq,
^~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1627:5: error: redefinition of 'dev_pm_opp_enable'
int dev_pm_opp_enable(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:158:19: note: previous definition of 'dev_pm_opp_enable' was here
static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1653:5: error: redefinition of 'dev_pm_opp_disable'
int dev_pm_opp_disable(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:163:19: note: previous definition of 'dev_pm_opp_disable' was here
static inline int dev_pm_opp_disable(struct device *dev, unsigned long freq)
^~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1673:28: error: redefinition of 'dev_pm_opp_get_notifier'
struct srcu_notifier_head *dev_pm_opp_get_notifier(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:168:42: note: previous definition of 'dev_pm_opp_get_notifier' was here
static inline struct srcu_notifier_head *dev_pm_opp_get_notifier(
^~~~~~~~~~~~~~~~~~~~~~~
drivers/base/power/opp/core.c:1737:6: error: redefinition of 'dev_pm_opp_remove_table'
void dev_pm_opp_remove_table(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/opp/opp.h:21:0,
from drivers/base/power/opp/core.c:24:
include/linux/pm_opp.h:212:20: note: previous definition of 'dev_pm_opp_remove_table' was here
static inline void dev_pm_opp_remove_table(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~~

vim +/dev_pm_opp_set_regulators +1389 drivers/base/power/opp/core.c

1331 * Locking: The internal opp_table and opp structures are RCU protected.
1332 * Hence this function internally uses RCU updater strategy with mutex locks
1333 * to keep the integrity of the internal data structures. Callers should ensure
1334 * that this function is *NOT* called under RCU protection or in contexts where
1335 * mutex cannot be locked.
1336 */
> 1337 void dev_pm_opp_put_prop_name(struct device *dev)
1338 {
1339 struct opp_table *opp_table;
1340
1341 /* Hold our table modification lock here */
1342 mutex_lock(&opp_table_lock);
1343
1344 /* Check for existing table for 'dev' first */
1345 opp_table = _find_opp_table(dev);
1346 if (IS_ERR(opp_table)) {
1347 dev_err(dev, "Failed to find opp_table: %ld\n",
1348 PTR_ERR(opp_table));
1349 goto unlock;
1350 }
1351
1352 /* Make sure there are no concurrent readers while updating opp_table */
1353 WARN_ON(!list_empty(&opp_table->opp_list));
1354
1355 if (!opp_table->prop_name) {
1356 dev_err(dev, "%s: Doesn't have a prop-name\n", __func__);
1357 goto unlock;
1358 }
1359
1360 kfree(opp_table->prop_name);
1361 opp_table->prop_name = NULL;
1362
1363 /* Try freeing opp_table if this was the last blocking resource */
1364 _remove_opp_table(opp_table);
1365
1366 unlock:
1367 mutex_unlock(&opp_table_lock);
1368 }
1369 EXPORT_SYMBOL_GPL(dev_pm_opp_put_prop_name);
1370
1371 /**
1372 * dev_pm_opp_set_regulators() - Set regulator names for the device
1373 * @dev: Device for which regulator name is being set.
1374 * @names: Array of pointers to the names of the regulator.
1375 * @count: Number of regulators.
1376 *
1377 * In order to support OPP switching, OPP layer needs to know the name of the
1378 * device's regulators, as the core would be required to switch voltages as
1379 * well.
1380 *
1381 * This must be called before any OPPs are initialized for the device.
1382 *
1383 * Locking: The internal opp_table and opp structures are RCU protected.
1384 * Hence this function internally uses RCU updater strategy with mutex locks
1385 * to keep the integrity of the internal data structures. Callers should ensure
1386 * that this function is *NOT* called under RCU protection or in contexts where
1387 * mutex cannot be locked.
1388 */
> 1389 struct opp_table *dev_pm_opp_set_regulators(struct device *dev,
1390 const char * const names[],
1391 unsigned int count)
1392 {
1393 struct opp_table *opp_table;
1394 struct regulator *reg;
1395 int ret, i;
1396
1397 mutex_lock(&opp_table_lock);
1398
1399 opp_table = _add_opp_table(dev);
1400 if (!opp_table) {
1401 ret = -ENOMEM;
1402 goto unlock;
1403 }
1404
1405 /* This should be called before OPPs are initialized */
1406 if (WARN_ON(!list_empty(&opp_table->opp_list))) {
1407 ret = -EBUSY;
1408 goto err;
1409 }
1410
1411 /* Already have regulators set */
1412 if (WARN_ON(opp_table->regulators)) {
1413 ret = -EBUSY;
1414 goto err;
1415 }
1416
1417 opp_table->regulators = kmalloc_array(count,
1418 sizeof(*opp_table->regulators),
1419 GFP_KERNEL);
1420 if (!opp_table->regulators) {
1421 ret = -ENOMEM;
1422 goto err;
1423 }
1424
1425 for (i = 0; i < count; i++) {
1426 reg = regulator_get_optional(dev, names[i]);
1427 if (IS_ERR(reg)) {
1428 ret = PTR_ERR(reg);
1429 if (ret != -EPROBE_DEFER)
1430 dev_err(dev, "%s: no regulator (%s) found: %d\n",
1431 __func__, names[i], ret);
1432 goto free_regulators;
1433 }
1434
1435 opp_table->regulators[i] = reg;
1436 }
1437
1438 opp_table->regulator_count = count;
1439
1440 mutex_unlock(&opp_table_lock);
1441 return opp_table;
1442
1443 free_regulators:
1444 while (i != 0)
1445 regulator_put(opp_table->regulators[--i]);
1446
1447 kfree(opp_table->regulators);
1448 opp_table->regulators = NULL;
1449 err:
1450 _remove_opp_table(opp_table);
1451 unlock:
1452 mutex_unlock(&opp_table_lock);
1453
1454 return ERR_PTR(ret);
1455 }
1456 EXPORT_SYMBOL_GPL(dev_pm_opp_set_regulators);
1457
1458 /**
1459 * dev_pm_opp_put_regulators() - Releases resources blocked for regulator
1460 * @opp_table: OPP table returned from dev_pm_opp_set_regulators().
1461 *
1462 * Locking: The internal opp_table and opp structures are RCU protected.
1463 * Hence this function internally uses RCU updater strategy with mutex locks
1464 * to keep the integrity of the internal data structures. Callers should ensure
1465 * that this function is *NOT* called under RCU protection or in contexts where
1466 * mutex cannot be locked.
1467 */
> 1468 void dev_pm_opp_put_regulators(struct opp_table *opp_table)
1469 {
1470 int i;
1471

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

Attachment: .config.gz
Description: application/gzip