From f42b44e427224f0414accca1ae3262cef715386b Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 6 Aug 2021 12:43:31 +0100 Subject: [PATCH] Remove some deprecated API --- libfwupdplugin/README.md | 2 ++ libfwupdplugin/fu-device.c | 31 ------------------------------- libfwupdplugin/fu-device.h | 3 --- libfwupdplugin/fu-udev-device.c | 20 -------------------- libfwupdplugin/fu-udev-device.h | 3 --- libfwupdplugin/fwupdplugin.map | 2 -- 6 files changed, 2 insertions(+), 59 deletions(-) diff --git a/libfwupdplugin/README.md b/libfwupdplugin/README.md index 5c6868d3d..db2524b78 100644 --- a/libfwupdplugin/README.md +++ b/libfwupdplugin/README.md @@ -16,6 +16,8 @@ Remember: Plugins should be upstream! * Migrate from FuUsbDevice->probe(), FuUsbDevice->open() and FuUsbDevice->close() to using the superclass helpers * Migrate from FuUdevDevice->to_string(), FuUdevDevice->probe(), FuUdevDevice->open() and FuUdevDevice->close() to using the superclass helpers * Migrate from fu_device_get_protocol() to fu_device_get_protocols() and fu_device_set_protocol() to fu_device_add_protocol() +* Migrate from fu_device_has_custom_flag() to fu_device_has_private_flag() +* Migrate from fu_udev_device_set_readonly() to fu_udev_device_set_flags() ## Planned API/ABI changes for next release diff --git a/libfwupdplugin/fu-device.c b/libfwupdplugin/fu-device.c index 2051e2638..1a64eeb40 100644 --- a/libfwupdplugin/fu-device.c +++ b/libfwupdplugin/fu-device.c @@ -3043,37 +3043,6 @@ fu_device_get_custom_flags (FuDevice *self) return fu_device_get_metadata (self, "CustomFlags"); } -/** - * fu_device_has_custom_flag: - * @self: a #FuDevice - * @hint: a string, e.g. `bootloader` - * - * Checks if the custom flag exists for the device from the quirk system. - * - * It may be more efficient to call fu_device_get_custom_flags() and split the - * string locally if checking for lots of different flags. - * - * Returns: %TRUE if the hint exists - * - * Since: 1.1.0 - **/ -gboolean -fu_device_has_custom_flag (FuDevice *self, const gchar *hint) -{ - const gchar *hint_str; - g_auto(GStrv) hints = NULL; - - g_return_val_if_fail (FU_IS_DEVICE (self), FALSE); - g_return_val_if_fail (hint != NULL, FALSE); - - /* no hint is perfectly valid */ - hint_str = fu_device_get_custom_flags (self); - if (hint_str == NULL) - return FALSE; - hints = g_strsplit (hint_str, ",", -1); - return g_strv_contains ((const gchar * const *) hints, hint); -} - /** * fu_device_get_remove_delay: * @self: a #FuDevice diff --git a/libfwupdplugin/fu-device.h b/libfwupdplugin/fu-device.h index 1096436f8..a74d54ef5 100644 --- a/libfwupdplugin/fu-device.h +++ b/libfwupdplugin/fu-device.h @@ -506,9 +506,6 @@ void fu_device_add_flag (FuDevice *self, void fu_device_remove_flag (FuDevice *self, FwupdDeviceFlags flag); const gchar *fu_device_get_custom_flags (FuDevice *self); -gboolean fu_device_has_custom_flag (FuDevice *self, - const gchar *hint) - G_DEPRECATED_FOR(fu_device_has_private_flag); void fu_device_set_custom_flags (FuDevice *self, const gchar *custom_flags); void fu_device_set_name (FuDevice *self, diff --git a/libfwupdplugin/fu-udev-device.c b/libfwupdplugin/fu-udev-device.c index d5ace7a5a..fe8608a61 100644 --- a/libfwupdplugin/fu-udev-device.c +++ b/libfwupdplugin/fu-udev-device.c @@ -1201,26 +1201,6 @@ fu_udev_device_set_fd (FuUdevDevice *self, gint fd) priv->fd = fd; } -/** - * fu_udev_device_set_readonly: - * @self: a #FuUdevDevice - * @readonly: %TRUE if the device file should be opened readonly - * - * Sets the open mode to `O_RDONLY` use when opening the device with - * fu_device_open(). By default devices are opened with `O_RDWR`. - * - * Since: 1.3.3 - **/ -void -fu_udev_device_set_readonly (FuUdevDevice *self, gboolean readonly) -{ - FuUdevDevicePrivate *priv = GET_PRIVATE (self); - g_return_if_fail (FU_IS_UDEV_DEVICE (self)); - priv->flags = readonly ? FU_UDEV_DEVICE_FLAG_OPEN_READ : - FU_UDEV_DEVICE_FLAG_OPEN_READ | - FU_UDEV_DEVICE_FLAG_OPEN_WRITE; -} - /** * fu_udev_device_set_flags: * @self: a #FuUdevDevice diff --git a/libfwupdplugin/fu-udev-device.h b/libfwupdplugin/fu-udev-device.h index 65ac8168b..ebfa41f53 100644 --- a/libfwupdplugin/fu-udev-device.h +++ b/libfwupdplugin/fu-udev-device.h @@ -72,9 +72,6 @@ gboolean fu_udev_device_set_logical_id (FuUdevDevice *self, const gchar *subsystem, GError **error) G_GNUC_WARN_UNUSED_RESULT; -void fu_udev_device_set_readonly (FuUdevDevice *self, - gboolean readonly) -G_GNUC_DEPRECATED_FOR(fu_udev_device_set_flags); void fu_udev_device_set_flags (FuUdevDevice *self, FuUdevDeviceFlags flags); diff --git a/libfwupdplugin/fwupdplugin.map b/libfwupdplugin/fwupdplugin.map index 7bc316204..c66c61a09 100644 --- a/libfwupdplugin/fwupdplugin.map +++ b/libfwupdplugin/fwupdplugin.map @@ -214,7 +214,6 @@ LIBFWUPDPLUGIN_1.1.0 { global: fu_device_get_alternate_id; fu_device_get_custom_flags; - fu_device_has_custom_flag; fu_device_incorporate; fu_device_set_alternate_id; fu_device_set_custom_flags; @@ -423,7 +422,6 @@ LIBFWUPDPLUGIN_1.3.3 { fu_udev_device_pread; fu_udev_device_pwrite; fu_udev_device_set_fd; - fu_udev_device_set_readonly; local: *; } LIBFWUPDPLUGIN_1.3.2;