aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Villemoes <[email protected]>2024-03-20 11:49:39 +0100
committerDaniel Lezcano <[email protected]>2024-04-23 12:40:29 +0200
commit58b1569244fea51cbf675774fad9423359d76c57 (patch)
tree7502e55df16997d6625628e6a908c9f09307040b
parentd9d3490c48df572edefc0b64655259eefdcbb9be (diff)
thermal/drivers/armada: Simplify name sanitization
Simplify the code by using the helper we have for doing exactly this. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--drivers/thermal/armada_thermal.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index f783547ef964..fdcb077cfd54 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -763,7 +763,6 @@ static void armada_set_sane_name(struct platform_device *pdev,
struct armada_thermal_priv *priv)
{
const char *name = dev_name(&pdev->dev);
- char *insane_char;
if (strlen(name) > THERMAL_NAME_LENGTH) {
/*
@@ -781,12 +780,8 @@ static void armada_set_sane_name(struct platform_device *pdev,
/* Save the name locally */
strscpy(priv->zone_name, name, THERMAL_NAME_LENGTH);
- /* Then check there are no '-' or hwmon core will complain */
- do {
- insane_char = strpbrk(priv->zone_name, "-");
- if (insane_char)
- *insane_char = '_';
- } while (insane_char);
+ /* Then ensure there are no '-' or hwmon core will complain */
+ strreplace(priv->zone_name, '-', '_');
}
/*