Loading drivers/staging/greybus/core.c +11 −7 Original line number Diff line number Diff line Loading @@ -33,18 +33,22 @@ EXPORT_SYMBOL_GPL(greybus_disabled); static int greybus_match_one_id(struct greybus_device *gdev, const struct greybus_module_id *id) { struct greybus_descriptor *des = &gdev->descriptor; struct greybus_descriptor_module_id *module_id; struct greybus_descriptor_serial_number *serial_num; module_id = &gdev->module_id; serial_num = &gdev->serial_number; if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_VENDOR) && (des->wVendor != id->wVendor)) (id->vendor != le16_to_cpu(module_id->vendor))) return 0; if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_PRODUCT) && (des->wProduct != id->wProduct)) (id->product != le16_to_cpu(module_id->product))) return 0; if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_SERIAL) && (des->lSerialNumber != id->lSerialNumber)) (id->serial_number != le64_to_cpu(serial_num->serial_number))) return 0; return 1; Loading @@ -57,7 +61,7 @@ static const struct greybus_module_id *greybus_match_id( if (id == NULL) return NULL; for (; id->wVendor || id->wProduct || id->lSerialNumber || for (; id->vendor || id->product || id->serial_number || id->driver_info ; id++) { if (greybus_match_one_id(gdev, id)) return id; Loading Loading @@ -151,7 +155,7 @@ void greybus_deregister(struct greybus_driver *driver) EXPORT_SYMBOL_GPL(greybus_deregister); static int new_device(struct greybus_device *gdev, int new_device(struct greybus_device *gdev, const struct greybus_module_id *id) { int retval; Loading Loading @@ -187,7 +191,7 @@ static int new_device(struct greybus_device *gdev, return retval; } static void remove_device(struct greybus_device *gdev) void remove_device(struct greybus_device *gdev) { /* tear down all of the "sub device types" for this device */ gb_i2c_disconnect(gdev); Loading drivers/staging/greybus/greybus.h +10 −11 Original line number Diff line number Diff line Loading @@ -11,29 +11,26 @@ #ifdef __KERNEL__ #include <linux/types.h> #include <linux/list.h> #include <linux/device.h> #include <linux/module.h> #include "greybus_id.h" #include "greybus_desc.h" #define GREYBUS_DEVICE_ID_MATCH_DEVICE \ (GREYBUS_DEVICE_ID_MATCH_VENDOR | GREYBUS_DEVICE_ID_MATCH_PRODUCT) #define GREYBUS_DEVICE(vendor, product) \ #define GREYBUS_DEVICE(v, p) \ .match_flags = GREYBUS_DEVICE_ID_MATCH_DEVICE, \ .wVendor = (vendor), \ .wProduct = (product), .vendor = (v), \ .product = (p), #define GREYBUS_DEVICE_SERIAL(serial) \ #define GREYBUS_DEVICE_SERIAL(s) \ .match_flags = GREYBUS_DEVICE_ID_MATCH_SERIAL, \ .lSerial = (serial), .serial_number = (s), struct greybus_descriptor { __u16 wVendor; __u16 wProduct; __u64 lSerialNumber; }; struct gbuf; Loading Loading @@ -90,7 +87,9 @@ struct gb_usb_device; struct greybus_device { struct device dev; struct greybus_descriptor descriptor; struct greybus_descriptor_function function; struct greybus_descriptor_module_id module_id; struct greybus_descriptor_serial_number serial_number; int num_cport; struct cport cport[0]; Loading drivers/staging/greybus/greybus_desc.h +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ struct greybus_descriptor_cport { __u8 reserved; }; struct greybus_msg_descriptor { struct greybus_descriptor { struct greybus_descriptor_header header; union { struct greybus_descriptor_function function; Loading drivers/staging/greybus/greybus_id.h +3 −3 Original line number Diff line number Diff line Loading @@ -11,9 +11,9 @@ struct greybus_module_id { __u16 match_flags; __u16 wVendor; __u16 wProduct; __u64 lSerialNumber; __u16 vendor; __u16 product; __u64 serial_number; kernel_ulong_t driver_info __attribute__((aligned(sizeof(kernel_ulong_t)))); Loading Loading
drivers/staging/greybus/core.c +11 −7 Original line number Diff line number Diff line Loading @@ -33,18 +33,22 @@ EXPORT_SYMBOL_GPL(greybus_disabled); static int greybus_match_one_id(struct greybus_device *gdev, const struct greybus_module_id *id) { struct greybus_descriptor *des = &gdev->descriptor; struct greybus_descriptor_module_id *module_id; struct greybus_descriptor_serial_number *serial_num; module_id = &gdev->module_id; serial_num = &gdev->serial_number; if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_VENDOR) && (des->wVendor != id->wVendor)) (id->vendor != le16_to_cpu(module_id->vendor))) return 0; if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_PRODUCT) && (des->wProduct != id->wProduct)) (id->product != le16_to_cpu(module_id->product))) return 0; if ((id->match_flags & GREYBUS_DEVICE_ID_MATCH_SERIAL) && (des->lSerialNumber != id->lSerialNumber)) (id->serial_number != le64_to_cpu(serial_num->serial_number))) return 0; return 1; Loading @@ -57,7 +61,7 @@ static const struct greybus_module_id *greybus_match_id( if (id == NULL) return NULL; for (; id->wVendor || id->wProduct || id->lSerialNumber || for (; id->vendor || id->product || id->serial_number || id->driver_info ; id++) { if (greybus_match_one_id(gdev, id)) return id; Loading Loading @@ -151,7 +155,7 @@ void greybus_deregister(struct greybus_driver *driver) EXPORT_SYMBOL_GPL(greybus_deregister); static int new_device(struct greybus_device *gdev, int new_device(struct greybus_device *gdev, const struct greybus_module_id *id) { int retval; Loading Loading @@ -187,7 +191,7 @@ static int new_device(struct greybus_device *gdev, return retval; } static void remove_device(struct greybus_device *gdev) void remove_device(struct greybus_device *gdev) { /* tear down all of the "sub device types" for this device */ gb_i2c_disconnect(gdev); Loading
drivers/staging/greybus/greybus.h +10 −11 Original line number Diff line number Diff line Loading @@ -11,29 +11,26 @@ #ifdef __KERNEL__ #include <linux/types.h> #include <linux/list.h> #include <linux/device.h> #include <linux/module.h> #include "greybus_id.h" #include "greybus_desc.h" #define GREYBUS_DEVICE_ID_MATCH_DEVICE \ (GREYBUS_DEVICE_ID_MATCH_VENDOR | GREYBUS_DEVICE_ID_MATCH_PRODUCT) #define GREYBUS_DEVICE(vendor, product) \ #define GREYBUS_DEVICE(v, p) \ .match_flags = GREYBUS_DEVICE_ID_MATCH_DEVICE, \ .wVendor = (vendor), \ .wProduct = (product), .vendor = (v), \ .product = (p), #define GREYBUS_DEVICE_SERIAL(serial) \ #define GREYBUS_DEVICE_SERIAL(s) \ .match_flags = GREYBUS_DEVICE_ID_MATCH_SERIAL, \ .lSerial = (serial), .serial_number = (s), struct greybus_descriptor { __u16 wVendor; __u16 wProduct; __u64 lSerialNumber; }; struct gbuf; Loading Loading @@ -90,7 +87,9 @@ struct gb_usb_device; struct greybus_device { struct device dev; struct greybus_descriptor descriptor; struct greybus_descriptor_function function; struct greybus_descriptor_module_id module_id; struct greybus_descriptor_serial_number serial_number; int num_cport; struct cport cport[0]; Loading
drivers/staging/greybus/greybus_desc.h +1 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ struct greybus_descriptor_cport { __u8 reserved; }; struct greybus_msg_descriptor { struct greybus_descriptor { struct greybus_descriptor_header header; union { struct greybus_descriptor_function function; Loading
drivers/staging/greybus/greybus_id.h +3 −3 Original line number Diff line number Diff line Loading @@ -11,9 +11,9 @@ struct greybus_module_id { __u16 match_flags; __u16 wVendor; __u16 wProduct; __u64 lSerialNumber; __u16 vendor; __u16 product; __u64 serial_number; kernel_ulong_t driver_info __attribute__((aligned(sizeof(kernel_ulong_t)))); Loading