From nobody Wed Jun 17 07:29:05 2026 Received: from jpms-ob01-os7.noc.sony.co.jp (jpms-ob01-os7.noc.sony.co.jp [211.125.139.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A8373264EA; Mon, 27 Apr 2026 02:42:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.125.139.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777257741; cv=none; b=DX8IFh4j6AbjuGIwfNXgaqa1FcBDLiZHDPEnmvzVSpi9fjhgU9fXlRH/d8NUocbF+a8/v5/csFOWE6vubLV/4QANYv0edUa5RM4F1RLzKkJ3ezaRmNFqL+Oz/cJXTBO8EOqgGqynzk6m7TlucrrNAcrlbcr9m51ac+SUgp9WEgg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777257741; c=relaxed/simple; bh=4FGEsKZVItFVh3wNPBycUa5qbrb/KXyEWcUvvYGRmTk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LEMVvTYMAqhT+yAXiAc5X3Va/UbXnbIFCAvScRvF3yBYZYJtHoCtXOHDTZ+psbVCGh6IkWmcfUlxH2EM1hR9psccjwAnNe4bfjsN5QIZSjVxwinhgdrxsCpyTk55tgKp7aHviMqTv5BXjnPJv1tJq3KuUOk/lXEfgqP1/GWOIOo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com; spf=fail smtp.mailfrom=sony.com; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b=FitoFzXR; arc=none smtp.client-ip=211.125.139.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=sony.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="FitoFzXR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; s=s1jp; t=1777257736; x=1808793736; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=wwgvEYLWg4ZMf3xZuScEeBxUIZJiuxnz1K7s2O07bsk=; b=FitoFzXRopiCHWl6S3HztbbqImJ6J46jip6WWjk9rXCIaZTTKfKc8++t Ve3dKlUvOys+zjEVyPdgnAyo/AaSxbwnphMvfpCOB13IrzPHDo311Q91C Njml3EtIksQ9UjBcqPpPywLx1B8+eCkGPBy1FxyVXJcW2j0XRhC33ST9u yvLLBjue5DBUi0G/N1qYWFVrJzJTtHvCJManjYyJ3NvTc1w6zbz0s1C+9 4ZGPB3nyFe9u23X+ClHTI1MA1pfyQVLekaahaS6+4PFNPrWgU/0ILMBvA I3OFHxLLDEVHtHdYkjvmsk2OGYYZBxbJ2pJBEPOvV+0VFkjFFxFJ+Li3V g==; X-CSE-ConnectionGUID: DyLCiPLSR/6Z1EQCg3y6Sg== X-CSE-MsgGUID: VanL0y6XQ7WCKlbCQlfHkA== Received: from unknown (HELO jpmta-ob02-os7.noc.sony.co.jp) ([IPv6:2001:cf8:acf:1104::7]) by jpms-ob01-os7.noc.sony.co.jp with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2026 11:42:04 +0900 X-CSE-ConnectionGUID: 3gISxFTbRE6wRXgzByRNeQ== X-CSE-MsgGUID: 2jQXR9N4SDWHcLwm1Lb4tg== X-IronPort-AV: E=Sophos;i="6.23,201,1770562800"; d="scan'208";a="52275253" Received: from unknown (HELO [127.0.1.1]) ([IPv6:2001:cf8:1:573:0:dddd:eb3e:119e]) by jpmta-ob02-os7.noc.sony.co.jp with ESMTP; 27 Apr 2026 11:42:03 +0900 From: Shashank Balaji Date: Mon, 27 Apr 2026 11:41:21 +0900 Subject: [PATCH v4 1/4] kernel: param: initialize module_kset before do_initcalls() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260427-acpi_mod_name-v4-1-22b42240c9bf@sony.com> References: <20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com> In-Reply-To: <20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com> To: Suzuki K Poulose , James Clark , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Richard Cochran , Jonathan Corbet , Shuah Khan , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Mike Leach , Leo Yan , Mike Leach Cc: Rahul Bukte , Shashank Balaji , linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, driver-core@lists.linux.dev, rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, Daniel Palmer , Tim Bird , linux-modules@vger.kernel.org X-Mailer: b4 0.16-dev-3bfbc X-Developer-Signature: v=1; a=openpgp-sha256; l=3267; i=shashank.mahadasyam@sony.com; h=from:subject:message-id; bh=4FGEsKZVItFVh3wNPBycUa5qbrb/KXyEWcUvvYGRmTk=; b=owGbwMvMwCU2bX1+URVTXyjjabUkhsx3Z372X/GQFn/G+CwxnE2+ZN2+arfP4R0tjR9nbT/+N HinJqd1RykLgxgXg6yYIkupUvWvvSuClvScea0IM4eVCWQIAxenAEzEfAsjw/Jn1Zt/uwolbWX4 eUZPJ7zz/nwmG4676TFGCRxtT7+332D4Z7fVe96ZkKBJ6ieTePemvi+sszoXW8p479qp4PMmbUr 6jAA= X-Developer-Key: i=shashank.mahadasyam@sony.com; a=openpgp; fpr=75227BFABDA852A48CCCEB2196AF6F727A028E55 module_kset is initialized in param_sysfs_init(), a subsys_initcall. A numb= er of platform drivers register themselves prior to subsys_initcalls (tegra194_cbb_driver registers in a pure_initcall, for example). With an upcoming patch ("driver core: platform: set mod_name in driver registration= ") that sets their mod_name in struct device_driver, lookup_or_create_module_k= object() will be called for those drivers, which calls kset_find_obj(module_kset, mo= d_name). This causes a null deref because module_kset isn't alive yet. Fix this by initializing module_kset in do_basic_setup() before do_initcall= s(). Modernize the pr_warn while we're at it. Suggested-by: Greg Kroah-Hartman Suggested-by: Gary Guo Co-developed-by: Rahul Bukte Signed-off-by: Rahul Bukte Signed-off-by: Shashank Balaji Acked-by: Sumit Gupta --- include/linux/module.h | 4 ++++ init/main.c | 1 + kernel/params.c | 21 +++++++++------------ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 7566815fabbe..6478596e8f9f 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -886,6 +886,10 @@ static inline void module_for_each_mod(int(*func)(stru= ct module *mod, void *data #ifdef CONFIG_SYSFS extern struct kset *module_kset; extern const struct kobj_type module_ktype; + +void param_sysfs_init(void); +#else +static inline void param_sysfs_init(void) {} #endif /* CONFIG_SYSFS */ =20 #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:"= #x) diff --git a/init/main.c b/init/main.c index 96f93bb06c49..01552c6b62ff 100644 --- a/init/main.c +++ b/init/main.c @@ -1486,6 +1486,7 @@ static void __init do_basic_setup(void) ksysfs_init(); driver_init(); init_irq_proc(); + param_sysfs_init(); do_ctors(); do_initcalls(); } diff --git a/kernel/params.c b/kernel/params.c index 74d620bc2521..d1e3934fb3a7 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -942,22 +942,19 @@ const struct kobj_type module_ktype =3D { /* * param_sysfs_init - create "module" kset * - * This must be done before the initramfs is unpacked and - * request_module() thus becomes possible, because otherwise the - * module load would fail in mod_sysfs_init. + * Must run before: + * - do_initcalls(): some drivers register during initcalls and rely on + * module_kset existing for their sysfs module symlink. + * - rootfs_initcall (initramfs unpack): request_module() becomes possible. + * But if module_kset is null, module load would fail in mod_sysfs_init(= ), + * causing request_module() to fail. */ -static int __init param_sysfs_init(void) +void __init param_sysfs_init(void) { module_kset =3D kset_create_and_add("module", &module_uevent_ops, NULL); - if (!module_kset) { - printk(KERN_WARNING "%s (%d): error creating kset\n", - __FILE__, __LINE__); - return -ENOMEM; - } - - return 0; + if (!module_kset) + pr_warn("Error creating module kset\n"); } -subsys_initcall(param_sysfs_init); =20 /* * param_sysfs_builtin_init - add sysfs version and parameter --=20 2.43.0 From nobody Wed Jun 17 07:29:05 2026 Received: from jpms-ob01-os7.noc.sony.co.jp (jpms-ob01-os7.noc.sony.co.jp [211.125.139.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DFFA32695F; Mon, 27 Apr 2026 02:42:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.125.139.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777257741; cv=none; b=e7OIy24ZR/GZhk7RC/WTPKdpvswZpj7HbgMnj7S1nd7c8PgLZj+LK+0oA87n77dliAdcFsKaptZhJF+bUFPZgfy/39e/7IvB0vb5HlZgmW5BhE3loXmZRZ/mVnI+LCIk0VUUeQyw6SVuCpu0dAsxp9DXTaIl9IidRUpCUqNkqik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777257741; c=relaxed/simple; bh=McKmRd1+Lo18DKCybZFxap3kme/nTmBld+wIUrdjyzs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CIgxyB4WSHVOkFYbsr9Avg9npAAOtvZfMLHm66fjcqpsQAQYMrih3/S3s27q+KQA/4ROztwY4ELIKNZCdC575miw17+hEceCo2younO8V4pn+q/PgvnRvnQuf5cCCyvtEzl4zmOp1nV/pLYlz08eRS7FH84JLu0zIi4CyMlZe3Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com; spf=fail smtp.mailfrom=sony.com; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b=LFLzvzH3; arc=none smtp.client-ip=211.125.139.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=sony.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="LFLzvzH3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; s=s1jp; t=1777257738; x=1808793738; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=sE3kgNN3imuWW8hZNcKI+XXyp7KMJ221snrHqXZwehc=; b=LFLzvzH3xT7WvsutvC1vryHhdaaK+c59lWZfwQj9sUpSFSHTofbiynwd EeuOn7c9BzDHDcKd02twratnrcoc4LBROjBQKYaqNAZWoxGbf86jy/y21 CdUji7fnfuYt2dWSvdoV9WOtzfrphjNUKxQW8+LpAB4nCS/uiIVLDrlto k0IwgeTCYYdFeqGVty05xF1ECvqrKp/P/flO/ul+zkMffrnLkq0ZahoQv k5j/+069/fKjMDhhI8sEoAme/Ia6RYkczIKNZXPf3t8oH8ELdK47q7v/C QwpUYInVtmprbY//72G69VGY27onHLoHW+jeHZblCPeqVZkjFXVxVg3be g==; X-CSE-ConnectionGUID: utbI0cNWQuiwEtJGX669wQ== X-CSE-MsgGUID: +DuhioqIQrWG++sngv3Lfg== Received: from unknown (HELO jpmta-ob02-os7.noc.sony.co.jp) ([IPv6:2001:cf8:acf:1104::7]) by jpms-ob01-os7.noc.sony.co.jp with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2026 11:42:05 +0900 X-CSE-ConnectionGUID: 7HUeG7JaR32fPxS0uugJNQ== X-CSE-MsgGUID: eOsZfxyWTs2J2kChy1QIog== X-IronPort-AV: E=Sophos;i="6.23,201,1770562800"; d="scan'208";a="52275256" Received: from unknown (HELO [127.0.1.1]) ([IPv6:2001:cf8:1:573:0:dddd:eb3e:119e]) by jpmta-ob02-os7.noc.sony.co.jp with ESMTP; 27 Apr 2026 11:42:04 +0900 From: Shashank Balaji Date: Mon, 27 Apr 2026 11:41:22 +0900 Subject: [PATCH v4 2/4] coresight: pass THIS_MODULE implicitly through a macro Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260427-acpi_mod_name-v4-2-22b42240c9bf@sony.com> References: <20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com> In-Reply-To: <20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com> To: Suzuki K Poulose , James Clark , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Richard Cochran , Jonathan Corbet , Shuah Khan , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Mike Leach , Leo Yan , Mike Leach Cc: Rahul Bukte , Shashank Balaji , linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, driver-core@lists.linux.dev, rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, Daniel Palmer , Tim Bird , linux-modules@vger.kernel.org X-Mailer: b4 0.16-dev-3bfbc X-Developer-Signature: v=1; a=openpgp-sha256; l=8244; i=shashank.mahadasyam@sony.com; h=from:subject:message-id; bh=McKmRd1+Lo18DKCybZFxap3kme/nTmBld+wIUrdjyzs=; b=owGbwMvMwCU2bX1+URVTXyjjabUkhsx3Z34yPONbtepKVIh3pMbDW2YcLw+qfL9xbkfIXMePh wXn5Tt5d5SyMIhxMciKKbKUKlX/2rsiaEnPmdeKMHNYmcCGcHEKwER6qxgZzgr/rWPk7mUod53R xWF3gf/afmnG6GdS/AfuHuELUTdYxcgwcbkrbyy3yIRpGXf5ctefnvJK9Ovz9GP/K9K7tovoHXr IAgA= X-Developer-Key: i=shashank.mahadasyam@sony.com; a=openpgp; fpr=75227BFABDA852A48CCCEB2196AF6F727A028E55 Rename coresight_init_driver() to __coresight_init_driver() and replace it with a macro wrapper that passes THIS_MODULE implicitly. This is in line= with what other buses do. Suggested-by: Greg Kroah-Hartman Co-developed-by: Rahul Bukte Signed-off-by: Rahul Bukte Signed-off-by: Shashank Balaji Reviewed-by: Leo Yan --- drivers/hwtracing/coresight/coresight-catu.c | 2 +- drivers/hwtracing/coresight/coresight-core.c | 4 ++-- drivers/hwtracing/coresight/coresight-cpu-debug.c | 3 +-- drivers/hwtracing/coresight/coresight-funnel.c | 3 +-- drivers/hwtracing/coresight/coresight-replicator.c | 3 +-- drivers/hwtracing/coresight/coresight-stm.c | 2 +- drivers/hwtracing/coresight/coresight-tmc-core.c | 2 +- drivers/hwtracing/coresight/coresight-tnoc.c | 2 +- drivers/hwtracing/coresight/coresight-tpdm.c | 3 +-- drivers/hwtracing/coresight/coresight-tpiu.c | 2 +- include/linux/coresight.h | 4 +++- 11 files changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtraci= ng/coresight/coresight-catu.c index ce71dcddfca2..0c8698c8fc5e 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -706,7 +706,7 @@ static int __init catu_init(void) { int ret; =20 - ret =3D coresight_init_driver("catu", &catu_driver, &catu_platform_driver= , THIS_MODULE); + ret =3D coresight_init_driver("catu", &catu_driver, &catu_platform_driver= ); tmc_etr_set_catu_ops(&etr_catu_buf_ops); return ret; } diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtraci= ng/coresight/coresight-core.c index 46f247f73cf6..4ebcbd95b7fb 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -1694,7 +1694,7 @@ static void __exit coresight_exit(void) module_init(coresight_init); module_exit(coresight_exit); =20 -int coresight_init_driver(const char *drv, struct amba_driver *amba_drv, +int __coresight_init_driver(const char *drv, struct amba_driver *amba_drv, struct platform_driver *pdev_drv, struct module *owner) { int ret; @@ -1713,7 +1713,7 @@ int coresight_init_driver(const char *drv, struct amb= a_driver *amba_drv, amba_driver_unregister(amba_drv); return ret; } -EXPORT_SYMBOL_GPL(coresight_init_driver); +EXPORT_SYMBOL_GPL(__coresight_init_driver); =20 void coresight_remove_driver(struct amba_driver *amba_drv, struct platform_driver *pdev_drv) diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c b/drivers/hw= tracing/coresight/coresight-cpu-debug.c index 629614278e46..3a806c1d50ea 100644 --- a/drivers/hwtracing/coresight/coresight-cpu-debug.c +++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c @@ -757,8 +757,7 @@ static struct platform_driver debug_platform_driver =3D= { =20 static int __init debug_init(void) { - return coresight_init_driver("debug", &debug_driver, &debug_platform_driv= er, - THIS_MODULE); + return coresight_init_driver("debug", &debug_driver, &debug_platform_driv= er); } =20 static void __exit debug_exit(void) diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtra= cing/coresight/coresight-funnel.c index 3f56ceccd8c9..0abc11f0690c 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -412,8 +412,7 @@ static struct amba_driver dynamic_funnel_driver =3D { =20 static int __init funnel_init(void) { - return coresight_init_driver("funnel", &dynamic_funnel_driver, &funnel_dr= iver, - THIS_MODULE); + return coresight_init_driver("funnel", &dynamic_funnel_driver, &funnel_dr= iver); } =20 static void __exit funnel_exit(void) diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/h= wtracing/coresight/coresight-replicator.c index 07fc04f53b88..2f382de357ee 100644 --- a/drivers/hwtracing/coresight/coresight-replicator.c +++ b/drivers/hwtracing/coresight/coresight-replicator.c @@ -418,8 +418,7 @@ static struct amba_driver dynamic_replicator_driver =3D= { =20 static int __init replicator_init(void) { - return coresight_init_driver("replicator", &dynamic_replicator_driver, &r= eplicator_driver, - THIS_MODULE); + return coresight_init_driver("replicator", &dynamic_replicator_driver, &r= eplicator_driver); } =20 static void __exit replicator_exit(void) diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracin= g/coresight/coresight-stm.c index aca6cec7885a..4e860519a73f 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -1050,7 +1050,7 @@ static struct platform_driver stm_platform_driver =3D= { =20 static int __init stm_init(void) { - return coresight_init_driver("stm", &stm_driver, &stm_platform_driver, TH= IS_MODULE); + return coresight_init_driver("stm", &stm_driver, &stm_platform_driver); } =20 static void __exit stm_exit(void) diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwt= racing/coresight/coresight-tmc-core.c index c89fe996af23..bc5a133ada3e 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -1046,7 +1046,7 @@ static struct platform_driver tmc_platform_driver =3D= { =20 static int __init tmc_init(void) { - return coresight_init_driver("tmc", &tmc_driver, &tmc_platform_driver, TH= IS_MODULE); + return coresight_init_driver("tmc", &tmc_driver, &tmc_platform_driver); } =20 static void __exit tmc_exit(void) diff --git a/drivers/hwtracing/coresight/coresight-tnoc.c b/drivers/hwtraci= ng/coresight/coresight-tnoc.c index 96a25877b824..9e8de4323d28 100644 --- a/drivers/hwtracing/coresight/coresight-tnoc.c +++ b/drivers/hwtracing/coresight/coresight-tnoc.c @@ -344,7 +344,7 @@ static struct platform_driver itnoc_driver =3D { =20 static int __init tnoc_init(void) { - return coresight_init_driver("tnoc", &trace_noc_driver, &itnoc_driver, TH= IS_MODULE); + return coresight_init_driver("tnoc", &trace_noc_driver, &itnoc_driver); } =20 static void __exit tnoc_exit(void) diff --git a/drivers/hwtracing/coresight/coresight-tpdm.c b/drivers/hwtraci= ng/coresight/coresight-tpdm.c index eaf7210af648..8464edbba2d4 100644 --- a/drivers/hwtracing/coresight/coresight-tpdm.c +++ b/drivers/hwtracing/coresight/coresight-tpdm.c @@ -1563,8 +1563,7 @@ static struct platform_driver static_tpdm_driver =3D { =20 static int __init tpdm_init(void) { - return coresight_init_driver("tpdm", &dynamic_tpdm_driver, &static_tpdm_d= river, - THIS_MODULE); + return coresight_init_driver("tpdm", &dynamic_tpdm_driver, &static_tpdm_d= river); } =20 static void __exit tpdm_exit(void) diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtraci= ng/coresight/coresight-tpiu.c index b8560b140e0f..7b029d2eb389 100644 --- a/drivers/hwtracing/coresight/coresight-tpiu.c +++ b/drivers/hwtracing/coresight/coresight-tpiu.c @@ -310,7 +310,7 @@ static struct platform_driver tpiu_platform_driver =3D { =20 static int __init tpiu_init(void) { - return coresight_init_driver("tpiu", &tpiu_driver, &tpiu_platform_driver,= THIS_MODULE); + return coresight_init_driver("tpiu", &tpiu_driver, &tpiu_platform_driver); } =20 static void __exit tpiu_exit(void) diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 2131febebee9..b9ec5f195907 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -691,7 +691,9 @@ coresight_find_output_type(struct coresight_platform_da= ta *pdata, enum coresight_dev_type type, union coresight_dev_subtype subtype); =20 -int coresight_init_driver(const char *drv, struct amba_driver *amba_drv, +#define coresight_init_driver(drv, amba_drv, pdev_drv) \ + __coresight_init_driver(drv, amba_drv, pdev_drv, THIS_MODULE) +int __coresight_init_driver(const char *drv, struct amba_driver *amba_drv, struct platform_driver *pdev_drv, struct module *owner); =20 void coresight_remove_driver(struct amba_driver *amba_drv, --=20 2.43.0 From nobody Wed Jun 17 07:29:05 2026 Received: from jpms-ob01-os7.noc.sony.co.jp (jpms-ob01-os7.noc.sony.co.jp [211.125.139.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2D123290C5; Mon, 27 Apr 2026 02:42:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.125.139.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777257747; cv=none; b=iHuq52h2UhLg8SpNtjhHiE5QnW2TlnytKwbMiPAHR66dNeyijZmfeCfVQSHaUVUm/0AktloywpXiXAk94PlM3+xDzZqCJmZGNO73o2G13c/w4zNmDe+DImdG2akYu8FkR2c8MCASV+0GLcuSFAUOyXJhtaQgiy0Nb22LdKZiy28= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777257747; c=relaxed/simple; bh=BNjMv+UeN0qjwij+zL5VRk6cqBva9xgsACpZ+fsZoBw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ho0jpQU13m8IGYAmxex5TCAh8nZ+jWxeQ3jz9TbYGYFrwSyoxPQ0FNgC+MelAUtupW2zlVRnmSKGXLr6sFeObxapBpp6CzlNJ4R9vkkZEV5RaAJU/9uw5yh9vcGIwazxH1WFz8LwvTLqPzjgSU6ZULw/WUiyKILLmL9WY5Xa9Uo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com; spf=fail smtp.mailfrom=sony.com; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b=qjKO4DF7; arc=none smtp.client-ip=211.125.139.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=sony.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="qjKO4DF7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; s=s1jp; t=1777257743; x=1808793743; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=B1bu9mXK0/1BEroBsinLu8p7LUNCGwbYLkYKjl29rHc=; b=qjKO4DF7v1Dxi/FHNaaS5yK3RfpKH/6y2UtqcXcH6+/jlbYb4mdXeWk6 Q0lC+VJ1v2Zg+eMMRfmjs+18AkMXqKQk7uxd490rXRr+TJs5+5N56pi4v 1F1nLt1jwRS3/Y/q6Tt46lo0f+DQg8+z+roVJtdFmv9dA1zxckK9h+p1c dqMHulL7oyTYcpAfvR/CjxfwziBPIGSmRxcVTatFn6YZ+zsiajSWLHUIp j57u7hwLuC9CGOuCj0gobE94lBUMqHRSq0a8f6/hIabYo7Ivc4dVA9jRm x/75dWfRY5+IB+Bm2XW9mnwbg555cXL4iQidsEesCBd3E4Ii7y0y1ZYX4 A==; X-CSE-ConnectionGUID: kmhmcfq+TKGmaeCnbiK0jg== X-CSE-MsgGUID: 34lFrJ2cSayAzaypRtzmoA== Received: from unknown (HELO jpmta-ob02-os7.noc.sony.co.jp) ([IPv6:2001:cf8:acf:1104::7]) by jpms-ob01-os7.noc.sony.co.jp with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2026 11:42:06 +0900 X-CSE-ConnectionGUID: t4b3a1hmT2mqN6Wa1+4uYg== X-CSE-MsgGUID: 5XseCwWGTTKfw4L2rpXpDw== X-IronPort-AV: E=Sophos;i="6.23,201,1770562800"; d="scan'208";a="52275260" Received: from unknown (HELO [127.0.1.1]) ([IPv6:2001:cf8:1:573:0:dddd:eb3e:119e]) by jpmta-ob02-os7.noc.sony.co.jp with ESMTP; 27 Apr 2026 11:42:05 +0900 From: Shashank Balaji Date: Mon, 27 Apr 2026 11:41:23 +0900 Subject: [PATCH v4 3/4] driver core: platform: set mod_name in driver registration Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260427-acpi_mod_name-v4-3-22b42240c9bf@sony.com> References: <20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com> In-Reply-To: <20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com> To: Suzuki K Poulose , James Clark , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Richard Cochran , Jonathan Corbet , Shuah Khan , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Mike Leach , Leo Yan , Mike Leach Cc: Rahul Bukte , Shashank Balaji , linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, driver-core@lists.linux.dev, rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, Daniel Palmer , Tim Bird , linux-modules@vger.kernel.org X-Mailer: b4 0.16-dev-3bfbc X-Developer-Signature: v=1; a=openpgp-sha256; l=10432; i=shashank.mahadasyam@sony.com; h=from:subject:message-id; bh=BNjMv+UeN0qjwij+zL5VRk6cqBva9xgsACpZ+fsZoBw=; b=owGbwMvMwCU2bX1+URVTXyjjabUkhsx3Z365n6/6/FtCw3DtzNqTyQKdhn89GdLXulyRSZgy5 8TXHiG2jhIWBjEuBlkxRZZSpepfe1cELek581oRZg4rE8gQBi5OAZjI9yMM3yyk9rNnuinwVER1 TXg0qzfHeu195i2LA44nTLqqfqNCipHhxJeHE0MVn3EzzKhfqvvKrMGSZ9u2/1FHZU+pz3v0tvQ rAwA= X-Developer-Key: i=shashank.mahadasyam@sony.com; a=openpgp; fpr=75227BFABDA852A48CCCEB2196AF6F727A028E55 Pass KBUILD_MODNAME through the driver registration macro so that the driver core can create the module symlink in sysfs for built-in drivers, and fixup all callers. The Rust platform adapter is updated to pass the module name through to the= new parameter. Tested on qemu with: - x86 defconfig + CONFIG_RUST - arm64 defconfig + CONFIG_RUST + CONFIG_CORESIGHT stuff Examples after this patch: /sys/bus/platform/drivers/... coresight-itnoc/module -> coresight_tnoc coresight-static-tpdm/module -> coresight_tpdm coresight-catu-platform/module -> coresight_catu serial8250/module -> 8250 acpi-ged/module -> acpi vmclock/module -> ptp_vmclock Co-developed-by: Rahul Bukte Signed-off-by: Rahul Bukte Signed-off-by: Shashank Balaji --- This patch depends on patches 1 and 2. --- drivers/base/platform.c | 21 ++++++++++++++------- drivers/hwtracing/coresight/coresight-core.c | 5 +++-- include/linux/coresight.h | 5 +++-- include/linux/platform_device.h | 17 +++++++++-------- rust/kernel/platform.rs | 4 +++- 5 files changed, 32 insertions(+), 20 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 75b4698d0e58..2b0cc0889386 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -901,11 +901,14 @@ EXPORT_SYMBOL_GPL(platform_device_register_full); * __platform_driver_register - register a driver for platform-level devic= es * @drv: platform driver structure * @owner: owning module/driver + * @mod_name: module name string */ -int __platform_driver_register(struct platform_driver *drv, struct module = *owner) +int __platform_driver_register(struct platform_driver *drv, struct module = *owner, + const char *mod_name) { drv->driver.owner =3D owner; drv->driver.bus =3D &platform_bus_type; + drv->driver.mod_name =3D mod_name; =20 return driver_register(&drv->driver); } @@ -938,6 +941,7 @@ static int is_bound_to_driver(struct device *dev, void = *driver) * @drv: platform driver structure * @probe: the driver probe routine, probably from an __init section * @module: module which will be the owner of the driver + * @mod_name: module name string * * Use this instead of platform_driver_register() when you know the device * is not hotpluggable and has already been registered, and you want to @@ -955,7 +959,8 @@ static int is_bound_to_driver(struct device *dev, void = *driver) */ int __init_or_module __platform_driver_probe(struct platform_driver *drv, int (*probe)(struct platform_device *), - struct module *module) + struct module *module, + const char *mod_name) { int retval; =20 @@ -983,7 +988,7 @@ int __init_or_module __platform_driver_probe(struct pla= tform_driver *drv, =20 /* temporary section violation during probe() */ drv->probe =3D probe; - retval =3D __platform_driver_register(drv, module); + retval =3D __platform_driver_register(drv, module, mod_name); if (retval) return retval; =20 @@ -1011,6 +1016,7 @@ EXPORT_SYMBOL_GPL(__platform_driver_probe); * @data: platform specific data for this platform device * @size: size of platform specific data * @module: module which will be the owner of the driver + * @mod_name: module name string * * Use this in legacy-style modules that probe hardware directly and * register a single platform device and corresponding platform driver. @@ -1021,7 +1027,7 @@ struct platform_device * __init_or_module __platform_create_bundle(struct platform_driver *driver, int (*probe)(struct platform_device *), struct resource *res, unsigned int n_res, - const void *data, size_t size, struct module *module) + const void *data, size_t size, struct module *module, const char *mod_= name) { struct platform_device *pdev; int error; @@ -1044,7 +1050,7 @@ __platform_create_bundle(struct platform_driver *driv= er, if (error) goto err_pdev_put; =20 - error =3D __platform_driver_probe(driver, probe, module); + error =3D __platform_driver_probe(driver, probe, module, mod_name); if (error) goto err_pdev_del; =20 @@ -1064,6 +1070,7 @@ EXPORT_SYMBOL_GPL(__platform_create_bundle); * @drivers: an array of drivers to register * @count: the number of drivers to register * @owner: module owning the drivers + * @mod_name: module name string * * Registers platform drivers specified by an array. On failure to registe= r a * driver, all previously registered drivers will be unregistered. Callers= of @@ -1073,7 +1080,7 @@ EXPORT_SYMBOL_GPL(__platform_create_bundle); * Returns: 0 on success or a negative error code on failure. */ int __platform_register_drivers(struct platform_driver * const *drivers, - unsigned int count, struct module *owner) + unsigned int count, struct module *owner, const char *mod_name) { unsigned int i; int err; @@ -1081,7 +1088,7 @@ int __platform_register_drivers(struct platform_drive= r * const *drivers, for (i =3D 0; i < count; i++) { pr_debug("registering platform driver %ps\n", drivers[i]); =20 - err =3D __platform_driver_register(drivers[i], owner); + err =3D __platform_driver_register(drivers[i], owner, mod_name); if (err < 0) { pr_err("failed to register platform driver %ps: %d\n", drivers[i], err); diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtraci= ng/coresight/coresight-core.c index 4ebcbd95b7fb..9c4fdef76833 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -1695,7 +1695,8 @@ module_init(coresight_init); module_exit(coresight_exit); =20 int __coresight_init_driver(const char *drv, struct amba_driver *amba_drv, - struct platform_driver *pdev_drv, struct module *owner) + struct platform_driver *pdev_drv, struct module *owner, + const char *mod_name) { int ret; =20 @@ -1705,7 +1706,7 @@ int __coresight_init_driver(const char *drv, struct a= mba_driver *amba_drv, return ret; } =20 - ret =3D __platform_driver_register(pdev_drv, owner); + ret =3D __platform_driver_register(pdev_drv, owner, mod_name); if (!ret) return 0; =20 diff --git a/include/linux/coresight.h b/include/linux/coresight.h index b9ec5f195907..d7ae0527d039 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -692,9 +692,10 @@ coresight_find_output_type(struct coresight_platform_d= ata *pdata, union coresight_dev_subtype subtype); =20 #define coresight_init_driver(drv, amba_drv, pdev_drv) \ - __coresight_init_driver(drv, amba_drv, pdev_drv, THIS_MODULE) + __coresight_init_driver(drv, amba_drv, pdev_drv, THIS_MODULE, KBUILD_MODN= AME) int __coresight_init_driver(const char *drv, struct amba_driver *amba_drv, - struct platform_driver *pdev_drv, struct module *owner); + struct platform_driver *pdev_drv, struct module *owner, + const char *mod_name); =20 void coresight_remove_driver(struct amba_driver *amba_drv, struct platform_driver *pdev_drv); diff --git a/include/linux/platform_device.h b/include/linux/platform_devic= e.h index 975400a472e3..26e6a43358e2 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -293,18 +293,19 @@ struct platform_driver { * use a macro to avoid include chaining to get THIS_MODULE */ #define platform_driver_register(drv) \ - __platform_driver_register(drv, THIS_MODULE) + __platform_driver_register(drv, THIS_MODULE, KBUILD_MODNAME) extern int __platform_driver_register(struct platform_driver *, - struct module *); + struct module *, const char *mod_name); extern void platform_driver_unregister(struct platform_driver *); =20 /* non-hotpluggable platform devices may use this so that probe() and * its support may live in __init sections, conserving runtime memory. */ #define platform_driver_probe(drv, probe) \ - __platform_driver_probe(drv, probe, THIS_MODULE) + __platform_driver_probe(drv, probe, THIS_MODULE, KBUILD_MODNAME) extern int __platform_driver_probe(struct platform_driver *driver, - int (*probe)(struct platform_device *), struct module *module); + int (*probe)(struct platform_device *), struct module *module, + const char *mod_name); =20 static inline void *platform_get_drvdata(const struct platform_device *pde= v) { @@ -368,19 +369,19 @@ static int __init __platform_driver##_init(void) \ device_initcall(__platform_driver##_init); \ =20 #define platform_create_bundle(driver, probe, res, n_res, data, size) \ - __platform_create_bundle(driver, probe, res, n_res, data, size, THIS_MODU= LE) + __platform_create_bundle(driver, probe, res, n_res, data, size, THIS_MODU= LE, KBUILD_MODNAME) extern struct platform_device *__platform_create_bundle( struct platform_driver *driver, int (*probe)(struct platform_device *), struct resource *res, unsigned int n_res, - const void *data, size_t size, struct module *module); + const void *data, size_t size, struct module *module, const char *mod_nam= e); =20 int __platform_register_drivers(struct platform_driver * const *drivers, - unsigned int count, struct module *owner); + unsigned int count, struct module *owner, const char *mod_name); void platform_unregister_drivers(struct platform_driver * const *drivers, unsigned int count); =20 #define platform_register_drivers(drivers, count) \ - __platform_register_drivers(drivers, count, THIS_MODULE) + __platform_register_drivers(drivers, count, THIS_MODULE, KBUILD_MODNAME) =20 #ifdef CONFIG_SUSPEND extern int platform_pm_suspend(struct device *dev); diff --git a/rust/kernel/platform.rs b/rust/kernel/platform.rs index 8917d4ee499f..2d626eecc450 100644 --- a/rust/kernel/platform.rs +++ b/rust/kernel/platform.rs @@ -82,7 +82,9 @@ unsafe fn register( } =20 // SAFETY: `pdrv` is guaranteed to be a valid `DriverType`. - to_result(unsafe { bindings::__platform_driver_register(pdrv.get()= , module.0) }) + to_result(unsafe { + bindings::__platform_driver_register(pdrv.get(), module.0, nam= e.as_char_ptr()) + }) } =20 unsafe fn unregister(pdrv: &Opaque) { --=20 2.43.0 From nobody Wed Jun 17 07:29:05 2026 Received: from jpms-ob01-os7.noc.sony.co.jp (jpms-ob01-os7.noc.sony.co.jp [211.125.139.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60327328B62; Mon, 27 Apr 2026 02:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.125.139.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777257747; cv=none; b=nQirt0iqMfUyx5kox7hFy6YczREkpkOE54aArZ+IwDo+60iiYzdiULTyyxfo/CwGRtxiT3MFKd28IpJpU7+tlk8xdHz+6QramT7x8IzvqknWbuhGphlA3eC94dm5SYzkMrdit0LAm2+atyGOnJ8ZRJfQfrGKqMonA01x9twxKEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777257747; c=relaxed/simple; bh=Ntxs4LrM9nMix70BKY/iLLvKQ7C8YsLHb8BjcRBYfF0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Z4fdI1AqCZ23OQ5UMvKhwA+YvYQDJw7DeLVOKmo0d7DAtYyYHzcrYp6wCXtr0X781MziCaJ4BeefowxnwcVAOuH2+tBJf/3cbnOcUkreMMj8o/HACDz1iA3qN/WWIdnWoQ3nfGtzrnpcszp3UXFafLa6TGJ7y/Qw5YDvxbinbV0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com; spf=fail smtp.mailfrom=sony.com; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b=OsK6yiDO; arc=none smtp.client-ip=211.125.139.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=sony.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="OsK6yiDO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; s=s1jp; t=1777257743; x=1808793743; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=9dNZSXPaU7SwRa36y6sq2F/bVDLBSOQWDoZdmR4n+V4=; b=OsK6yiDO4pSvzgOqwchMp2KW8IhzbXC3hNN3u022vcm/I1453lg+qRkO rZjKedg2Qse1cJqkUgJxmbMxilzyOcrkStGr5GaE+YNQMFNZR3WMwOyb2 Sd6kb3sspzDMjaUz/q4ubvDEZa5eiOs3NPFn+WQcOEBOr5ZGb5byTlaYV qC4Rhl545Qzgme8tXj6h7RvvvHJZ/xp/aFIt8Sit1e1iTIZJau5FQLF3e MXV9v3MnYoj49ytmru/yqTgko2kj8Ko6SGo6J5InOycGpO4i0jUO3wsPl 8ynfE6DUqhzhFncaqA7mogR5pMp70WXtv9KOv9owQiuhKy6f/JDlbkEkQ g==; X-CSE-ConnectionGUID: A2WXXHTNQbqhpj/T5H48rA== X-CSE-MsgGUID: La4tyUiPRo+yGak3meGJFQ== Received: from unknown (HELO jpmta-ob02-os7.noc.sony.co.jp) ([IPv6:2001:cf8:acf:1104::7]) by jpms-ob01-os7.noc.sony.co.jp with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2026 11:42:06 +0900 X-CSE-ConnectionGUID: lBeFfeEhTdCwKS4pXM/ITA== X-CSE-MsgGUID: 4YLeYhxMRa2Yx4TTtDP+/g== X-IronPort-AV: E=Sophos;i="6.23,201,1770562800"; d="scan'208";a="52275261" Received: from unknown (HELO [127.0.1.1]) ([IPv6:2001:cf8:1:573:0:dddd:eb3e:119e]) by jpmta-ob02-os7.noc.sony.co.jp with ESMTP; 27 Apr 2026 11:42:05 +0900 From: Shashank Balaji Date: Mon, 27 Apr 2026 11:41:24 +0900 Subject: [PATCH v4 4/4] docs: driver-api: add mod_name argument to __platform_register_drivers() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260427-acpi_mod_name-v4-4-22b42240c9bf@sony.com> References: <20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com> In-Reply-To: <20260427-acpi_mod_name-v4-0-22b42240c9bf@sony.com> To: Suzuki K Poulose , James Clark , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Richard Cochran , Jonathan Corbet , Shuah Khan , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Mike Leach , Leo Yan , Mike Leach Cc: Rahul Bukte , Shashank Balaji , linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, driver-core@lists.linux.dev, rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, Daniel Palmer , Tim Bird , linux-modules@vger.kernel.org X-Mailer: b4 0.16-dev-3bfbc X-Developer-Signature: v=1; a=openpgp-sha256; l=1165; i=shashank.mahadasyam@sony.com; h=from:subject:message-id; bh=Ntxs4LrM9nMix70BKY/iLLvKQ7C8YsLHb8BjcRBYfF0=; b=owGbwMvMwCU2bX1+URVTXyjjabUkhsx3Z37dP5picffdXU5/nzP2lrWFZ/60ahV/nu7mI7aK/ cZZ928bOkpZGMS4GGTFFFlKlap/7V0RtKTnzGtFmDmsTCBDGLg4BWAiVjKMDJMEdF50TzXKPv9U TVJjv4b/9lrv4CvbMmqLLvH9zhC/8JqRYTLXfx+7IA9NltunV3Jzzgq5qj/X4WDjH9tf3l9O7fU w5AUA X-Developer-Key: i=shashank.mahadasyam@sony.com; a=openpgp; fpr=75227BFABDA852A48CCCEB2196AF6F727A028E55 Sync the function signature of __platform_register_driver() between the cod= e and the doc. Co-developed-by: Rahul Bukte Signed-off-by: Rahul Bukte Signed-off-by: Shashank Balaji --- Documentation/driver-api/driver-model/platform.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/driver-api/driver-model/platform.rst b/Documenta= tion/driver-api/driver-model/platform.rst index cf5ff48d3115..9673470bded2 100644 --- a/Documentation/driver-api/driver-model/platform.rst +++ b/Documentation/driver-api/driver-model/platform.rst @@ -70,7 +70,8 @@ Kernel modules can be composed of several platform driver= s. The platform core provides helpers to register and unregister an array of drivers:: =20 int __platform_register_drivers(struct platform_driver * const *drivers, - unsigned int count, struct module *owner); + unsigned int count, struct module *owner, + const char *mod_name); void platform_unregister_drivers(struct platform_driver * const *drivers, unsigned int count); =20 --=20 2.43.0