diff options
-rw-r--r-- | BUILD.bazel | 18 | ||||
-rw-r--r-- | Kbuild | 2 | ||||
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | nitrous.c | 11 |
4 files changed, 26 insertions, 10 deletions
diff --git a/BUILD.bazel b/BUILD.bazel index 91f32ce..01126b5 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -6,15 +6,25 @@ # unless you have coordinated with the team managing the Soong to Bazel # migration. -load("//build/kleaf:kernel.bzl", "kernel_module") +load("//build/kernel/kleaf:kernel.bzl", "kernel_module") kernel_module( - name = "broadcom.cloudripper", + name = "broadcom.slider", + srcs = glob([ + "**/*.c", + "**/*.h", + "Kbuild", + ]) + [ + "//gs/google-modules/soc-modules:gs101_soc_headers", + ], outs = [ "nitrous.ko", ], - kernel_build = "//private/gs-google:cloudripper", + kernel_build = "//gs/google-modules/soc-modules:slider", + kernel_module_deps = [ + "//gs/google-modules/soc-modules:gs101_soc", + ], visibility = [ - "//private/gs-google:__pkg__", + "//gs/google-modules/soc-modules:__pkg__", ], ) @@ -1,3 +1 @@ obj-$(CONFIG_NITROUS) := nitrous.o - -ccflags-y += -I$(abspath $(KERNEL_SRC)/$(M)) @@ -3,5 +3,8 @@ M ?= $(shell pwd) KBUILD_OPTIONS := CONFIG_NITROUS=m +include $(KERNEL_SRC)/../gs/google-modules/soc-modules/Makefile.include + modules modules_install clean: - $(MAKE) -C $(KERNEL_SRC) M=$(M) W=1 $(KBUILD_OPTIONS) $(@) + $(MAKE) -C $(KERNEL_SRC) M=$(M) W=1 \ + $(KBUILD_OPTIONS) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" KBUILD_EXTRA_SYMBOLS="$(EXTRA_SYMBOLS)" $(@) @@ -247,6 +247,7 @@ static int nitrous_proc_show(struct seq_file *m, void *v) struct nitrous_lpm_proc *data = m->private; struct nitrous_bt_lpm *lpm = data->lpm; ktime_t timestamp; + unsigned int ret; switch (data->operation) { case PROC_BTWAKE: @@ -264,7 +265,11 @@ static int nitrous_proc_show(struct seq_file *m, void *v) (lpm->is_suspended ? "asleep" : "awake")); break; case PROC_TIMESYNC: - kfifo_out(&lpm->timestamp_queue, ×tamp, sizeof(ktime_t)); + ret = kfifo_out(&lpm->timestamp_queue, ×tamp, sizeof(ktime_t)); + if (ret != sizeof(ktime_t)) { + dev_err(lpm->dev, "failed to get the timestamp, ret=%u\n", ret); + return -EINVAL; + } seq_printf(m, "%lld", ktime_to_us(timestamp)); break; default: @@ -275,13 +280,13 @@ static int nitrous_proc_show(struct seq_file *m, void *v) static int nitrous_proc_open(struct inode *inode, struct file *file) { - return single_open(file, nitrous_proc_show, PDE_DATA(inode)); + return single_open(file, nitrous_proc_show, pde_data(inode)); } static ssize_t nitrous_proc_write(struct file *file, const char *buf, size_t count, loff_t *pos) { - struct nitrous_lpm_proc *data = PDE_DATA(file_inode(file)); + struct nitrous_lpm_proc *data = pde_data(file_inode(file)); struct nitrous_bt_lpm *lpm = data->lpm; struct timespec64 ts; char lbuf[4]; |