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 Kroah-Hartman X-Patchwork-Id: 13498845 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 70140C41535 for ; Tue, 19 Dec 2023 18:33:44 +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:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=QEC3Up286RvlJCXAe87dprHmTrDsIhRHsM/oxvjX2NQ=; b=eU0bqHTzTgkx5O Wvnyoggki+20NwTCFLN/vhBeUVowICinEi64hUx/Kk5WLaCNnIBg89b7n761sjXDxuzMcDa8e9rBO mIVPlAU3OgciWbThYFfC5yRKaxkwdzzvjo+FuhLSECQDnu/GK8IXZ+w0Qo0ghfJXBE8EUXY3tLUKA IGxwEEysAflAxEJsLiCwWfxrbyKCmFeJ/FT7oCxZMhAvJYIaMLUx3+7k4m4VmOwyXNbzz0nGBTy0G QZAtCw0bLJdwuggPJBLApArw4/TOVqLQB87D8LcS373TdXT857fasZvN1yLv6/Wvoee+nEBs48Mv/ mWmnQsXQoobWhyEeenIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFeu4-00FD3J-1i; Tue, 19 Dec 2023 18:33:16 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFeu0-00FD2R-2m for linux-arm-kernel@lists.infradead.org; Tue, 19 Dec 2023 18:33:14 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 99AB76142F; 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 MIME-Version: 1.0 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_103312_963898_426203F5 X-CRM114-Status: GOOD ( 16.69 ) 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 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