diff options
| author | Casey Connolly <[email protected]> | 2026-04-01 16:15:23 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-04-21 11:19:49 -0600 |
| commit | 8e0ed228d8b062690365e439fbd40f1edd34780a (patch) | |
| tree | eff1b7c48143434f0654cfa769e5111fe192a1a3 /include/linux/device.h | |
| parent | 70b55377553403932cb37cc530433aaee6ee41e0 (diff) | |
compat: add dev_name()
This function just wraps udevice->name.
Signed-off-by: Casey Connolly <[email protected]>
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h new file mode 100644 index 00000000000..e76635cfde9 --- /dev/null +++ b/include/linux/device.h @@ -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 <[email protected]> + * Copyright (c) 2004-2009 Greg Kroah-Hartman <[email protected]> + * 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_ */ |
