From nobody Thu Apr 9 17:59:25 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 94B4E319859 for ; Tue, 3 Mar 2026 18:17:17 +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=1772561840; cv=none; b=U0tbBbcLh0zFWIz+WVwNvTZMAYJzpIiVF0DVoaK64GF4i+lFNEE15JZOnbObl6xSQgSFYjiBEgS6t//Qk8slyxC+6n3owxnpvgOT6i+o9pu0Wc93peABsr6FGalmr2od43Nj5gcaZSN3aplHwbhJab1LmtlY7B2lXCObWWzjR0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772561840; c=relaxed/simple; bh=1ifNmxjZSkaW4eCn48fgO1zCoCTv5Oygj5/3CGsnoUc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nwsDfvHEz9Eqfa26yTWRfQDfo+oQoVR8fkpibepA0InBZwoO2mxGUVEOJ94veqsGz/i3JgUaOglDTNSluabw2aVtflWgzrYLfunwkpjHz6VGOwLRlub3zP+HhXKyH9zMfMjEEzMERUvWQfkraAC8zs1b6UVKH0iiZKPs/+ALwzs= 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=Grl85E/+; 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="Grl85E/+" X-KPN-MessageId: 314f4be9-172d-11f1-92a4-005056aba152 Received: from smtp.kpnmail.nl (unknown [10.31.155.37]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id 314f4be9-172d-11f1-92a4-005056aba152; Tue, 03 Mar 2026 19:17:09 +0100 (CET) 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=Grl85E/+ozxdG6prIVDZIc/yf2FTuTmbl1qazX9MsO3fEEmucFu630CetrsOMbzxx8ir+EOBSYGBB rZ2og6NhynEuxdY4Mqv3y1Zob03Bv2ZHmEuBx/HXJPMfC2/QnKiRUHj7Pjqghj0Z/UK9ydW+syuQlP R2Wh7wRPHwEHoZet8mF9hozssfWTyo0PjZLYrS1zI7rLJ06sO0tgK/BQGNxxosmgd/5zZFQX0UPdaa rhy52sbZ4yP+2YByhgOcVR5yuKzpwQEh+U9odzeATXvnTcDZpW4e3VDZ5LFDSEe0425mbvePWVHa09 8iZa+fQsdKicfq4zaGOVtnFY+eYkBWA== X-KPN-MID: 33|Uvo/VbBCoSs2eY2NCWIsgr5KQls3js1eJ9W9YycoXKyMVvH+MzbAtQyg+8549zk oDxVSjfvw3vB71edgVc6l8tB604SyTzVDnSFMjZSMRK0= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|epgGry7787ZvF7d7Obp1vvN+H/3N4jriBdXF8v6KWew9CdQiQXYVEujBt+ZxCL/ ihT77ZCGG/g2FWsDXPv38Qw== Received: from daedalus.home (unknown [178.231.15.71]) by smtp.xs4all.nl (Halon) with ESMTPSA id 2e5d6723-172d-11f1-bdab-005056ab1411; Tue, 03 Mar 2026 19:17:09 +0100 (CET) From: Jori Koolstra To: Parthiban Veerasooran , Christian Gromm Cc: Jori Koolstra , Greg Kroah-Hartman , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] most: replace cdev_component->class with a const struct class Date: Tue, 3 Mar 2026 19:17:19 +0100 Message-ID: <20260303181719.3801257-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