[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210208222203.22335-11-info@metux.net>
Date: Mon, 8 Feb 2021 23:22:01 +0100
From: "Enrico Weigelt, metux IT consult" <info@...ux.net>
To: linux-kernel@...r.kernel.org
Cc: rafael@...nel.org, info@...ux.net, linus.walleij@...aro.org,
bgolaszewski@...libre.com, robh+dt@...nel.org,
frowand.list@...il.com, pantelis.antoniou@...sulko.com,
linux-gpio@...r.kernel.org, devicetree@...r.kernel.org
Subject: [RFC PATCH 10/12] export bus_get() / bus_put()
---
drivers/base/bus.c | 6 ++++--
include/linux/device/bus.h | 3 +++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index a06ae2786092..2ef92a3c5d7b 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -39,7 +39,7 @@ static struct kset *system_kset;
static int __must_check bus_rescan_devices_helper(struct device *dev,
void *data);
-static struct bus_type *bus_get(struct bus_type *bus)
+struct bus_type *bus_get(struct bus_type *bus)
{
if (bus) {
kset_get(&bus->p->subsys);
@@ -47,12 +47,14 @@ static struct bus_type *bus_get(struct bus_type *bus)
}
return NULL;
}
+EXPORT_SYMBOL_GPL(bus_get);
-static void bus_put(struct bus_type *bus)
+void bus_put(struct bus_type *bus)
{
if (bus)
kset_put(&bus->p->subsys);
}
+EXPORT_SYMBOL_GPL(bus_put);
static ssize_t drv_attr_show(struct kobject *kobj, struct attribute *attr,
char *buf)
diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h
index b4cbcfe176c5..8d6b45df0a82 100644
--- a/include/linux/device/bus.h
+++ b/include/linux/device/bus.h
@@ -120,6 +120,9 @@ extern void bus_unregister(struct bus_type *bus);
extern int __must_check bus_rescan_devices(struct bus_type *bus);
+struct bus_type *bus_get(struct bus_type *bus);
+void bus_put(struct bus_type *bus);
+
struct bus_attribute {
struct attribute attr;
ssize_t (*show)(struct bus_type *bus, char *buf);
--
2.11.0
Powered by blists - more mailing lists