From patchwork Fri Jan 5 10:16:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 185337 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6131114dyb; Fri, 5 Jan 2024 02:18:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiO8oNQ9Nrtv+4+RaDZkn8XMWsBR64PmFDpSLQbOfk0mZ6jnuLdL7lro8EWtjThrzI+J12 X-Received: by 2002:a17:902:daca:b0:1d0:c7f:8eed with SMTP id q10-20020a170902daca00b001d00c7f8eedmr2109185plx.58.1704449886536; Fri, 05 Jan 2024 02:18:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704449886; cv=none; d=google.com; s=arc-20160816; b=bLzgMUN+40pWHdiWlKwqxgmjufW8X4BxoFW44vGuIVAfyqfI4bPSa5YgA+jHFxOq5u xxRRTge8zSKIpenSKX6eCjEE9SxXULLhxIVim9uZ7/yWjUHVziP0fConOK7QhRebTQ/8 RMnpZ1ifvXziT/W7bUdWw/S3bBoy7xu3hjgdVyvvw2oeGTacztwdfWQrPATg6cVo7Qcd +kZha/6MzPgas8VGOY4AjShRoHLaEC6QZkAZPbRTFRG81q+XmAN2c/l1Nza560/PzlPb nCtD96HdQYjj6+5NgR7hju8hq6cseKAR08/NwqXpQeLE37FzuQ29DRBYwSQ34cirunea Cysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:lines:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=5EontYdZHGl1gG35c8LGpncMKFxJ9LwV2I+spvFn1KE=; fh=uaAup8lEM8HixDh6EcJZdhgsnWJdMDcdpoY8NlDtYIc=; b=hnubuXHRdSiUGksqxZwi38MP8Q0V6mUC/gMRBNNxDyJ29He9XSLrJbiC1H9QLq3lR8 AZEo9jQJ7/4gRIJwx1NWUG7qvyha/5rADEzVMYyt6pXPkQSxs/cMKVLzAm4o8GUfLCIz 21lSoGJCt4lkO0tYTLAKghZXOTEIWGCw2huPed4GGhSclo121XtUiahHADryc+jNyJSk l3x+BjHMveIpgEH0EV+bQkZBfb8JyVxsNBSrm7qWaAKUufWHQNzPX8ZWfwmgQdbWSVNj jvUDIswlNWOI22da7pr/gKtRb+kGapX1Az8sb6tfX+45sDGbsNMo7PP0QsvznNPuzup8 LFWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qB194l4N; spf=pass (google.com: domain of linux-kernel+bounces-17730-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17730-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h24-20020a170902ac9800b001d410fba3f5si961257plr.448.2024.01.05.02.18.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 02:18:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17730-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qB194l4N; spf=pass (google.com: domain of linux-kernel+bounces-17730-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17730-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 58E35B247C6 for ; Fri, 5 Jan 2024 10:17:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDF472D60D; Fri, 5 Jan 2024 10:16:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qB194l4N" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2E0082CCB8 for ; Fri, 5 Jan 2024 10:16:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EE13C433C7; Fri, 5 Jan 2024 10:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1704449785; bh=wVz/wYYysRMvYjHcfqRSF/XdEwbeiY/IQOOSisoeE6Q=; h=From:To:Cc:Subject:Date:From; b=qB194l4NAu6JMrdnRQKjdZsb5/G+864DaGMBZOUAjETqng9gWgFFrbM796frZEKGE R3A05PU4zEgapTdDDqnaTJxR6MnFOnRi4uTt7M8DOeFikIBTQZ05fT8D5ZyYNkw4TS eq0NVna+Mr44wzibv8v9MuM3Gjo4In/uukDKLjg8= From: Greg Kroah-Hartman To: greybus-dev@lists.linaro.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Johan Hovold , Alex Elder Subject: [PATCH] greybus: make greybus_bus_type const Date: Fri, 5 Jan 2024 11:16:17 +0100 Message-ID: <2024010517-handgun-scoreless-05e7@gregkh> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Lines: 41 X-Developer-Signature: v=1; a=openpgp-sha256; l=1420; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=wVz/wYYysRMvYjHcfqRSF/XdEwbeiY/IQOOSisoeE6Q=; b=owGbwMvMwCRo6H6F97bub03G02pJDKnTr33Mnmz5Oehhg8V9+UNzi1R/L5Bp+Hpa8uGTgtNP5 nI5JH1a0RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQAT4dvOMD/KwWfe32dXs7S/ LGE9zvSP3/2LZRjDgpN+NwSPmyeuCD/YweS7OrZHW0tWFAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787245243947777823 X-GMAIL-MSGID: 1787245243947777823 Now that the driver core can properly handle constant struct bus_type, move the greybus_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Johan Hovold Cc: Alex Elder Cc: greybus-dev@lists.linaro.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Johan Hovold --- drivers/greybus/core.c | 2 +- include/linux/greybus.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/greybus/core.c b/drivers/greybus/core.c index 5714be740470..b0aadc1e7bbe 100644 --- a/drivers/greybus/core.c +++ b/drivers/greybus/core.c @@ -155,7 +155,7 @@ static void greybus_shutdown(struct device *dev) } } -struct bus_type greybus_bus_type = { +const struct bus_type greybus_bus_type = { .name = "greybus", .match = greybus_match_device, .uevent = greybus_uevent, diff --git a/include/linux/greybus.h b/include/linux/greybus.h index 18c0fb958b74..92da9ec4f5f0 100644 --- a/include/linux/greybus.h +++ b/include/linux/greybus.h @@ -104,7 +104,7 @@ void gb_debugfs_init(void); void gb_debugfs_cleanup(void); struct dentry *gb_debugfs_get(void); -extern struct bus_type greybus_bus_type; +extern const struct bus_type greybus_bus_type; extern struct device_type greybus_hd_type; extern struct device_type greybus_module_type;