From nobody Sat Feb 7 23:12:25 2026 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (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 4D11774424 for ; Fri, 23 Aug 2024 08:15:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724400915; cv=none; b=rt5cEqpPB6O2FNX6bZkla0xEFa3KWCXUE3BxXHuCqNXuAPd9+2dk/UjFHhgCTlD4UcsA/S/VKKPmNozrm6azDNcaqK+XKnqbuPjC5c/3CwLwBDT3boTT0bt9FinfoK9vlygoGC9rM21kxh1PseH+Z1TLAyekAaQutHfO4yKEpdw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724400915; c=relaxed/simple; bh=Nh03TPqbFYsYRBEpl8X2Yih+mFdq5vPg8NDq77DNQWU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pBvAsF9IuuwzDBVwHQg8SuT9va0opDC0HHDAenCjCp8EjWBn23Rgn6GAjAmh7HIJdDGY9kdrk9juyD8gIdIeuYnaynyrzjh3ZGGYcIAW9ICvRpfKyC8SiiubuJ+7JOyvXW6mup4KQ6r9+I1kEVdwULI8H9HHoj+uYDyTCcQl4oA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=jgowvR7P; arc=none smtp.client-ip=95.215.58.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="jgowvR7P" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" 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, u= nsigned int res, unsigned long offset, unsigned long maxsize); #define ecardm_iounmap(__ec, __addr) devm_iounmap(&(__ec)->dev, __addr) =20 -extern struct bus_type ecard_bus_type; +extern const struct bus_type ecard_bus_type; =20 #define ECARD_DEV(_d) container_of((_d), struct expansion_card, dev) =20 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 str= uct device_driver *_drv) return ret; } =20 -struct bus_type ecard_bus_type =3D { +const struct bus_type ecard_bus_type =3D { .name =3D "ecard", .dev_groups =3D ecard_dev_groups, .match =3D ecard_match, --=20 2.41.0