From nobody Fri Dec 19 11:35:56 2025 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 731112F60A4 for ; Tue, 9 Dec 2025 11:41:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765280493; cv=none; b=F65W3hMe5avWgANKyQNUWsvjkzscjKO++swN1oKJ68vqQ6BKU1gwU8EsejmrovAEEJohUgUEBtBkUx6e8nuREI27zaHk/v3WFHBpDw0qNAiMGCUiBXJL6tRMOmSIUvgoxvm2K4FnjaJm2/FdQvEJ++aIpiInGmw4cWtZ7G7oye0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765280493; c=relaxed/simple; bh=kDKWmaDyk940it9Am6kUIJ9K+r0D1G/IO6T4V2FGKmE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CR7bEhTIcqtEEXOQJhRBrbumBUYgwWg+DTuDUWoCiy/6d2XUnzS0G9KtFf2wPY8UKdNFHRoJ4PpmkCVDvPTo17FCxuKiZIHTmoyXXi4Jhg3KOHPfFcnQzZ7SvlzJuxVIMlr5A79QSmp58ww+r02xp4ypNggBUN/9059t6m4xK7I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=GdYiXhBD; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="GdYiXhBD" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-42f762198cbso3575603f8f.3 for ; Tue, 09 Dec 2025 03:41:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1765280490; x=1765885290; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HIwjyOA1JxVccQqRxG8W1vQfz0CfbpI3YL/o7YqIcdE=; b=GdYiXhBD9WDEhix0Avhbv7D0E9gQ879NxpodbK21gbRT4KHRGtRM+D2IVjw+0X4Jy/ ZINGip+m7ewD2RzaAkEy4nwHReNvuMpuevNFSCYbR5VoVxcC6maJLFh+zgr3EwJFMY9L GxEHMQtOu8HE0eKKLonhfXRU511BmDf1zE6NwoUY7FwhCAvxnhF7Kxj2/6bpiJH2o7Yo GOz4ermQBINSNYmyFGUgjacj87Mom7ztujhBCqrWyIjvlasKKSyWzCPPccShsotLZGSw rv8/3sIBO4YpuSye05my5H+mFutf4rZoYD+CgmzTxfO39MUIj0ufqqAZGzS4QfOY6fly pPpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765280490; x=1765885290; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HIwjyOA1JxVccQqRxG8W1vQfz0CfbpI3YL/o7YqIcdE=; b=qyzWgLdNpETtNYjJPYYc0+mx2oMzsml+8dtHM17Yi+nk9qJDotSPz9TprTRFFFqG+o BktJ33pgXvZf9e5urirz2D8fm/6BCczNTEHlEQ7hXrixDAPgNDjG2B/JHUQYEuBGGclL gDNCNnRq62KceTWxaelVUpEtml2bRJKGEJRpmKhWj9c/zI0O/705IVxHWwOdI0AhVMyr CRRqi2tyXodl5wffVlFAEjy8H4XoYYYLU3wFKx783rbThclqZt81v1hq/9EWO+9p/08i bqhyKLkrnYlqfdkYujiOFPSKPaBNm2OuFWuIOsSIKEQW27hde2HlWzegVpK6NXgdVUIT orRg== X-Forwarded-Encrypted: i=1; AJvYcCXSDr3Hjr1DWDBBMfq81OnMpuj33UPFTFqwRCNp3vs5OuxBWmrD2o36I9iPAyuK3pTGJaTL94LgiKnEDIo=@vger.kernel.org X-Gm-Message-State: AOJu0YycjH68DLXQP8hIicv+CYSGij40kcEv+0BQflH/DmFmVW908/qq XYIh3bMo3leLWwcliRjQBTU7sIoOSIc3/7n9B24KRQJlVAYlBCo/r3ACbZq6qz369dc= X-Gm-Gg: ASbGnctLLWL/J8tNYjkK5xzbr4DCFRQKPYilwZr+JUej+SRSMhqgTm7KEEGcKbqCWpY 73whbzXM+GpqS7v7PRqqlikGLSepExW7DyzeaiKX4wyobRp5cXrcObkhdPEhFwhbRhzIE+gbjkA og6qVT+CPiXAXk+b3OEMTs9X3FD6xSD2GAWdBAoksrq5yADaCQE1fN+KirtQpK7D7ODlC9HkiRS xeYnbzVcBt4T9lAjEnahvS0VKUW8nc6XrU764OrQyXPA8BuAjWoMbXT4QlFRkRn2pW/Xo4k2WXF tvB6GuNiqytyPKrN5pBlTgXTyytYsF4DB75Sgh6J9Fcx+Fk+UMOmGufff5/NUP24iS8S1c+My4C AW1M2EEkvazb+LPVIB1CI7aVzzvbiYIOjPPej6jMdXl7hcbJjeBk7kmhhi0XMljAUX9O+kfF61p NbnG04Fc/2HjSu7c95vhRuMQ8UO5kMvOXvtQ2Aie/UFw76BQBgyVozoN1FXYJM4Ag3gXjvEW/MR NU= X-Google-Smtp-Source: AGHT+IEwHSdo+Ic7opultYftPU3t2iGUu/G+4AQ+j2D3YrxFwywS2Yy5d282AZgzKfE6IWafc3jrYA== X-Received: by 2002:a05:6000:2502:b0:42b:3220:93e8 with SMTP id ffacd0b85a97d-42f89f58c88mr11443528f8f.57.1765280489662; Tue, 09 Dec 2025 03:41:29 -0800 (PST) Received: from localhost (p200300f65f00660846b2ba6e435ad603.dip0.t-ipconnect.de. [2003:f6:5f00:6608:46b2:ba6e:435a:d603]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-42f9f5ab46csm3326299f8f.19.2025.12.09.03.41.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 03:41:29 -0800 (PST) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Eddie James Cc: Ninad Palsule , linux-fsi@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 06/13] fsi: Make fsi_bus_type a private variable to the core Date: Tue, 9 Dec 2025 12:40:30 +0100 Message-ID: X-Mailer: git-send-email 2.47.3 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=3496; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=kDKWmaDyk940it9Am6kUIJ9K+r0D1G/IO6T4V2FGKmE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBpOArCtWbXEdVtRIYdPDckWG/HrlRcvfBOmqkoG JyBZl5HgJWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCaTgKwgAKCRCPgPtYfRL+ ThymB/wKG5LIVXuZwe4pYLANqAH2zDcVHIIplSEfvtnLOBQrwl6lKEkYJzfHWJjhywTjO+WglOq FEiiaia7wGgIUAcq6C84XPf8syoFUNNME6LJ583uuXkGm+kH2HjFlLoQnziLmQm4CXCQpRoDguJ 5Cgo6hmKE3Lt5RPhpDzd4msHhd3+lS1Yire/ZfCKyvzCvcNSew7JFAMIGpyPmNFNt5Gdmfh4fk4 nXHflSWAUMuI0oIuVn4JRoBBEODyl44wTk9xypodWhtvTJuOK9fR0tB/Dnfpq4d+mKY2Vj4TP5Q IshO8ayHyqpDfrIYHUESIvU096ghIsfcWZi4qJEAlV/4uiXg X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable There are no users of fsi_bus_type outside of fsi-core.c, so make that variable static, don't export it and drop the declaration from the public header file. As there is a usage of fsi_bus_type in fsi_create_device() the definition of that variable must happen further up in the file to not have to add a local declaration. Signed-off-by: Uwe Kleine-K=C3=B6nig --- drivers/fsi/fsi-core.c | 67 +++++++++++++++++++++--------------------- include/linux/fsi.h | 1 - 2 files changed, 33 insertions(+), 35 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index e1ea1124282e..4e60d4b17c11 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -100,6 +100,39 @@ static int fsi_master_write(struct fsi_master *master,= int link, uint8_t slave_id, uint32_t addr, const void *val, size_t size); static int fsi_master_break(struct fsi_master *master, int link); =20 +/* FSI core & Linux bus type definitions */ + +static int fsi_bus_match(struct device *dev, const struct device_driver *d= rv) +{ + struct fsi_device *fsi_dev =3D to_fsi_dev(dev); + const struct fsi_driver *fsi_drv =3D to_fsi_drv(drv); + const struct fsi_device_id *id; + + if (!fsi_drv->id_table) + return 0; + + for (id =3D fsi_drv->id_table; id->engine_type; id++) { + if (id->engine_type !=3D fsi_dev->engine_type) + continue; + if (id->version =3D=3D FSI_VERSION_ANY || + id->version =3D=3D fsi_dev->version) { + if (drv->of_match_table) { + if (of_driver_match_device(dev, drv)) + return 1; + } else { + return 1; + } + } + } + + return 0; +} + +static const struct bus_type fsi_bus_type =3D { + .name =3D "fsi", + .match =3D fsi_bus_match, +}; + /* * fsi_device_read() / fsi_device_write() / fsi_device_peek() * @@ -1359,34 +1392,6 @@ void fsi_master_unregister(struct fsi_master *master) } EXPORT_SYMBOL_GPL(fsi_master_unregister); =20 -/* FSI core & Linux bus type definitions */ - -static int fsi_bus_match(struct device *dev, const struct device_driver *d= rv) -{ - struct fsi_device *fsi_dev =3D to_fsi_dev(dev); - const struct fsi_driver *fsi_drv =3D to_fsi_drv(drv); - const struct fsi_device_id *id; - - if (!fsi_drv->id_table) - return 0; - - for (id =3D fsi_drv->id_table; id->engine_type; id++) { - if (id->engine_type !=3D fsi_dev->engine_type) - continue; - if (id->version =3D=3D FSI_VERSION_ANY || - id->version =3D=3D fsi_dev->version) { - if (drv->of_match_table) { - if (of_driver_match_device(dev, drv)) - return 1; - } else { - return 1; - } - } - } - - return 0; -} - int fsi_driver_register(struct fsi_driver *fsi_drv) { if (!fsi_drv) @@ -1406,12 +1411,6 @@ void fsi_driver_unregister(struct fsi_driver *fsi_dr= v) } EXPORT_SYMBOL_GPL(fsi_driver_unregister); =20 -const struct bus_type fsi_bus_type =3D { - .name =3D "fsi", - .match =3D fsi_bus_match, -}; -EXPORT_SYMBOL_GPL(fsi_bus_type); - static int __init fsi_init(void) { int rc; diff --git a/include/linux/fsi.h b/include/linux/fsi.h index 05be75869a69..3e3a8f3adac3 100644 --- a/include/linux/fsi.h +++ b/include/linux/fsi.h @@ -78,7 +78,6 @@ extern int fsi_slave_read(struct fsi_slave *slave, uint32= _t addr, extern int fsi_slave_write(struct fsi_slave *slave, uint32_t addr, const void *val, size_t size); =20 -extern const struct bus_type fsi_bus_type; extern const struct device_type fsi_cdev_type; =20 enum fsi_dev_type { --=20 2.47.3