From patchwork Thu Feb 8 19:37:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 199234 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1350062dyd; Sat, 10 Feb 2024 00:01:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjIQ+m0O3Qvmc7F2y8G0fKFN7gTrEN2Txw+dcP3UVbnJZ8ZwEg1xpnF8TVeDi0PVg2z7P8 X-Received: by 2002:a17:906:853:b0:a3c:3612:c2c6 with SMTP id f19-20020a170906085300b00a3c3612c2c6mr445772ejd.8.1707552085503; Sat, 10 Feb 2024 00:01:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707552085; cv=pass; d=google.com; s=arc-20160816; b=eoL/gyq93A5Si6nqwLNzstz3Pm+2QvqK6xXn1Bc8ESox7A7VQZgbz2pZP8x1g5PQam s5EKX81qy3emTTOFWTWpPVMU6Ihvg6K7ZoimaYtYaHjieQTk4Ez/rKSrJGNM/j114XCZ /alsYqGkDCi/KxLpABGkSsVItruBcthj9UDmtTV7iKIxD/QCRER78BXOzcEGwhfODCpD 4R+KUpFqSVIJLcWOtZEHizI1Ot+/OLhbDX+OB6BjZ4WVlqOivT2aJHJ2bMpgpZ+VTe10 tTtrkGmstHQ3Fa++/wDFD89Ro2bNZp7NldHloONc+k7s0evSKIN6dvoCYE7jKgr1zAOz H+pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :dkim-signature:from; bh=fkyOtDTT6XXbEX+vLQ2wDNuDNguLiW47jjofDmGnI7M=; fh=kXk/n6ZBkVIMeOPKmIhDfR0oO78X5TvMXpX+EX5Kms8=; b=Of3QfmdDi7WYcD4Hi0MOh5x0pFol3bk+za2a0cnxXbCV14q9rZd2vD/4JDGradY4AX zitY9XgBajAffahSdToIDbo9jgT7exDwQsPhvxkvoZMGm2rnSP2mAcy4x9JnmX5tw5w9 YRIQvos7ywibrEt3mWu7seZNX4Pum5wU1vbbyUWkpX1Y+z63J3Gzk2BzlSAH6uMQ8ltG Pq+kS70hwh6zEGzAZYAWw8SCAEXOFyFSTCkLJF4YB5d5sHRI0Csos3F03xnU2vF35tdY rLejeL86tokZEVFSCWN0LCyCiMCwQZJzLyImCj4YFbqzal6OV3o3gxzUOxHWtW6STKOx oMew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=Eq3JHS1z; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-58630-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58630-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCUIyOAnKYnQ5bzf/k47RnDxxcaRnEHF+sPSOJ3KgyCXEcOSqK/zEh/c3CFCxSYgxl63PyZp5Blkswxox2K6ORfAhf8Opg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o26-20020a17090611da00b00a3828d12fdbsi1638046eja.821.2024.02.10.00.01.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 00:01:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58630-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=Eq3JHS1z; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-58630-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58630-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 117771F2C63B for ; Thu, 8 Feb 2024 19:37:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66B0B381DE; Thu, 8 Feb 2024 19:36:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="Eq3JHS1z" Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 298C23612A; Thu, 8 Feb 2024 19:36:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707421010; cv=none; b=uKRQns67IXHGXRjkFAlQr/ZJOMOVdYrGtnw4j9weWbHo5Mj6uExoAUphwhk9c//Oh3zBJsRzCQhOuJ7zpMYuAlnF0SlDvvVS+CZBKOvoqjxZghnWyGrLiQW1sJYQMPHX+xI75DfSXEXWIPMXbZUf9B+PMrQzuaJedeVDNiVBMgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707421010; c=relaxed/simple; bh=P00MN7TEHNS0sno2RE3JL79uy5/oil+paWe4tOWUUGc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=VSE4eTXzbLEO7NTU+gTvo3rA4oM7ui+9wVnW/axx/Sa3UPCUnikSWe0DFzMspuM6RauCrBshn9tyO+HmcTC3xNdSxpCCO97v9+0nT+yN73RFbItdh8z4VvS5msAHBbJf31E9Os+aZDSea4htGxGCcITP+oSZ4QkdXrjKEnmlGvE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b=Eq3JHS1z; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-296e22229b6so158579a91.1; Thu, 08 Feb 2024 11:36:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707421008; x=1708025808; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:dkim-signature:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fkyOtDTT6XXbEX+vLQ2wDNuDNguLiW47jjofDmGnI7M=; b=MSAunoMnvIxj4xSaEXTb5xTRtBgW3sExVpZri2h2p2wMbLEBeaqVBALVkfH1lEWYrv lh5nky3P2Tp1HPSZHqi6SGLlwGIhfv51pErWZc6rtoeupf1yaxQ+xWmmacFwGedAdFDY lcINydLfXtpNePNlm834irvFC+0F1WJG/7XXlRusuu1o0o1RlPEpJu2VnWitWXBfHq8w YmMFk/9eQ5J6g1OM/ngyWGJWfN4aG2Z17aR5MmHB9trLl7a/Eua+qgShuck1fqlG4sFn 0fmBPtJrc2wphy+Ed8wq8ETKuNH877x0nL/q5PVms51LUo8CE6si7rgiApDJKj8Zl8Bc 73Lg== X-Gm-Message-State: AOJu0Yx/AND8B1FTfD6xAnQsbFMtK3jpviJeQ0lIWlO5xfH+hdHbrtta n9y9l54XQSfXhqjlvT8jTnRo4JKo23PrsEZSqCW2AgaDnMkdxAUa X-Received: by 2002:a17:90a:3ee5:b0:297:414:73f2 with SMTP id k92-20020a17090a3ee500b00297041473f2mr284069pjc.11.1707421008331; Thu, 08 Feb 2024 11:36:48 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXm5c0rvT5dBIBj/cRxofCBIWjOpFIWs0K1HqJJsW8J2zRBJPUwraPqv/0vA/0HpkrRfPupqdOpA0oqcIztAdA/xr/YynnvZZSjot7h5Xg86GTB8b98tA9Qq31DkJ7Z8Bsvh1j6iV9429HV9N+q+BmIN7v3CnpsoqXA Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id az11-20020a17090b028b00b00296b2f99946sm153020pjb.30.2024.02.08.11.36.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 11:36:47 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707421005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fkyOtDTT6XXbEX+vLQ2wDNuDNguLiW47jjofDmGnI7M=; b=Eq3JHS1zKYfQSfsJvC7H3YF7nwfVpjBxrus6JLBjnBI7Db9G0XChQJUX97Pt6aomnKluZz 2KgSYLFf3n7UYPmgn+15mRCXsc4w47IsYgoNfkrMF7XM09FmtnZTQH8FllFOClB6/noBpn RCwlkTiCi6C1P5gCNbpGbKZ2GMTmKH8omYANzWYkadnt7wrpps784p8wOBW/F8TPeRtPFD dMOsHoXLAfEBDM9PULFcgnYYyA/3kJKeSROPlQVme2lMrwtdsPxDOIf7Ea4HFC39UDHiHG c1pVHK+6ujFelxEBSE9p9Aq7pdknn2qe9AtwIW1n/u9xbzQ4KOEMIwqmaj5Njw== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Thu, 08 Feb 2024 16:37:19 -0300 Subject: [PATCH] iio: core: make iio_bus_type const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240208-bus_cleanup-iio-v1-1-4a167c3b5fb3@marliere.net> X-B4-Tracking: v=1; b=H4sIAG4txWUC/x3MTQqAIBBA4avErBN0Mvq5SkSkTTUQJkoRSHdPW n6L9xJECkwR+iJBoJsjny5DlQXYfXYbCV6yASVqibIV5oqTPWh2lxfMp1BUN0oTVsZ0kCsfaOX nPw7j+37mZhdEYQAAAA== To: Jonathan Cameron , Lars-Peter Clausen Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=1667; i=ricardo@marliere.net; h=from:subject:message-id; bh=P00MN7TEHNS0sno2RE3JL79uy5/oil+paWe4tOWUUGc=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlxS1vlXH9tddueq0J7shZnHZd1dmF8z9YK5VOR xPH+qOYkkiJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcUtbwAKCRDJC4p8Y4ZY pnrwD/9vEKOXummVQLcUj3Z4smz8/wI0u97x528XWcu1P4g02ceVg70R3Audv/4zJIPjtH0I5zQ /jWPREIq7bjqWBPJU2tjMlE3xS4BQKIiAmlhFMYCvqczBWFORqSSX5tpLMtABlKz+FQpmnS+9qp teLOghrIoPjKkaJkDXv1+QpCw4izdGPHeX87t37CFOZ2wD+sBx+EqYNP/xEOoej0nU3OLC8cF+q qb9IYx2roXua0UDO0uZMNjNubKGu6yO0EiGcXKDjZ7fm0nj03TTl0XAaHvACFMUBWz2eR2c6lrs SZyynT/tQxM8gduiEkTXCe6JAI8mMB7TioIIq/R3GdHUoogPWcKFKVFsreSdZVGnTs4mqVwf/X5 FZPe8hINlUmRkJp0fg57rAK/KSw+QLadkQ53SPH/TQk9SP3ssAOicBowrx8+uieJvPIulX0vyjK jm1yyr+JRFTAxfr0vYd5Xlw6cVY7r3hcIJ3KgIaaU3RCImjREPqXjnyT5VPJVikb5km8xeePUtr LuGkg5Yt1TDLoE1HGIgA8Xe/N3VyPqjr5XhS7wyBGLWfbH6qG8gMk9i+X3KJq2OWUBewaEU1uVs h/hrL0RZbT7pe0Izud6uTlrfWR8tjbTw1Hi1j+Rc641Xxd823yZBL4O3BDkX/ijz5E1PtYEj1hB DnOmrqsmcpRJGtA== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790406178956217719 X-GMAIL-MSGID: 1790498135225873115 Now that the driver core can properly handle constant struct bus_type, move the iio_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: Ricardo B. Marliere --- drivers/iio/industrialio-core.c | 2 +- include/linux/iio/iio.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- base-commit: 81e8e40ea16329914f78ca1f454d04f570540ca8 change-id: 20240208-bus_cleanup-iio-1e5714e23bb9 Best regards, diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index e8551a1636ba..9b2877fe8689 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -42,7 +42,7 @@ static DEFINE_IDA(iio_ida); static dev_t iio_devt; #define IIO_DEV_MAX 256 -struct bus_type iio_bus_type = { +const struct bus_type iio_bus_type = { .name = "iio", }; EXPORT_SYMBOL(iio_bus_type); diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 4f89279e531c..e370a7bb3300 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -669,7 +669,7 @@ DEFINE_GUARD_COND(iio_claim_direct, _try, ({ int iio_device_claim_buffer_mode(struct iio_dev *indio_dev); void iio_device_release_buffer_mode(struct iio_dev *indio_dev); -extern struct bus_type iio_bus_type; +extern const struct bus_type iio_bus_type; /** * iio_device_put() - reference counted deallocation of struct device