From patchwork Tue Dec 19 18:33:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181209 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2143170dyi; Tue, 19 Dec 2023 10:33:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBrSARvfd7NilsAuYAjgJe1au3DUAz//dYbgRRYddQzeh1y+x19AfW+GATb2l9YaHoiEna X-Received: by 2002:a05:620a:144a:b0:77f:37c4:2143 with SMTP id i10-20020a05620a144a00b0077f37c42143mr20697628qkl.48.1703010805439; Tue, 19 Dec 2023 10:33:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703010805; cv=none; d=google.com; s=arc-20160816; b=WT84U9FRDeAoRsfCzYRA80I/g9f7O/H1jtN+SdvjGAI2TCzzbsnPUXuJpUvmSzBDk3 Npn4UQoZ1OMOsqsB+g/XhrjbxzMsQdZEkQO7C0PqYivBCyYRoRPgL5Usbom5dhU6M0Gf SNiuxAr4P1xNnCBfkujgcSj6WtqgMyUygRcbFHmC2m/n5A5imwIyaYYGwm+H8q6VlV0X ot9qBDV57g+0MoTKrvlCTTP4eypoZlUL8L8FvdOuw1QWyk6U7qjbyh2n+l34ksqgocZx MZo0iw3qmTcYAemNVOPnlgH6lBr37TATCt68LEuDYqvzJWvpMN2u/bKOeVQz+LMvoJsF Y0ig== 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=eO+GM2wNHvLHci9JUTAtyKRZrrEHQbETJbXaHRaFJhw=; fh=FD7lS13psYmkm7sMV/ZwNjTlHdOpBtSuPFSgSugK+MY=; b=HNVbduTF4sQskggse7tK81/zZrqMkRmDrwgnYtm1Leh8hxDPLBdeklJ8pyD+tDW06K uPG58qmb9qeDF/wx7wXitZcAUVMvGlZUSbg1AeHBuvizRvOyx9YjSSfiXZTw30ogmPTm 3zdzwutpFhUoBcguebzYEuJHl2Mwl8fcr+t+hOHiE6eHQndpW8tmb6yo3g9zDqOF0jda h//Iq2eMStjozaINyDupc65BSb7ca+OVisd5Pce14boykJFUbgRAIUFLNVeClhkBfq2S c4liCq5TBBmIMYmewZYD5rM39T7X0+OJi0Bxnk2qePPn5K0g65M82uiIbG64fbX/SKme g0mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="LAyy/qXR"; spf=pass (google.com: domain of linux-kernel+bounces-5814-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5814-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z12-20020ac87f8c000000b00423f3ce69a4si134830qtj.153.2023.12.19.10.33.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 10:33:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5814-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="LAyy/qXR"; spf=pass (google.com: domain of linux-kernel+bounces-5814-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5814-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3D1651C24B23 for ; Tue, 19 Dec 2023 18:33:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 657C239879; Tue, 19 Dec 2023 18:33:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="LAyy/qXR" 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 94A4439844 for ; Tue, 19 Dec 2023 18:33:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8D4AC433C8; Tue, 19 Dec 2023 18:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1703010791; bh=U9Chc4nw4v5xsa925ipJYoSw+cB0DtWMJa5KKZOXWkE=; h=From:To:Cc:Subject:Date:From; b=LAyy/qXRYJGzjKTcGPohJxDxilcCrJgtUHcmiRz+dL8aWhjaqjsxiiKJTJ4gpM4iP rlJVvY/a+ZEdlQ7vIPK5YGyUTn/O+jn6QmR0mMhc7ORsSAx8JbHNcwd8wxYs5snE9g Zp7Oyd/uc/tYfDHRjkmeCkLRSEFb8X5HSBYCrOaA= From: Greg Kroah-Hartman To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Russell King , Arnd Bergmann , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Randy Dunlap Subject: [PATCH] [ARM] locomo: make locomo_bus_type constant and static Date: Tue, 19 Dec 2023 19:33:06 +0100 Message-ID: <2023121905-idiom-opossum-1ba3@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: 55 X-Developer-Signature: v=1; a=openpgp-sha256; l=1910; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=U9Chc4nw4v5xsa925ipJYoSw+cB0DtWMJa5KKZOXWkE=; b=owGbwMvMwCRo6H6F97bub03G02pJDKmNDx8W7SkpEpwYqLd0VkJpWEXaZXauoFjmVxpnZS9HL bvY6dfVEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABMpVGJYMF/YJ1aev/m9TeZC q5OvXtzM/d6jz7Cgr9g4gfd/VOa0LSxOGgI1cX+it04HAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785736258215571467 X-GMAIL-MSGID: 1785736258215571467 Now that the driver core can properly handle constant struct bus_type, move the locomo_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. It's also never used outside of arch/arm/common/locomo.c so make it static and don't export it as no one is using it. Cc: Russell King Cc: Arnd Bergmann Cc: "Uwe Kleine-König" Cc: Randy Dunlap Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Arnd Bergmann Acked-by: Uwe Kleine-König --- arch/arm/common/locomo.c | 4 +++- arch/arm/include/asm/hardware/locomo.h | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 70480dd9e96d..6d0c9f7268ba 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -68,6 +68,8 @@ struct locomo { #endif }; +static const struct bus_type locomo_bus_type; + struct locomo_dev_info { unsigned long offset; unsigned long length; @@ -842,7 +844,7 @@ static void locomo_bus_remove(struct device *dev) drv->remove(ldev); } -struct bus_type locomo_bus_type = { +static const struct bus_type locomo_bus_type = { .name = "locomo-bus", .match = locomo_match, .probe = locomo_bus_probe, diff --git a/arch/arm/include/asm/hardware/locomo.h b/arch/arm/include/asm/hardware/locomo.h index aaaedafef7cc..9fd9ad5d9202 100644 --- a/arch/arm/include/asm/hardware/locomo.h +++ b/arch/arm/include/asm/hardware/locomo.h @@ -158,8 +158,6 @@ #define LOCOMO_LPT_TOH(TOH) ((TOH & 0x7) << 4) #define LOCOMO_LPT_TOL(TOL) ((TOL & 0x7)) -extern struct bus_type locomo_bus_type; - #define LOCOMO_DEVID_KEYBOARD 0 #define LOCOMO_DEVID_FRONTLIGHT 1 #define LOCOMO_DEVID_BACKLIGHT 2