From nobody Wed Apr 1 20:46:05 2026 Received: from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl [195.121.94.168]) (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 8DF75285CBA for ; Wed, 1 Apr 2026 17:00:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.121.94.168 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775062839; cv=none; b=c6c2+cnhB2olQb6shPZtO1LzCHgc/bD5j0JzOApdswklfEoO0jtvd5dzmpsle3Mp78D+Q0CmBIeQI8fhY3+MCS445XCqvm3EI8Wmq7kues4GfyHjihexMtKyBlulgz7e30f0plFb64ElmR1Txrh0YJoeDFsCRVgDxOqIXcCi+fY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775062839; c=relaxed/simple; bh=1ifNmxjZSkaW4eCn48fgO1zCoCTv5Oygj5/3CGsnoUc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Pj5d/UMKT1oIPR9bIcpo2ebOiXC0QzdatT4FlbESCcETqfoStcMKNPYpBJsS8geOftN1fpnyiDfSF8+1jFqXn+Y/D0FTWkIBgzkiMMYl5JQmZ5skYhW+9iBRFA3ii0uGJ36N4Sq9JujKocUsA6xxSXgdoqvv+oPUAt0vHWGdaVs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xs4all.nl; spf=pass smtp.mailfrom=xs4all.nl; dkim=pass (2048-bit key) header.d=xs4all.nl header.i=@xs4all.nl header.b=lS3tTHNR; arc=none smtp.client-ip=195.121.94.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xs4all.nl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xs4all.nl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=xs4all.nl header.i=@xs4all.nl header.b="lS3tTHNR" X-KPN-MessageId: 4d592d09-2dec-11f1-92a9-005056aba152 Received: from smtp.kpnmail.nl (unknown [10.31.155.37]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id 4d592d09-2dec-11f1-92a9-005056aba152; Wed, 01 Apr 2026 19:00:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=xs4all01; h=mime-version:message-id:date:subject:to:from; bh=ywMM6rRfFHPnW7W8VuTvskyqYUYV1k8iGywWjRt4RyE=; b=lS3tTHNRMDZ/0EcyxSmRTRGMOUeILu1D/Hj/6O+n2/EgW3IimsKz8r1ccAVa9mIEXTwf7kIzOSdqv KhFXYlT3wOXBE5uIwMdcZ2KHyMkJOoXinKbcAVtY+KGhqWmqHRIczP1uyzrLtObzQso3X7C2im1HdK YTDDNQnhQpPzQvUoC36n87CqONB37Qy6t8RalS+TUi2934vrY+rr3zt6VJtCAFzxHXHPLNeU6lT6Tc bnwfgq7tRHh4i9DUn0ISPpQsLQlNBFr2dzXZA2grgzfwQJAFpC2eBLIJH01JXGX9zTlVOnsTYlewf6 iC7iQtEWU39k99jfH13MlH08SK4PIoA== X-KPN-MID: 33|3Slv3IbFNCKadnibsndhPRwxPjYyy2/jFiqdKTGMY2tvPxtGFwy0ECp7vSyIq12 a6K3GlTlri2DOJ1bderP6xfGsKQkzSG6Obijsv5jgWkk= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|DAnmyCuwhecvb/wLtSqboJSdUnWqfTqKTfLXVAkeWlD7fz9vL4PmA630Yp4X6uD 8WoC9jQ8xZI5TVyKtOJsG6A== Received: from daedalus.home (unknown [178.227.141.37]) by smtp.xs4all.nl (Halon) with ESMTPSA id 4ab057e4-2dec-11f1-bdad-005056ab1411; Wed, 01 Apr 2026 19:00:35 +0200 (CEST) From: Jori Koolstra To: gregkh@linuxfoundation.org, Parthiban Veerasooran , Christian Gromm Cc: Jori Koolstra , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] most: replace cdev_component->class with a const struct class Date: Wed, 1 Apr 2026 19:00:43 +0200 Message-ID: <20260401170043.3844117-1-jkoolstra@xs4all.nl> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The class_create() call has been deprecated in favor of class_register() as the driver core now allows for a struct class to be in read-only memory. Replace cdev_component->class with a const struct class and drop the class_create() call. Compile tested only. Link: https://lore.kernel.org/all/2023040244-duffel-pushpin-f738@gregkh/ Suggested-by: Greg Kroah-Hartman Signed-off-by: Jori Koolstra --- drivers/most/most_cdev.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/most/most_cdev.c b/drivers/most/most_cdev.c index b31dc824466f..5df508d8d60a 100644 --- a/drivers/most/most_cdev.c +++ b/drivers/most/most_cdev.c @@ -19,11 +19,14 @@ =20 #define CHRDEV_REGION_SIZE 50 =20 +static const struct class most_cdev_class =3D { + .name =3D "most_cdev" +}; + static struct cdev_component { dev_t devno; struct ida minor_id; unsigned int major; - struct class *class; struct most_component cc; } comp; =20 @@ -91,7 +94,7 @@ static void destroy_cdev(struct comp_channel *c) { unsigned long flags; =20 - device_destroy(comp.class, c->devno); + device_destroy(&most_cdev_class, c->devno); cdev_del(&c->cdev); spin_lock_irqsave(&ch_list_lock, flags); list_del(&c->list); @@ -455,7 +458,7 @@ static int comp_probe(struct most_interface *iface, int= channel_id, spin_lock_irqsave(&ch_list_lock, cl_flags); list_add_tail(&c->list, &channel_list); spin_unlock_irqrestore(&ch_list_lock, cl_flags); - c->dev =3D device_create(comp.class, NULL, c->devno, NULL, "%s", name); + c->dev =3D device_create(&most_cdev_class, NULL, c->devno, NULL, "%s", na= me); =20 if (IS_ERR(c->dev)) { retval =3D PTR_ERR(c->dev); @@ -487,13 +490,14 @@ static struct cdev_component comp =3D { }, }; =20 + static int __init most_cdev_init(void) { int err; =20 - comp.class =3D class_create("most_cdev"); - if (IS_ERR(comp.class)) - return PTR_ERR(comp.class); + err =3D class_register(&most_cdev_class); + if (err) + return err; =20 ida_init(&comp.minor_id); =20 @@ -515,7 +519,7 @@ static int __init most_cdev_init(void) unregister_chrdev_region(comp.devno, CHRDEV_REGION_SIZE); dest_ida: ida_destroy(&comp.minor_id); - class_destroy(comp.class); + class_unregister(&most_cdev_class); return err; } =20 @@ -532,7 +536,7 @@ static void __exit most_cdev_exit(void) } unregister_chrdev_region(comp.devno, CHRDEV_REGION_SIZE); ida_destroy(&comp.minor_id); - class_destroy(comp.class); + class_unregister(&most_cdev_class); } =20 module_init(most_cdev_init); base-commit: d466c332e106fe666d1e2f5a24d08e308bebbfa1 --=20 2.53.0