regulator: add regulator_equal()

-----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl4d41kTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0MXhB/0drqav2m9Z/JG7y8E+FCQr/G4lBLAj
 0pDOqIwK0G+sP869KMuBbJmxi1JbCsA1+Qd5y9x1FRYLgeVIud92nPEmrCNXGcRR
 9ZbCafRxLr2TuHw4aZocad/3U50Kgc6q1vBs2IhfRlejL9MFBvkPEHGfCAmOwYLc
 a2FxwZ7jyfnZfDOyTr4ULtnc4U61NIyEbF3hWs5D7IR5lRy8C26yqpHph6JN4Bj7
 G4UDy+rbzsUjE1DuxWsVDm0vrtcNvOqZkO5QQ5GeOrC2YTPbYAZ0qNhDO4zOSV+3
 6AQEqgLtBx9yary+Uc5QuSMzDxV2wSExP8EeWEKKnaUvTtvqhDjFOI2S
 =vWQq
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl4d49ITHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0AeoB/9Y7Ov882rhVfebuKAbuGt10DuWuTgw
 j5LRIPU8tz+Xsjz+hGScsc9jAeF8bFzUldJ9yQOl8LWg1+kFVwe2WyBnvwM6qTA7
 7EN7BkMySuneQGLXiEKY7a79/7RqXgBa0UHR6EXAxiJ0yRUN058h0xQIcH4CXM+E
 t0uM9Q4GNZ0zC8s0Ey5/r41zGsiTKMZMhJDTCezChzCe+beDELZ+aNsLUdIGD4VE
 f3AEMNZtH8MmUgcRK7+tXaKeBvVmVL8k7Ws2yzIhox0jeTe2tlYqYxl8Y/HN1V9X
 R/p+VrJDo8hQR/0uycL7jFg7fG28V7CLnOET+ZsO/DSXFxb2/kbT/oDI
 =t2uD
 -----END PGP SIGNATURE-----

Merge tag 'regulator-eq' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into asoc-5.6

regulator: add regulator_equal()
This commit is contained in:
Mark Brown 2020-01-14 15:52:48 +00:00
commit aa6dcba831
2 changed files with 21 additions and 0 deletions

View File

@ -13,6 +13,8 @@
#include <linux/regulator/driver.h>
#include <linux/module.h>
#include "internal.h"
/**
* regulator_is_enabled_regmap - standard is_enabled() for regmap users
*
@ -881,3 +883,15 @@ void regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers,
consumers[i].supply = supply_names[i];
}
EXPORT_SYMBOL_GPL(regulator_bulk_set_supply_names);
/**
* regulator_is_equal - test whether two regulators are the same
*
* @reg1: first regulator to operate on
* @reg2: second regulator to operate on
*/
bool regulator_is_equal(struct regulator *reg1, struct regulator *reg2)
{
return reg1->rdev == reg2->rdev;
}
EXPORT_SYMBOL_GPL(regulator_is_equal);

View File

@ -287,6 +287,8 @@ void regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers,
const char *const *supply_names,
unsigned int num_supplies);
bool regulator_is_equal(struct regulator *reg1, struct regulator *reg2);
#else
/*
@ -593,6 +595,11 @@ regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers,
{
}
static inline bool
regulator_is_equal(struct regulator *reg1, struct regulator *reg2);
{
return false;
}
#endif
static inline int regulator_set_voltage_triplet(struct regulator *regulator,