From patchwork Sun Feb 11 15:51:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 13552512 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18714C4829B for ; Sun, 11 Feb 2024 15:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cRB4na7pZNYvnQTsS4p61izd8QKTfDTOnLVCvzOBAUM=; b=BKZS6stCFGF6cX EeKVN93pH2LRkC1WxUMOcgcYvoqxr0egiUqi1AbSUUFSK/nx11Dm6twCUqeklRM3mjAeLgLhLgqE2 zKbitPxH9DQ7JZ//0rY+QNIyF/cwBhafT+tsQpuPnX9qACKfPfh6NMdG8915y/m4+YXzs0e2lLUy8 xNrF7lklHaWnzjARMWwyHxQc2yBVwtmsuA+oOeSZJ/lh0NFHf+33Cx9R3cG+jjeGDrCVZ/VkqA657 i8wcstXuUUacbOCqpw2i90I7rPIgsWnB2Bvt5NN8PnAGxnlqBfWjFvvDoqhuLLIUq9vIyUQ92S0R4 qM53FPE+FVrPJornmPbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZC6k-00000002xTb-2ZCI; Sun, 11 Feb 2024 15:51:06 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZC6g-00000002xSV-1sDT for linux-arm-kernel@lists.infradead.org; Sun, 11 Feb 2024 15:51:03 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1d72f71f222so19673505ad.1 for ; Sun, 11 Feb 2024 07:51:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707666661; x=1708271461; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=A4Gcc4Xndyg3QpASX0JMqOkflhcAzBHLuuTQVBUmj7Q=; b=nBXDA37pxhQuO8dS7NKOboh/Qr1CCuytz2QjpAaPJ/ft1C/ZNDBDJV19vsWrso+Kwb GTbMJadT6hDcY0MeOPggQuUjWoGuYFQZPkAEi19VL1HBQDj+9VwfqYl+l4pCwQKDyYfk sHTa72Ork/io7PA5E0gBvr4+96K7Z4r9r7o8/hL9vuayKhxupNku4z/HN78YFX4CC8qP JudSaZ4o82JULfJ2RotnmKwA9ung3BpuMV5RsZk2rkGWbPZ2iPUq1Ap6P+CQtgORNN3l G8AbcwAqMi1Aftorhj40Yuo0k6JcpFAlcXNV0gDjwUnVg2TqqOTehdBA79z2uttMfM9W eIBA== X-Gm-Message-State: AOJu0Yx7q0qVA7vdbZe+jI9rOJqvGwJJAe4o0No0e136VYozhIVo8bbf rbrfxm2pcPQc/t8V1nQOoUir3YS+J1Km0qtR/7uKUAVN9NL8KV4F X-Google-Smtp-Source: AGHT+IEI9lq5dA34AHVeb+iMvot4hcH028ChbaSpEGEcOLvfUGDPB6GCO3nb5D9yA+LKpZmHPWjYvg== X-Received: by 2002:a17:902:f68e:b0:1d9:859f:b505 with SMTP id l14-20020a170902f68e00b001d9859fb505mr4436425plg.21.1707666661324; Sun, 11 Feb 2024 07:51:01 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWv1bTfqA5q8d4YOoEhJXKCFE/XCtNFUDccZIs6B+JlL8NgGMXSedkp/N36JzOI/IvTi1kYy0OpSqphpHpcHdsAgoLaz2jY7NAu1Lo7A9Ysl5Dd6uPtgjOTgyi3slv81xhtb5Ug1xtnm3J4ET2UlwOqgIu72B6Cprb3kKv3IhshdQ0j Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id p4-20020a170902eac400b001d9630e3396sm4457627pld.193.2024.02.11.07.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 07:51:00 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707666659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A4Gcc4Xndyg3QpASX0JMqOkflhcAzBHLuuTQVBUmj7Q=; b=JwaG85w2MwtkXsefAeGkqQVomcKeKVGed2aK+7hzc7QWU8PQtj/Pmp3V17wFLZxt8o9bZr erqils/vfcN6kbUTxjdr12CpiZHFO3HNo5Xq2mhW3tcL2wi9KeauwhPD0RKDGJQzErzboA Iq6UHEq5JrNAXaB0e4oqrsq2m5G0aH0NDQsbypzA0liTl5JMY4jXYExZMHj1kYPaDtTeO2 en9znPsj4CTOZBZW2IofsyGwyxP+H+Cf4zCGJ8VM7+W+XXd5MlxstVhxDrYPUcu3AHjUqK ieWtdrdNwbNbHou5HMQJu2vhJ1j/wDTl95z5m3Fi743Ts/pQCzTVD+SsONsL4g== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sun, 11 Feb 2024 12:51:30 -0300 Subject: [PATCH 2/2] firmware: arm_scmi: make scmi_bus_type const MIME-Version: 1.0 Message-Id: <20240211-bus_cleanup-firmware2-v1-2-1851c92c7be7@marliere.net> References: <20240211-bus_cleanup-firmware2-v1-0-1851c92c7be7@marliere.net> In-Reply-To: <20240211-bus_cleanup-firmware2-v1-0-1851c92c7be7@marliere.net> To: Sudeep Holla , Cristian Marussi Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=1600; i=ricardo@marliere.net; h=from:subject:message-id; bh=2DXxJu+KPQUi1akz0xAbwCY6WPF6YuYAvQw6ywMU71k=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlyO0CNpjVnQm1f4mTaBU/yng6HbD1pirl70Kw+ 1tn3hP+mbaJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcjtAgAKCRDJC4p8Y4ZY ppioD/93LqVA4qwg6m2/98RBhSmHxrXXzvXmKkMdJHAOgvt1uTubajTkqHdxRXNBCwOuaSkvHNY hHsmHSAwVz0NRbUc0tabRMFntHZrd3hqD3iV6NtbivHn8NqS98Mh6FKBqSbr6XXMzU2fRu3Q1j8 P/DL9d1xN6e7ejbei+8q8NkOfOrIV2Yq+7J47IjEEUNPPs7Z766RdWH8KO0nHe8O3zY6zUKpeqM 4qGXOw71sCQX9AAixnu2MWirQSf0873ddN8Msq+o+WzecXanCwGBvvR/cFDQqxVqL87L2ndwwUk R1DtDVa6dlS6raZvquBUMt3wObX+hP+UiKLrCgIj8CxcLxCmcZ6Sd06jhfCQP21uwQhOqgL9yk4 VezjtVrSeSX3q+qHQp89Bk0lvKkjC6lkE9qVnRELEzKvkD73raS0OL4KqvklL7i7hyZOkYdzeev jAdP5h54FnRcUTnfwnBJczyzomhBI8Sb+R3xzzjnAUsN8w4p1R+k7jRDopGe+AED9VMH3YljP1V cFpARItZ8mA5Jlt8wGNjofRoSthRSCpxdpHpn50qq1Qre1FFln8xvFZ/fAHm/3mWfrk6yn+HY+S wD083Syz/MbXHKFZRyo7huiKrPaQRFvxEooWvV7PYJ2f6h5j0RheVwl5tTSREV28+ChuBEgfNiS JHijGvapEGABAHw== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240211_075102_525572_ED5810E1 X-CRM114-Status: GOOD ( 13.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that the driver core can properly handle constant struct bus_type, move the scmi_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Cristian Marussi --- drivers/firmware/arm_scmi/bus.c | 2 +- drivers/firmware/arm_scmi/common.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index c15928b8c5cc..609a6496c1d4 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -263,7 +263,7 @@ static void scmi_dev_remove(struct device *dev) scmi_drv->remove(scmi_dev); } -struct bus_type scmi_bus_type = { +const struct bus_type scmi_bus_type = { .name = "scmi_protocol", .match = scmi_dev_match, .probe = scmi_dev_probe, diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 00b165d1f502..6affbfdd1dec 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -141,7 +141,7 @@ scmi_revision_area_get(const struct scmi_protocol_handle *ph); void scmi_setup_protocol_implemented(const struct scmi_protocol_handle *ph, u8 *prot_imp); -extern struct bus_type scmi_bus_type; +extern const struct bus_type scmi_bus_type; #define SCMI_BUS_NOTIFY_DEVICE_REQUEST 0 #define SCMI_BUS_NOTIFY_DEVICE_UNREQUEST 1