From nobody Mon Dec 1 22:35:41 2025 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 B53D230B512 for ; Sat, 29 Nov 2025 16:58:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764435522; cv=none; b=k4jTtFx1HkbX/4R3frzkKXvvDnPLXDM9EvkJBd4bJs5laIg/JFrp7eGX05zbpvT3l2VF3oiinluzJ5YnwT88uwBFxfbI/+3WFOyMuMyx3LbMwZcsQOcTUNbUgvbJDoI09U1wZ/bkJJbpMAEZXl4WVjpsqwHvoHzbkaLZ2PgGy9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764435522; c=relaxed/simple; bh=y0iUAnme9ancpNuL3b19N4isLf/JgWSJ8VGbTxQzl8s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cR6R9TfEE2H89FnnKjQk1KhxjIZSDWaS93Jp1v0U0lQs+5Sf4aXVB9BnDOZZAIIP2TrmX+JIa8wIwToQRlr5WpmLk1V97sUTkvYsMi5dN620quS1cAq7CgjyDlkwOxiLExYjqfo1Og8m1YVXVGE/PdTfATiulyzdNimCETymA6g= 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=wrZi3mb1; arc=none smtp.client-ip=209.85.218.50 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="wrZi3mb1" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-b76b5afdf04so500849866b.1 for ; Sat, 29 Nov 2025 08:58:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1764435518; x=1765040318; 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=lRP+naOibaSUBbYH6cwwgyLh7xe70Jwd0KUP+d+yfD8=; b=wrZi3mb1dlr719iooubeNTyikoylTsa0Maa8q42X9bM2p02nyeGuHm6IX3lcl+lSWB sE7bC/3i9pBwZh40wU/q8tjuQ4d+wHwwL/A+kmhLI075LBoFsfl5Vn/fP2g2NfKo9Dnn BjBPpdJIua1xR1EJptTKcx4y1frWA/ywIgBfkLxEk4NZV0jtiRslZRQ4ZXa+jvviMuIo yCu7HZlvt/gWRwkW3kWXXeS9cnN8hZ9RXERdrgQI/Lg8Q1+B5gX+CVi/KpzDz6iswShj XHfBdc1jpUYFNT0YNH97QzjDyxtHPMz7rjuNy+SK7kGjrL6vpvZo9aVFKSeeKLFwXQwb OhnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764435518; x=1765040318; 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=lRP+naOibaSUBbYH6cwwgyLh7xe70Jwd0KUP+d+yfD8=; b=tT/5tm5PbnNhzd5VgzlxfFSbUOd/yKMidnNT87FZND/SlBzT4kE/ilueFDS1ZxpWo1 ffWix+CC1KqWt1+fPlqrkqPo1YEqDP3KiydE4Jbz+3jNjaWCD3VYKNmyrg6ZOsqU4Uf0 w0BnrSc9no52mQzUnK05d0GsBzotU+HuRZBf5NzLbfUoeA1T1f2fpX99A1CSeTc06r6T r+cvp1Zw9tvqR6WwzJWk2A8e+a2SgpmKc4o9Acz1EMNLML1NmjksX0GXoHfcb8lvsxNL dbh17ySi5E5YPT1IR0Gn3HtCOf5qLqvmVRvBbH9/fRWx9zh8+MVBS3ZnBx10khFCiTyH JdAg== X-Forwarded-Encrypted: i=1; AJvYcCW5gQbM+ogtqYE9eOBqgLcVn9KtRhWrxgQGyDK4uLXsrCjQ/qhS4fD2S4FGTnJJvvSMApwjBgiyqANt9aQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyMscFiDvmOObTfsn8dpRnf9SGOnLyR9cRA37ea5x5L7jGbFHKx /lWT6MQAV5p9OnW8IjpOBARXaAQFjL+c5t2vCKO+VT5WUHvlypFpppfLEHzX7/GEa1E= X-Gm-Gg: ASbGnctjx0oYh5wnbIFJ3xSrD1XgnkAoLAZ0SCGVn3xjVvZLetXJfb32Rmozl0+5CwH iz98kJDfBTjZbud8VphJ5eQO4+auq/3FHVOo2EzuIQjGK1dbOTyeniff1ZG6pJOxWCwWkoe3tei DX6qHtPxGiuvf9jaVB0IouBjXxqJ7JAdY+NzPLw3Nvutxip6foP+60Vp67AbNX7tkCeNKVCgwE4 owh80SdXZ4UACwiDYKmeqXYYURofqs9CRqvKyZI39nhYG4heC6N2z0on5Imo7i648v5xYoQozM2 Ah0HqqnBJcbstbR97BU7YP4ePz3w3OPwxPz/QkfAl2/l5Vr84/xmnUkDlRFkdDqvZ0MJOX57uDj 09YHoGzXYGBBIJM261nV+2lwuOS6iUByRgWaQjvMajydJ+9c0rHOMV6qKo4vzKSDkFvGjlc7ddX /CYm1h0yrVpDrKbqW8 X-Google-Smtp-Source: AGHT+IHk435fyWGaAlYu505n4ZiLfYNLu4Dv/x3eLai2IZhDkiOJ/FAwb6oAn2fAPeTbO8YodthfmA== X-Received: by 2002:a17:907:6d10:b0:b77:1233:6f32 with SMTP id a640c23a62f3a-b7712336f9dmr710978166b.48.1764435517910; Sat, 29 Nov 2025 08:58:37 -0800 (PST) Received: from localhost ([2a02:8071:b783:6940:1d24:d58d:2b65:c291]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-b76f5a4b926sm741307566b.68.2025.11.29.08.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Nov 2025 08:58:37 -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, Greg Kroah-Hartman Subject: [PATCH 06/12] fsi: Make fsi_bus_type a private variable to the core Date: Sat, 29 Nov 2025 17:57:42 +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 X-Developer-Signature: v=1; a=openpgp-sha256; l=3429; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=y0iUAnme9ancpNuL3b19N4isLf/JgWSJ8VGbTxQzl8s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBpKyYS7dfRkhNI/Sbvf0he6nFANdJ4uQvA8wUIc k4Bidlit9GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCaSsmEgAKCRCPgPtYfRL+ TsdoB/9i978oUBhM2Kkwr6Aj5PdUmZUxKeynrqQHbnjl9tbdFc9rH0y7rZqjUHNCAHUjuU+lSBX ft+4APg0THAlSFVYtFiQpeOxDzx4tcNHs7z++fxmWvdHRmXIKj2kBwHDIp66306K6DCRMug3E/P ZxiSbv+VhI/tSGMerYm2sCBz2Db8ONqQx7xOn11HocMninwZ51/lyo77qxKxf4J5S6D3n88rtWw S/ABMW1yIgANi9MN7xjieFXelIgFplBYAZAe7rhyFfQw/yKWyXNasV1tWPiFHqjs+mk5a5dXY5i BxbZO2fY2QX3Mrwh6avsLG6kjJFtqD2oj3KVinvcgm/SkZ8d X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. --- 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