From patchwork Sat Jan 17 01:14:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1573 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768612559; bh=5/hxQ/Blax45MOd3KoeMBJRQBgjNYyV5q3GmEAN2Hwo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XUK85vTq+Go4Pv5ndWSbhIcqY9EGETB3rA6I0T5J4/Id5Megcwm5HZZEgZOIaR7wf XFQdCc+nBYpjCJ+HCYZZNuDcR528IIJKsjWaeRVTNmHZfBVT4EOsk+gEcIve50T8h1 n2/fX4jRsBNM9jlS0TdrKK8nendDO/dww928JcfYwAJTlSNTY9FPbZo49eqA+dEdKS eKUnVx178UqITxTMO5zxf4QT7Sx/JRFn18BkXI4i1uvvQmEOBKJOivvTt/IAkYjND9 9qy/tc3zIS7vMzwTmZ+9qAuNN4QYCacyREMTgExEsRAMubPTx2aCUDSjTLp2zpwUdT PBkImXPrd9d8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C71A16913F for ; Fri, 16 Jan 2026 18:15:59 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ZyMlabdj6za1 for ; Fri, 16 Jan 2026 18:15:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768612559; bh=5/hxQ/Blax45MOd3KoeMBJRQBgjNYyV5q3GmEAN2Hwo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XUK85vTq+Go4Pv5ndWSbhIcqY9EGETB3rA6I0T5J4/Id5Megcwm5HZZEgZOIaR7wf XFQdCc+nBYpjCJ+HCYZZNuDcR528IIJKsjWaeRVTNmHZfBVT4EOsk+gEcIve50T8h1 n2/fX4jRsBNM9jlS0TdrKK8nendDO/dww928JcfYwAJTlSNTY9FPbZo49eqA+dEdKS eKUnVx178UqITxTMO5zxf4QT7Sx/JRFn18BkXI4i1uvvQmEOBKJOivvTt/IAkYjND9 9qy/tc3zIS7vMzwTmZ+9qAuNN4QYCacyREMTgExEsRAMubPTx2aCUDSjTLp2zpwUdT PBkImXPrd9d8w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0061693F4 for ; Fri, 16 Jan 2026 18:15:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768612557; bh=ey6u9eLgADDLiRigTN8xAGaO67i2uQ0nODEh9aKpa3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bEAZ8mX/jeEQxW88BFvIfhGhOiuG0ZONwHWyRnuRZA1qP9WL7DHvW8uvFZkjAysl1 Do+9IZanrLTasLWbnveJcryk2BDqsBsP76Y+VcG4TnuSWn6aMwfOYdgx9bFcIIO/zb dczisqJGjBd04XN5T/Blha3wNl/L41bIQ+hYiISgTxu0EdrRJkSEwTX2hFIuJWQTio m+CoAASNStxg8uwgP7rO6GdY5/SUODmDE5mdkAlLEZy9l96A8VWSegInDsCN5VgLEt ahYlI24YU62AadfXFZNXUUf1SI4SU4JqQf7VLg/nk0+SpSx2ZNQ0/HjEVwfFOaVvOh mSDPrteO/03Nw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9EFDF6913F; Fri, 16 Jan 2026 18:15:57 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id g6yhjHpGb7HX; Fri, 16 Jan 2026 18:15:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768612553; bh=DljqFi50XkrsSzY+Mn+vwUAQ5yA0//cm0Z3ujW686gg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CjqQUM45bpahc5ck7MBKPbChd1Fv8dxT+APoDlYXnZfvBoIQrehEG5DTFoS6dLDim rCgXiM5V536qvgBblyr+5EpfYo46mEdw8uxp07702ccrkW53dBgBqNeioUQkDYiaP2 3NerxDa125kYCyrCtlTYwaT4sKKtqlsGmItK8BVFPv99jLMLRw1akxsxHub5nde/B4 zxOikt64RhM4UI0S5ri5A6zbCEbKs94GfWABAh/dYKC2sluqBtYkYt9fHQI0E/JXk2 S9GXvSB0mjo2eN+HhQAWiImWAACZh5Ov74djcJbsH/gls4TUM+olkkwQ3IsJpoRA9O +oNU69NRTNK6Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 20244693D6; Fri, 16 Jan 2026 18:15:53 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 16 Jan 2026 18:14:35 -0700 Message-ID: <20260117011448.3007171-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260117011448.3007171-1-sjg@u-boot.org> References: <20260117011448.3007171-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HUAWRQSSPCXKSU6ZXCCNAB4YHFSDKYXB X-Message-ID-Hash: HUAWRQSSPCXKSU6ZXCCNAB4YHFSDKYXB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/19] linux: Add kobject.h header with kobject stubs List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move kobject type and related stubs to a dedicated header file that mirrors the Linux kernel organisation. kobject.h provides: - struct kobject with minimal fields (just name) - kobject_put() declaration - super_set_sysfs_name_bdev() stub macro These are minimal stubs since U-Boot doesn't have sysfs or the full kobject infrastructure. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/ext4_uboot.h | 11 ++++------- include/linux/kobject.h | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 include/linux/kobject.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 4fe7d40c37f..655d64398d5 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -112,10 +112,8 @@ typedef struct { unsigned int val; } kprojid_t; #define from_kprojid(ns, kprojid) ((kprojid).val) #define projid_eq(a, b) ((a).val == (b).val) -/* kobject - stub */ -struct kobject { - const char *name; -}; +/* kobject is now in linux/kobject.h */ +#include /* lockdep stubs - needed before jbd2.h is included */ #include @@ -1489,8 +1487,7 @@ struct block_device *file_bdev(struct file *file); int sync_blockdev(struct block_device *bdev); void invalidate_bdev(struct block_device *bdev); -/* Kobject - declarations for stub.c */ -void kobject_put(struct kobject *kobj); +/* kobject_put is now in linux/kobject.h */ /* wait_for_completion is now a macro in linux/completion.h */ /* DAX - declaration for stub.c */ @@ -1591,7 +1588,7 @@ static inline void super_set_uuid(struct super_block *sb, const u8 *uuid, memcpy(sb->s_uuid.b, uuid, len); } -#define super_set_sysfs_name_bdev(sb) do { } while (0) +/* super_set_sysfs_name_bdev is now in linux/kobject.h */ /* * mb_cache - metadata block cache stubs for xattr.c diff --git a/include/linux/kobject.h b/include/linux/kobject.h new file mode 100644 index 00000000000..f6427724d00 --- /dev/null +++ b/include/linux/kobject.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Kobject stubs for U-Boot + * + * U-Boot doesn't have sysfs or the full kobject infrastructure, + * so these are minimal stubs. + */ +#ifndef _LINUX_KOBJECT_H +#define _LINUX_KOBJECT_H + +#include + +/** + * struct kobject - kernel object + * @name: name of the object + * + * U-Boot stub - minimal structure for filesystem code. + */ +struct kobject { + const char *name; +}; + +/** + * kobject_put() - decrement refcount on kobject + * @kobj: object to release + * + * U-Boot stub - declared here, implemented in stub.c. + */ +void kobject_put(struct kobject *kobj); + +/* sysfs stubs */ +#define super_set_sysfs_name_bdev(sb) do { } while (0) + +#endif /* _LINUX_KOBJECT_H */