Skip to content

Commit 155c45a

Browse files
Marek Vasutsre
authored andcommitted
power: supply: Ratelimit no data debug output
Reduce the amount of output this dev_dbg() statement emits into logs, otherwise if system software polls the sysfs entry for data and keeps getting -ENODATA, it could end up filling the logs up. This does in fact make systemd journald choke, since during boot the sysfs power supply entries are polled and if journald starts at the same time, the journal is just being repeatedly filled up, and the system stops on trying to start journald without booting any further. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 44c524b commit 155c45a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/power/supply/power_supply_sysfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ static ssize_t power_supply_show_property(struct device *dev,
286286

287287
if (ret < 0) {
288288
if (ret == -ENODATA)
289-
dev_dbg(dev, "driver has no data for `%s' property\n",
289+
dev_dbg_ratelimited(dev,
290+
"driver has no data for `%s' property\n",
290291
attr->attr.name);
291292
else if (ret != -ENODEV && ret != -EAGAIN)
292293
dev_err_ratelimited(dev,

0 commit comments

Comments
 (0)