mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 06:43:09 +00:00
1ce5ab7c1d
Add is_valid_path API to check whether the sysfs file is present or not. Suggested-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Wyes Karny <wyes.karny@amd.com> Tested-by: Perry Yuan <Perry.Yuan@amd.com> Acked-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
13 lines
364 B
C
13 lines
364 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#define PATH_TO_CPU "/sys/devices/system/cpu/"
|
|
|
|
#ifndef MAX_LINE_LEN
|
|
#define MAX_LINE_LEN 4096
|
|
#endif
|
|
|
|
#define SYSFS_PATH_MAX 255
|
|
|
|
int is_valid_path(const char *path);
|
|
unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen);
|
|
unsigned int cpupower_write_sysfs(const char *path, char *buf, size_t buflen);
|