From patchwork Fri Aug 23 08:14:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunwu Chan X-Patchwork-Id: 13774764 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 384F8C52D7C for ; Fri, 23 Aug 2024 08:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=gNkEcx0ZY4Xc5R2zIwTHsYHGGBpssYeCMYyP4MX7JfI=; b=khTuBRaOi2sNsLrJv3p6rHiWfw 1D2W8IPXnE/a6gebo4/LkikXgbRadGRcX/I7agnvtsnvz4kusYpnjz192fZhlx16JkcFs35MF4SVK gKtfEEQ0o+SMYQ7SLFRRJ+ezGOE/bvrYecoIUAtEyejm4Qu0k+YH887QEhslaSYUJD8phtvowpsnU QGLj4f5S1enL7hjcZncXlEmHkRybD+L65FZ8W2AUTXN2PfzcfHGEY27YVs3cLrJiaHqfKKvng1/xD xyTOp9o57eoyUuc9c8sWZ/4vJcelU5ff91bg3KADjHEVFrzW9qJCZc9ktFT3VyXP5PlbZLG51+phx N9jSQL6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shPe6-0000000Frxk-3Gsn; Fri, 23 Aug 2024 08:27:47 +0000 Received: from out-185.mta1.migadu.com ([2001:41d0:203:375::b9]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shPRw-0000000Fp2B-1kqM for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2024 08:15:14 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1724400908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=gNkEcx0ZY4Xc5R2zIwTHsYHGGBpssYeCMYyP4MX7JfI=; b=jgowvR7PjfcdtLG6qDjXeusG/K6Nu3tHQHPP0H0wDDojCPMbxoOjBIeUGbpjzePMrn1MC+ fgBOdPVCDlHzkslsAJItF/Xu6/FMFSAIh2ZDGo+sZD1QSjcGXQ989wlTbsKyLkyJc1CRXB 1iqlkF/Eg5vTF+DSqdPIp1EPvi+fCTQ= From: Kunwu Chan To: linux@armlinux.org.uk Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kunwu Chan , Greg Kroah-Hartman Subject: [PATCH] ARM: riscpc: make ecard_bus_type constant Date: Fri, 23 Aug 2024 16:14:44 +0800 Message-ID: <20240823081444.150976-1-kunwu.chan@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_011512_646785_82C5F66E X-CRM114-Status: GOOD ( 11.52 ) 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 From: Kunwu Chan Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the ecard_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: Kunwu Chan --- arch/arm/include/asm/ecard.h | 2 +- arch/arm/mach-rpc/ecard.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/ecard.h b/arch/arm/include/asm/ecard.h index 4befe8d2ae19..7cbe001bf9cc 100644 --- a/arch/arm/include/asm/ecard.h +++ b/arch/arm/include/asm/ecard.h @@ -195,7 +195,7 @@ void __iomem *ecardm_iomap(struct expansion_card *ec, unsigned int res, unsigned long offset, unsigned long maxsize); #define ecardm_iounmap(__ec, __addr) devm_iounmap(&(__ec)->dev, __addr) -extern struct bus_type ecard_bus_type; +extern const struct bus_type ecard_bus_type; #define ECARD_DEV(_d) container_of((_d), struct expansion_card, dev) diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c index 9f7454b8efa7..2cde4c83b7f9 100644 --- a/arch/arm/mach-rpc/ecard.c +++ b/arch/arm/mach-rpc/ecard.c @@ -1124,7 +1124,7 @@ static int ecard_match(struct device *_dev, const struct device_driver *_drv) return ret; } -struct bus_type ecard_bus_type = { +const struct bus_type ecard_bus_type = { .name = "ecard", .dev_groups = ecard_dev_groups, .match = ecard_match,