/* * sysctl - sysctl set/get helpers * Subject to the GPL, version 2. */ #include #include #include #include #include #include #include "built_in.h" #include "sysctl.h" int sysctl_set_int(const char *file, int value) { char path[PATH_MAX]; char str[64]; ssize_t ret; int fd; strncpy(path, SYSCTL_PROC_PATH, PATH_MAX); strncat(path, file, PATH_MAX - sizeof(SYSCTL_PROC_PATH) - 1); fd = open(path, O_WRONLY); if (unlikely(fd < 0)) return -1; ret = snprintf(str, 63, "%d", value); if (ret < 0) { close(fd); return -1; } ret = write(fd, str, strlen(str)); close(fd); return ret <= 0 ? -1 : 0; } int sysctl_get_int(const char *file, int *value) { char path[PATH_MAX]; char str[64]; ssize_t ret; int fd; strncpy(path, SYSCTL_PROC_PATH, PATH_MAX); strncat(path, file, PATH_MAX - sizeof(SYSCTL_PROC_PATH) - 1); fd = open(path, O_RDONLY); if (fd < 0) return -1; ret = read(fd, str, sizeof(str)); if (ret > 0) { *value = atoi(str); ret = 0; } else { ret = -1; } close(fd); return ret; } ption value='emaclite-cleanup'>emaclite-cleanup net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2016-04-29 16:10:22 +0300
committerMark Brown <broonie@kernel.org>2016-04-29 18:15:15 +0100
commitfe5fd2540947a6c584e70f1249007dd636e62d78 (patch)
tree9f41d0ed04470586ad88ddc0cbed8764e33dfa55 /Documentation/devicetree/bindings/mtd
parentf55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff)
spi: davinci: Use dma_request_chan() for requesting DMA channel
With the new dma_request_chan() the client driver does not need to look for the DMA resource and it does not need to pass filter_fn anymore. By switching to the new API the driver can now support deferred probing against DMA. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'Documentation/devicetree/bindings/mtd')