trivial: dell: move fu_dell_supported into plugin

Eventually fu-dell-common will not be used by synaptics, and it's
already not using this function.
This commit is contained in:
Mario Limonciello 2017-09-21 06:23:24 +08:00
parent 7ada7a8678
commit 39c4436c3d
3 changed files with 18 additions and 23 deletions

View File

@ -58,24 +58,6 @@ _dell_smi_obj_free (FuDellSmiObj *obj)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FuDellSmiObj, _dell_smi_obj_free);
gboolean
fu_dell_supported (FuPlugin *plugin)
{
GBytes *de_table = NULL;
const guint8 *value;
gsize len;
de_table = fu_plugin_get_smbios_data (plugin, 0xDE);
if (de_table == NULL)
return FALSE;
value = g_bytes_get_data (de_table, &len);
if (len == 0)
return FALSE;
if (*value != 0xDE)
return FALSE;
return TRUE;
}
/* don't actually clear if we're testing */
gboolean
fu_dell_clear_smi (FuDellSmiObj *obj)
@ -90,7 +72,6 @@ fu_dell_clear_smi (FuDellSmiObj *obj)
return TRUE;
}
gboolean
fu_dell_execute_smi (FuDellSmiObj *obj)
{

View File

@ -22,7 +22,6 @@
#ifndef __FU_DELL_COMMON_H
#define __FU_DELL_COMMON_H
#include "fu-plugin.h"
#include "fu-device.h"
#include <smbios_c/smi.h>
#include <smbios_c/obj/smi.h>
@ -87,9 +86,6 @@ typedef enum _CABLE_TYPE
CABLE_TYPE_TBT
} CABLE_TYPE;
gboolean
fu_dell_supported (FuPlugin *plugin);
gboolean
fu_dell_clear_smi (FuDellSmiObj *obj);

View File

@ -111,6 +111,24 @@ _fwup_resource_iter_free (fwup_resource_iter *iter)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (fwup_resource_iter, _fwup_resource_iter_free);
static gboolean
fu_dell_supported (FuPlugin *plugin)
{
GBytes *de_table = NULL;
const guint8 *value;
gsize len;
de_table = fu_plugin_get_smbios_data (plugin, 0xDE);
if (de_table == NULL)
return FALSE;
value = g_bytes_get_data (de_table, &len);
if (len == 0)
return FALSE;
if (*value != 0xDE)
return FALSE;
return TRUE;
}
static gboolean
fu_plugin_dell_match_dock_component (const gchar *query_str,
efi_guid_t *guid_out,