staging: greybus: arche: use sysfs_emit() instead of sprintf()

Replace sprintf() with sysfs_emit() in state_show() sysfs attribute
callbacks in arche-platform.c and arche-apb-ctrl.c.

Checkpatch complains about code using sprintf(). This code here is
obviously safe as-is, but it would be more appropriate to use
sysfs_emit().

Signed-off-by: Ruslan Valiyev <linuxoid@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260226074858.67635-1-linuxoid@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ruslan Valiyev 2026-02-26 07:48:58 +00:00 committed by Greg Kroah-Hartman
parent 1f659f1cdf
commit 7b6f321f69

View File

@ -300,16 +300,16 @@ static ssize_t state_show(struct device *dev,
switch (apb->state) {
case ARCHE_PLATFORM_STATE_OFF:
return sprintf(buf, "off%s\n",
return sysfs_emit(buf, "off%s\n",
apb->init_disabled ? ",disabled" : "");
case ARCHE_PLATFORM_STATE_ACTIVE:
return sprintf(buf, "active\n");
return sysfs_emit(buf, "active\n");
case ARCHE_PLATFORM_STATE_STANDBY:
return sprintf(buf, "standby\n");
return sysfs_emit(buf, "standby\n");
case ARCHE_PLATFORM_STATE_FW_FLASHING:
return sprintf(buf, "fw_flashing\n");
return sysfs_emit(buf, "fw_flashing\n");
default:
return sprintf(buf, "unknown state\n");
return sysfs_emit(buf, "unknown state\n");
}
}