]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
compat: add dev_name()
authorCasey Connolly <casey.connolly@linaro.org>
Wed, 1 Apr 2026 14:15:23 +0000 (16:15 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 21 Apr 2026 17:19:49 +0000 (11:19 -0600)
This function just wraps udevice->name.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
include/linux/device.h [new file with mode: 0644]

diff --git a/include/linux/device.h b/include/linux/device.h
new file mode 100644 (file)
index 0000000..e76635c
--- /dev/null
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * device.h - generic, centralized driver model
+ *
+ * U-Boot: compat header derived from Linux
+ *
+ * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
+ * Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de>
+ * Copyright (c) 2008-2009 Novell Inc.
+ *
+ * See Documentation/driver-api/driver-model/ for more information.
+ */
+
+#ifndef _DEVICE_H_
+#define _DEVICE_H_
+
+#include <dm/device.h>
+
+/**
+ * dev_name - Return a device's name.
+ * @dev: Device with name to get.
+ * Return: The kobject name of the device, or its initial name if unavailable.
+ */
+static inline const char *dev_name(const struct udevice *dev)
+{
+       return dev->name;
+}
+
+#endif /* _DEVICE_H_ */