mei: fix up uuid matching
A previous commit,c93b76b34b
("mei: bus: report also uuid in module alias") caused a build error as I missed applying a needed patch to add some macros to uapi/linux/uuid.h. Instead of those additional macros, change the mei code to use the existing uuid structure directly. Fixes:c93b76b34b
Cc: Tomas Winkler <tomas.winkler@intel.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
039ae58503
commit
b144ce2d37
|
@ -30,11 +30,6 @@
|
||||||
#define to_mei_cl_driver(d) container_of(d, struct mei_cl_driver, driver)
|
#define to_mei_cl_driver(d) container_of(d, struct mei_cl_driver, driver)
|
||||||
#define to_mei_cl_device(d) container_of(d, struct mei_cl_device, dev)
|
#define to_mei_cl_device(d) container_of(d, struct mei_cl_device, dev)
|
||||||
|
|
||||||
static inline uuid_le uuid_le_cast(const __u8 uuid[16])
|
|
||||||
{
|
|
||||||
return *(uuid_le *)uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int mei_cl_device_match(struct device *dev, struct device_driver *drv)
|
static int mei_cl_device_match(struct device *dev, struct device_driver *drv)
|
||||||
{
|
{
|
||||||
struct mei_cl_device *device = to_mei_cl_device(dev);
|
struct mei_cl_device *device = to_mei_cl_device(dev);
|
||||||
|
@ -54,9 +49,9 @@ static int mei_cl_device_match(struct device *dev, struct device_driver *drv)
|
||||||
|
|
||||||
id = driver->id_table;
|
id = driver->id_table;
|
||||||
|
|
||||||
while (uuid_le_cmp(NULL_UUID_LE, uuid_le_cast(id->uuid))) {
|
while (uuid_le_cmp(NULL_UUID_LE, id->uuid)) {
|
||||||
|
|
||||||
if (!uuid_le_cmp(*uuid, uuid_le_cast(id->uuid))) {
|
if (!uuid_le_cmp(*uuid, id->uuid)) {
|
||||||
if (id->name[0]) {
|
if (id->name[0]) {
|
||||||
if (!strncmp(name, id->name, sizeof(id->name)))
|
if (!strncmp(name, id->name, sizeof(id->name)))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <net/nfc/hci.h>
|
#include <net/nfc/hci.h>
|
||||||
#include <linux/uuid.h>
|
#include <linux/uuid.h>
|
||||||
|
|
||||||
#define MEI_NFC_UUID __UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \
|
#define MEI_NFC_UUID UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \
|
||||||
0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c)
|
0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c)
|
||||||
#define MEI_NFC_HEADER_SIZE 10
|
#define MEI_NFC_HEADER_SIZE 10
|
||||||
#define MEI_NFC_MAX_HCI_PAYLOAD 300
|
#define MEI_NFC_MAX_HCI_PAYLOAD 300
|
||||||
|
|
|
@ -614,7 +614,7 @@ struct ipack_device_id {
|
||||||
*/
|
*/
|
||||||
struct mei_cl_device_id {
|
struct mei_cl_device_id {
|
||||||
char name[MEI_CL_NAME_SIZE];
|
char name[MEI_CL_NAME_SIZE];
|
||||||
__u8 uuid[16];
|
uuid_le uuid;
|
||||||
kernel_ulong_t driver_info;
|
kernel_ulong_t driver_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,9 @@ typedef Elf64_Addr kernel_ulong_t;
|
||||||
typedef uint32_t __u32;
|
typedef uint32_t __u32;
|
||||||
typedef uint16_t __u16;
|
typedef uint16_t __u16;
|
||||||
typedef unsigned char __u8;
|
typedef unsigned char __u8;
|
||||||
|
typedef struct {
|
||||||
|
__u8 b[16];
|
||||||
|
} uuid_le;
|
||||||
|
|
||||||
/* Big exception to the "don't include kernel headers into userspace, which
|
/* Big exception to the "don't include kernel headers into userspace, which
|
||||||
* even potentially has different endianness and word sizes, since
|
* even potentially has different endianness and word sizes, since
|
||||||
|
@ -131,13 +134,13 @@ static inline void add_wildcard(char *str)
|
||||||
strcat(str + len, "*");
|
strcat(str + len, "*");
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void add_uuid(char *str, __u8 uuid[16])
|
static inline void add_uuid(char *str, uuid_le uuid)
|
||||||
{
|
{
|
||||||
int len = strlen(str);
|
int len = strlen(str);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
sprintf(str + len + (i << 1), "%02x", uuid[i]);
|
sprintf(str + len + (i << 1), "%02x", uuid.b[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue