From nobody Wed Apr 1 20:46: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 297E440FD8F for ; Wed, 1 Apr 2026 16:56:28 +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=1775062591; cv=none; b=OCvs5yalYtEcNCVKoqO/i54Dh4Q7fAO/usLHqjIQx8w1DirynSkKldi1Tk406SqzxqzkXu7aXCFKp5T3iF8wDEfReeG9m5JMJ8yKBGIlLZP9i/RPkNXZzj6bJYnnuIPU8ti+UeHisI5qnUENVkNNqCiCSjVFLZTlo8v0m+6dzsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775062591; c=relaxed/simple; bh=dZlGgiNJR+pthvIMaRy0AOvoVGUKu3DW6sw/TqMaq0c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d7xrJqmJzzGqKMyNqDD3fncZzmO7WppQVzmN1GKIGFuJxHYuLHcOSq+4cP5VwG9YMAtnID8KjAPlRXfeVgYk3TSFLtloV+yP9Ysh3Xx0pUcvNzwCPPN2lgousSPgmJf92A5qznnTXJy4hSjIEbAkR/C891DcrqziTB6rZNRbmN8= 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=mCsBNaGK; 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="mCsBNaGK" X-KPN-MessageId: 911249d4-2deb-11f1-92a9-005056aba152 Received: from smtp.kpnmail.nl (unknown [10.31.155.37]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id 911249d4-2deb-11f1-92a9-005056aba152; Wed, 01 Apr 2026 18:55:19 +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=hjIQKQc09Ty4ZuPFqA4sflWylIiFqAt4knIEFLnMnCk=; b=mCsBNaGKrcGr9iA2v4Zn4uI3vZW1ONpVRB9wyNNvKdFA1eepmD3eefiVJNIWy788QLhtwitCile2J 1WZuK7YYRQ+lU6wVbK7xCQsJPO7vzmycqOdkqZErrSAP7jNP9vInmmEOnYy/VmAowGpYuhjFwdwfU7 2Nm6sUoNmfkT1om5agN0exqracUeZr0XNvsavnwQ/q9Bi8zK+7ZRrUwMw2SB5sPIMntX9R7rYJLs2Z vY1RYSLcc2cUMAMvvmkgObQkuh2IKKclZwm4bl353oXeyffPv+9ma+9DrLK808JCFTcPTWsfuDvmYo YjavapehGgh5uuqIkOv7F9A83DNCo/Q== X-KPN-MID: 33|Z2mlv25z5aXT/aaAwB0yoliKC8HCdW0/BWmawlFHKblaT6SwIeJZPUjeNl5gyix /bxFr0peMrRsvj38BBMNeG4eQcPsfBoXYsNWvHkyHOtY= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|7xgZbEoVUcxvZHXTz+CJbCJ6J75ncoo9ginBHhZem4cmWMmw7M+QYEIvD57OjUa HuLRXPec9j0JRq5l1Cf1S6w== Received: from daedalus.home (unknown [178.227.141.37]) by smtp.xs4all.nl (Halon) with ESMTPSA id 8e442dd4-2deb-11f1-bdad-005056ab1411; Wed, 01 Apr 2026 18:55:19 +0200 (CEST) From: Jori Koolstra To: Chanwoo Choi , MyungJoo Ham , Kyungmin Park Cc: Jori Koolstra , Greg Kroah-Hartman , linux-pm@vger.kernel.org (open list:DEVICE FREQUENCY EVENT (DEVFREQ-EVENT)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] devfreq: change devfreq_event_class to a const struct Date: Wed, 1 Apr 2026 18:55:18 +0200 Message-ID: <20260401165519.3842485-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. Change devfreq_event_class to be a const struct class and drop the class_create() call. Compile tested. Link: https://lore.kernel.org/all/2023040244-duffel-pushpin-f738@gregkh/ Suggested-by: Greg Kroah-Hartman Signed-off-by: Jori Koolstra --- drivers/devfreq/devfreq-event.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-even= t.c index 179de3cf6d6c..9e183cd8818c 100644 --- a/drivers/devfreq/devfreq-event.c +++ b/drivers/devfreq/devfreq-event.c @@ -17,7 +17,13 @@ #include #include =20 -static struct class *devfreq_event_class; +static struct attribute *devfreq_event_attrs[]; +ATTRIBUTE_GROUPS(devfreq_event); + +static const struct class devfreq_event_class =3D { + .name =3D "devfreq-event", + .dev_groups =3D devfreq_event_groups +}; =20 /* The list of all devfreq event list */ static LIST_HEAD(devfreq_event_list); @@ -321,7 +327,7 @@ struct devfreq_event_dev *devfreq_event_add_edev(struct= device *dev, edev->desc =3D desc; edev->enable_count =3D 0; edev->dev.parent =3D dev; - edev->dev.class =3D devfreq_event_class; + edev->dev.class =3D &devfreq_event_class; edev->dev.release =3D devfreq_event_release_edev; =20 dev_set_name(&edev->dev, "event%d", atomic_inc_return(&event_no)); @@ -461,18 +467,15 @@ static struct attribute *devfreq_event_attrs[] =3D { &dev_attr_enable_count.attr, NULL, }; -ATTRIBUTE_GROUPS(devfreq_event); =20 static int __init devfreq_event_init(void) { - devfreq_event_class =3D class_create("devfreq-event"); - if (IS_ERR(devfreq_event_class)) { - pr_err("%s: couldn't create class\n", __FILE__); - return PTR_ERR(devfreq_event_class); - } + int err; =20 - devfreq_event_class->dev_groups =3D devfreq_event_groups; + err =3D class_register(&devfreq_event_class); + if (err) + pr_err("%s: couldn't create class\n", __FILE__); =20 - return 0; + return err; } subsys_initcall(devfreq_event_init); base-commit: d466c332e106fe666d1e2f5a24d08e308bebbfa1 --=20 2.53.0