Skip to content

Commit

Permalink
regulator: core: Avoid device name duplication in NORMAL_GET
Browse files Browse the repository at this point in the history
With current code:
	st-gyro-i2c i2c-PRP0001:00: i2c-PRP0001:00 supply vdd not found, using dummy regulator

which looks a bit oververbose.

Replace this with simplified format string for the above case, and drop
"deviceless" case since for all dev_*() macros used in _regulator_get()
the "(null)" will be printed anyway.

Signed-off-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
andy-shev authored and broonie committed Mar 13, 2020
1 parent e177440 commit 6e5505c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,6 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
{
struct regulator_dev *rdev;
struct regulator *regulator;
const char *devname = dev ? dev_name(dev) : "deviceless";
struct device_link *link;
int ret;

Expand Down Expand Up @@ -1887,9 +1886,7 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
* enabled, even if it isn't hooked up, and just
* provide a dummy.
*/
dev_warn(dev,
"%s supply %s not found, using dummy regulator\n",
devname, id);
dev_warn(dev, "supply %s not found, using dummy regulator\n", id);
rdev = dummy_regulator_rdev;
get_device(&rdev->dev);
break;
Expand Down

0 comments on commit 6e5505c

Please sign in to comment.