Skip to content

Commit 6e5505c

Browse files
andy-shevbroonie
authored andcommitted
regulator: core: Avoid device name duplication in NORMAL_GET
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]>
1 parent e177440 commit 6e5505c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/regulator/core.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,6 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
18491849
{
18501850
struct regulator_dev *rdev;
18511851
struct regulator *regulator;
1852-
const char *devname = dev ? dev_name(dev) : "deviceless";
18531852
struct device_link *link;
18541853
int ret;
18551854

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

0 commit comments

Comments
 (0)