diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/phy.h | 20 | ||||
-rw-r--r-- | include/linux/reboot-mode.h | 38 | ||||
-rw-r--r-- | include/linux/string.h | 1 |
3 files changed, 58 insertions, 1 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index cdcb7c24f2..a4cda3e28d 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -284,6 +284,26 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr); int phy_init(void); int phy_init_hw(struct phy_device *phydev); +#define phy_register_drivers_macro(level, drvs) \ + static int __init drvs##_register(void) \ + { \ + return phy_drivers_register(drvs, ARRAY_SIZE(drvs)); \ + } \ + level##_initcall(drvs##_register) + +#define device_phy_drivers(drvs) \ + phy_register_drivers_macro(device, drvs) + +#define phy_register_driver_macro(level, drv) \ + static int __init drv##_register(void) \ + { \ + return phy_driver_register(&drv); \ + } \ + level##_initcall(drv##_register) + +#define device_phy_driver(drv) \ + phy_register_driver_macro(device, drv) + int phy_save_page(struct phy_device *phydev); int phy_select_page(struct phy_device *phydev, int page); int phy_restore_page(struct phy_device *phydev, int oldpage, int ret); diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h new file mode 100644 index 0000000000..9d9ce19c0e --- /dev/null +++ b/include/linux/reboot-mode.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __REBOOT_MODE_H__ +#define __REBOOT_MODE_H__ + +#include <linux/types.h> + +struct device_d; + +#ifdef CONFIG_REBOOT_MODE +struct reboot_mode_driver { + struct device_d *dev; + int (*write)(struct reboot_mode_driver *reboot, const u32 *magic); + int priority; + bool no_fixup; + + /* filled by reboot_mode_register */ + int reboot_mode_prev, reboot_mode_next; + unsigned nmodes, nelems; + const char **modes; + u32 *magics; +}; + +int reboot_mode_register(struct reboot_mode_driver *reboot, + const u32 *magic, size_t num); +const char *reboot_mode_get(void); + +#define REBOOT_MODE_DEFAULT_PRIORITY 100 + +#else + +static inline const char *reboot_mode_get(void) +{ + return NULL; +} + +#endif + +#endif diff --git a/include/linux/string.h b/include/linux/string.h index e7f471b139..58e2a4d2ea 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -10,7 +10,6 @@ extern "C" { extern char * strpbrk(const char *,const char *); extern char * strsep(char **,const char *); -extern char * strsep_unescaped(char **,const char *); extern __kernel_size_t strspn(const char *,const char *); |