ChangeSet 1.831.15.5, 2002/12/06 13:34:20-06:00, ahaas@airmail.net [PATCH] C99 initializers for drivers/usb/serial Here are patches for switching two files over to use C99 initializers. The patches are against 2.5.50. diff -Nru a/drivers/usb/serial/io_tables.h b/drivers/usb/serial/io_tables.h --- a/drivers/usb/serial/io_tables.h Mon Dec 9 11:41:34 2002 +++ b/drivers/usb/serial/io_tables.h Mon Dec 9 11:41:34 2002 @@ -98,91 +98,91 @@ MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_serial_device_type edgeport_1port_device = { - owner: THIS_MODULE, - name: "Edgeport 1 port adapter", - id_table: edgeport_1port_id_table, - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: edge_open, - close: edge_close, - throttle: edge_throttle, - unthrottle: edge_unthrottle, - attach: edge_startup, - shutdown: edge_shutdown, - ioctl: edge_ioctl, - set_termios: edge_set_termios, - write: edge_write, - write_room: edge_write_room, - chars_in_buffer: edge_chars_in_buffer, - break_ctl: edge_break, + .owner = THIS_MODULE, + .name = "Edgeport 1 port adapter", + .id_table = edgeport_1port_id_table, + .num_interrupt_in = 1, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .open = edge_open, + .close = edge_close, + .throttle = edge_throttle, + .unthrottle = edge_unthrottle, + .attach = edge_startup, + .shutdown = edge_shutdown, + .ioctl = edge_ioctl, + .set_termios = edge_set_termios, + .write = edge_write, + .write_room = edge_write_room, + .chars_in_buffer = edge_chars_in_buffer, + .break_ctl = edge_break, }; static struct usb_serial_device_type edgeport_2port_device = { - owner: THIS_MODULE, - name: "Edgeport 2 port adapter", - id_table: edgeport_2port_id_table, - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 2, - open: edge_open, - close: edge_close, - throttle: edge_throttle, - unthrottle: edge_unthrottle, - attach: edge_startup, - shutdown: edge_shutdown, - ioctl: edge_ioctl, - set_termios: edge_set_termios, - write: edge_write, - write_room: edge_write_room, - chars_in_buffer: edge_chars_in_buffer, - break_ctl: edge_break, + .owner = THIS_MODULE, + .name = "Edgeport 2 port adapter", + .id_table = edgeport_2port_id_table, + .num_interrupt_in = 1, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 2, + .open = edge_open, + .close = edge_close, + .throttle = edge_throttle, + .unthrottle = edge_unthrottle, + .attach = edge_startup, + .shutdown = edge_shutdown, + .ioctl = edge_ioctl, + .set_termios = edge_set_termios, + .write = edge_write, + .write_room = edge_write_room, + .chars_in_buffer = edge_chars_in_buffer, + .break_ctl = edge_break, }; static struct usb_serial_device_type edgeport_4port_device = { - owner: THIS_MODULE, - name: "Edgeport 4 port adapter", - id_table: edgeport_4port_id_table, - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 4, - open: edge_open, - close: edge_close, - throttle: edge_throttle, - unthrottle: edge_unthrottle, - attach: edge_startup, - shutdown: edge_shutdown, - ioctl: edge_ioctl, - set_termios: edge_set_termios, - write: edge_write, - write_room: edge_write_room, - chars_in_buffer: edge_chars_in_buffer, - break_ctl: edge_break, + .owner = THIS_MODULE, + .name = "Edgeport 4 port adapter", + .id_table = edgeport_4port_id_table, + .num_interrupt_in = 1, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 4, + .open = edge_open, + .close = edge_close, + .throttle = edge_throttle, + .unthrottle = edge_unthrottle, + .attach = edge_startup, + .shutdown = edge_shutdown, + .ioctl = edge_ioctl, + .set_termios = edge_set_termios, + .write = edge_write, + .write_room = edge_write_room, + .chars_in_buffer = edge_chars_in_buffer, + .break_ctl = edge_break, }; static struct usb_serial_device_type edgeport_8port_device = { - owner: THIS_MODULE, - name: "Edgeport 8 port adapter", - id_table: edgeport_8port_id_table, - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 8, - open: edge_open, - close: edge_close, - throttle: edge_throttle, - unthrottle: edge_unthrottle, - attach: edge_startup, - shutdown: edge_shutdown, - ioctl: edge_ioctl, - set_termios: edge_set_termios, - write: edge_write, - write_room: edge_write_room, - chars_in_buffer: edge_chars_in_buffer, - break_ctl: edge_break, + .owner = THIS_MODULE, + .name = "Edgeport 8 port adapter", + .id_table = edgeport_8port_id_table, + .num_interrupt_in = 1, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 8, + .open = edge_open, + .close = edge_close, + .throttle = edge_throttle, + .unthrottle = edge_unthrottle, + .attach = edge_startup, + .shutdown = edge_shutdown, + .ioctl = edge_ioctl, + .set_termios = edge_set_termios, + .write = edge_write, + .write_room = edge_write_room, + .chars_in_buffer = edge_chars_in_buffer, + .break_ctl = edge_break, }; #endif diff -Nru a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h --- a/drivers/usb/serial/keyspan.h Mon Dec 9 11:41:34 2002 +++ b/drivers/usb/serial/keyspan.h Mon Dec 9 11:41:34 2002 @@ -249,149 +249,149 @@ in Keyspan's documentation) */ static const struct keyspan_device_details usa18x_device_details = { - product_id: keyspan_usa18x_product_id, - msg_format: msg_usa26, - num_ports: 1, - indat_endp_flip: 0, - outdat_endp_flip: 1, - indat_endpoints: {0x81}, - outdat_endpoints: {0x01}, - inack_endpoints: {0x85}, - outcont_endpoints: {0x05}, - instat_endpoint: 0x87, - glocont_endpoint: 0x07, - calculate_baud_rate: keyspan_usa19w_calc_baud, - baudclk: KEYSPAN_USA18X_BAUDCLK, + .product_id = keyspan_usa18x_product_id, + .msg_format = msg_usa26, + .num_ports = 1, + .indat_endp_flip = 0, + .outdat_endp_flip = 1, + .indat_endpoints = {0x81}, + .outdat_endpoints = {0x01}, + .inack_endpoints = {0x85}, + .outcont_endpoints = {0x05}, + .instat_endpoint = 0x87, + .glocont_endpoint = 0x07, + .calculate_baud_rate = keyspan_usa19w_calc_baud, + .baudclk = KEYSPAN_USA18X_BAUDCLK, }; static const struct keyspan_device_details usa19_device_details = { - product_id: keyspan_usa19_product_id, - msg_format: msg_usa28, - num_ports: 1, - indat_endp_flip: 1, - outdat_endp_flip: 1, - indat_endpoints: {0x81}, - outdat_endpoints: {0x01}, - inack_endpoints: {0x83}, - outcont_endpoints: {0x03}, - instat_endpoint: 0x84, - glocont_endpoint: -1, - calculate_baud_rate: keyspan_usa19_calc_baud, - baudclk: KEYSPAN_USA19_BAUDCLK, + .product_id = keyspan_usa19_product_id, + .msg_format = msg_usa28, + .num_ports = 1, + .indat_endp_flip = 1, + .outdat_endp_flip = 1, + .indat_endpoints = {0x81}, + .outdat_endpoints = {0x01}, + .inack_endpoints = {0x83}, + .outcont_endpoints = {0x03}, + .instat_endpoint = 0x84, + .glocont_endpoint = -1, + .calculate_baud_rate = keyspan_usa19_calc_baud, + .baudclk = KEYSPAN_USA19_BAUDCLK, }; static const struct keyspan_device_details usa19qi_device_details = { - product_id: keyspan_usa19qi_product_id, - msg_format: msg_usa28, - num_ports: 1, - indat_endp_flip: 1, - outdat_endp_flip: 1, - indat_endpoints: {0x81}, - outdat_endpoints: {0x01}, - inack_endpoints: {0x83}, - outcont_endpoints: {0x03}, - instat_endpoint: 0x84, - glocont_endpoint: -1, - calculate_baud_rate: keyspan_usa28_calc_baud, - baudclk: KEYSPAN_USA19_BAUDCLK, + .product_id = keyspan_usa19qi_product_id, + .msg_format = msg_usa28, + .num_ports = 1, + .indat_endp_flip = 1, + .outdat_endp_flip = 1, + .indat_endpoints = {0x81}, + .outdat_endpoints = {0x01}, + .inack_endpoints = {0x83}, + .outcont_endpoints = {0x03}, + .instat_endpoint = 0x84, + .glocont_endpoint = -1, + .calculate_baud_rate = keyspan_usa28_calc_baud, + .baudclk = KEYSPAN_USA19_BAUDCLK, }; static const struct keyspan_device_details usa19qw_device_details = { - product_id: keyspan_usa19qw_product_id, - msg_format: msg_usa26, - num_ports: 1, - indat_endp_flip: 0, - outdat_endp_flip: 1, - indat_endpoints: {0x81}, - outdat_endpoints: {0x01}, - inack_endpoints: {0x85}, - outcont_endpoints: {0x05}, - instat_endpoint: 0x87, - glocont_endpoint: 0x07, - calculate_baud_rate: keyspan_usa19w_calc_baud, - baudclk: KEYSPAN_USA19W_BAUDCLK, + .product_id = keyspan_usa19qw_product_id, + .msg_format = msg_usa26, + .num_ports = 1, + .indat_endp_flip = 0, + .outdat_endp_flip = 1, + .indat_endpoints = {0x81}, + .outdat_endpoints = {0x01}, + .inack_endpoints = {0x85}, + .outcont_endpoints = {0x05}, + .instat_endpoint = 0x87, + .glocont_endpoint = 0x07, + .calculate_baud_rate = keyspan_usa19w_calc_baud, + .baudclk = KEYSPAN_USA19W_BAUDCLK, }; static const struct keyspan_device_details usa19w_device_details = { - product_id: keyspan_usa19w_product_id, - msg_format: msg_usa26, - num_ports: 1, - indat_endp_flip: 0, - outdat_endp_flip: 1, - indat_endpoints: {0x81}, - outdat_endpoints: {0x01}, - inack_endpoints: {0x85}, - outcont_endpoints: {0x05}, - instat_endpoint: 0x87, - glocont_endpoint: 0x07, - calculate_baud_rate: keyspan_usa19w_calc_baud, - baudclk: KEYSPAN_USA19W_BAUDCLK, + .product_id = keyspan_usa19w_product_id, + .msg_format = msg_usa26, + .num_ports = 1, + .indat_endp_flip = 0, + .outdat_endp_flip = 1, + .indat_endpoints = {0x81}, + .outdat_endpoints = {0x01}, + .inack_endpoints = {0x85}, + .outcont_endpoints = {0x05}, + .instat_endpoint = 0x87, + .glocont_endpoint = 0x07, + .calculate_baud_rate = keyspan_usa19w_calc_baud, + .baudclk = KEYSPAN_USA19W_BAUDCLK, }; static const struct keyspan_device_details usa28_device_details = { - product_id: keyspan_usa28_product_id, - msg_format: msg_usa28, - num_ports: 2, - indat_endp_flip: 1, - outdat_endp_flip: 1, - indat_endpoints: {0x81, 0x83}, - outdat_endpoints: {0x01, 0x03}, - inack_endpoints: {0x85, 0x86}, - outcont_endpoints: {0x05, 0x06}, - instat_endpoint: 0x87, - glocont_endpoint: 0x07, - calculate_baud_rate: keyspan_usa28_calc_baud, - baudclk: KEYSPAN_USA28_BAUDCLK, + .product_id = keyspan_usa28_product_id, + .msg_format = msg_usa28, + .num_ports = 2, + .indat_endp_flip = 1, + .outdat_endp_flip = 1, + .indat_endpoints = {0x81, 0x83}, + .outdat_endpoints = {0x01, 0x03}, + .inack_endpoints = {0x85, 0x86}, + .outcont_endpoints = {0x05, 0x06}, + .instat_endpoint = 0x87, + .glocont_endpoint = 0x07, + .calculate_baud_rate = keyspan_usa28_calc_baud, + .baudclk = KEYSPAN_USA28_BAUDCLK, }; static const struct keyspan_device_details usa28x_device_details = { - product_id: keyspan_usa28x_product_id, - msg_format: msg_usa26, - num_ports: 2, - indat_endp_flip: 0, - outdat_endp_flip: 1, - indat_endpoints: {0x81, 0x83}, - outdat_endpoints: {0x01, 0x03}, - inack_endpoints: {0x85, 0x86}, - outcont_endpoints: {0x05, 0x06}, - instat_endpoint: 0x87, - glocont_endpoint: 0x07, - calculate_baud_rate: keyspan_usa19w_calc_baud, - baudclk: KEYSPAN_USA28X_BAUDCLK, + .product_id = keyspan_usa28x_product_id, + .msg_format = msg_usa26, + .num_ports = 2, + .indat_endp_flip = 0, + .outdat_endp_flip = 1, + .indat_endpoints = {0x81, 0x83}, + .outdat_endpoints = {0x01, 0x03}, + .inack_endpoints = {0x85, 0x86}, + .outcont_endpoints = {0x05, 0x06}, + .instat_endpoint = 0x87, + .glocont_endpoint = 0x07, + .calculate_baud_rate = keyspan_usa19w_calc_baud, + .baudclk = KEYSPAN_USA28X_BAUDCLK, }; static const struct keyspan_device_details usa28xa_device_details = { - product_id: keyspan_usa28xa_product_id, - msg_format: msg_usa26, - num_ports: 2, - indat_endp_flip: 0, - outdat_endp_flip: 1, - indat_endpoints: {0x81, 0x83}, - outdat_endpoints: {0x01, 0x03}, - inack_endpoints: {0x85, 0x86}, - outcont_endpoints: {0x05, 0x06}, - instat_endpoint: 0x87, - glocont_endpoint: 0x07, - calculate_baud_rate: keyspan_usa19w_calc_baud, - baudclk: KEYSPAN_USA28X_BAUDCLK, + .product_id = keyspan_usa28xa_product_id, + .msg_format = msg_usa26, + .num_ports = 2, + .indat_endp_flip = 0, + .outdat_endp_flip = 1, + .indat_endpoints = {0x81, 0x83}, + .outdat_endpoints = {0x01, 0x03}, + .inack_endpoints = {0x85, 0x86}, + .outcont_endpoints = {0x05, 0x06}, + .instat_endpoint = 0x87, + .glocont_endpoint = 0x07, + .calculate_baud_rate = keyspan_usa19w_calc_baud, + .baudclk = KEYSPAN_USA28X_BAUDCLK, }; /* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */ static const struct keyspan_device_details usa49w_device_details = { - product_id: keyspan_usa49w_product_id, - msg_format: msg_usa49, - num_ports: 4, - indat_endp_flip: 0, - outdat_endp_flip: 0, - indat_endpoints: {0x81, 0x82, 0x83, 0x84}, - outdat_endpoints: {0x01, 0x02, 0x03, 0x04}, - inack_endpoints: {-1, -1, -1, -1}, - outcont_endpoints: {-1, -1, -1, -1}, - instat_endpoint: 0x87, - glocont_endpoint: 0x07, - calculate_baud_rate: keyspan_usa19w_calc_baud, - baudclk: KEYSPAN_USA49W_BAUDCLK, + .product_id = keyspan_usa49w_product_id, + .msg_format = msg_usa49, + .num_ports = 4, + .indat_endp_flip = 0, + .outdat_endp_flip = 0, + .indat_endpoints = {0x81, 0x82, 0x83, 0x84}, + .outdat_endpoints = {0x01, 0x02, 0x03, 0x04}, + .inack_endpoints = {-1, -1, -1, -1}, + .outcont_endpoints = {-1, -1, -1, -1}, + .instat_endpoint = 0x87, + .glocont_endpoint = 0x07, + .calculate_baud_rate = keyspan_usa19w_calc_baud, + .baudclk = KEYSPAN_USA49W_BAUDCLK, }; static const struct keyspan_device_details *keyspan_devices[] = { @@ -479,80 +479,80 @@ /* Structs for the devices, pre and post renumeration. */ static struct usb_serial_device_type keyspan_pre_device = { - owner: THIS_MODULE, - name: "Keyspan - (without firmware)", - id_table: keyspan_pre_ids, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 1, - attach: keyspan_fake_startup, + .owner = THIS_MODULE, + .name = "Keyspan - (without firmware)", + .id_table = keyspan_pre_ids, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, + .num_ports = 1, + .attach = keyspan_fake_startup, }; static struct usb_serial_device_type keyspan_1port_device = { - owner: THIS_MODULE, - name: "Keyspan 1 port adapter", - id_table: keyspan_1port_ids, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: 3, - num_bulk_out: 4, - num_ports: 1, - open: keyspan_open, - close: keyspan_close, - write: keyspan_write, - write_room: keyspan_write_room, - chars_in_buffer: keyspan_chars_in_buffer, - throttle: keyspan_rx_throttle, - unthrottle: keyspan_rx_unthrottle, - ioctl: keyspan_ioctl, - set_termios: keyspan_set_termios, - break_ctl: keyspan_break_ctl, - attach: keyspan_startup, - shutdown: keyspan_shutdown, + .owner = THIS_MODULE, + .name = "Keyspan 1 port adapter", + .id_table = keyspan_1port_ids, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = 3, + .num_bulk_out = 4, + .num_ports = 1, + .open = keyspan_open, + .close = keyspan_close, + .write = keyspan_write, + .write_room = keyspan_write_room, + .chars_in_buffer = keyspan_chars_in_buffer, + .throttle = keyspan_rx_throttle, + .unthrottle = keyspan_rx_unthrottle, + .ioctl = keyspan_ioctl, + .set_termios = keyspan_set_termios, + .break_ctl = keyspan_break_ctl, + .attach = keyspan_startup, + .shutdown = keyspan_shutdown, }; static struct usb_serial_device_type keyspan_2port_device = { - owner: THIS_MODULE, - name: "Keyspan 2 port adapter", - id_table: keyspan_2port_ids, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 2, - open: keyspan_open, - close: keyspan_close, - write: keyspan_write, - write_room: keyspan_write_room, - chars_in_buffer: keyspan_chars_in_buffer, - throttle: keyspan_rx_throttle, - unthrottle: keyspan_rx_unthrottle, - ioctl: keyspan_ioctl, - set_termios: keyspan_set_termios, - break_ctl: keyspan_break_ctl, - attach: keyspan_startup, - shutdown: keyspan_shutdown, + .owner = THIS_MODULE, + .name = "Keyspan 2 port adapter", + .id_table = keyspan_2port_ids, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, + .num_ports = 2, + .open = keyspan_open, + .close = keyspan_close, + .write = keyspan_write, + .write_room = keyspan_write_room, + .chars_in_buffer = keyspan_chars_in_buffer, + .throttle = keyspan_rx_throttle, + .unthrottle = keyspan_rx_unthrottle, + .ioctl = keyspan_ioctl, + .set_termios = keyspan_set_termios, + .break_ctl = keyspan_break_ctl, + .attach = keyspan_startup, + .shutdown = keyspan_shutdown, }; static struct usb_serial_device_type keyspan_4port_device = { - owner: THIS_MODULE, - name: "Keyspan 4 port adapter", - id_table: keyspan_4port_ids, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: 5, - num_bulk_out: 5, - num_ports: 4, - open: keyspan_open, - close: keyspan_close, - write: keyspan_write, - write_room: keyspan_write_room, - chars_in_buffer: keyspan_chars_in_buffer, - throttle: keyspan_rx_throttle, - unthrottle: keyspan_rx_unthrottle, - ioctl: keyspan_ioctl, - set_termios: keyspan_set_termios, - break_ctl: keyspan_break_ctl, - attach: keyspan_startup, - shutdown: keyspan_shutdown, + .owner = THIS_MODULE, + .name = "Keyspan 4 port adapter", + .id_table = keyspan_4port_ids, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = 5, + .num_bulk_out = 5, + .num_ports = 4, + .open = keyspan_open, + .close = keyspan_close, + .write = keyspan_write, + .write_room = keyspan_write_room, + .chars_in_buffer = keyspan_chars_in_buffer, + .throttle = keyspan_rx_throttle, + .unthrottle = keyspan_rx_unthrottle, + .ioctl = keyspan_ioctl, + .set_termios = keyspan_set_termios, + .break_ctl = keyspan_break_ctl, + .attach = keyspan_startup, + .shutdown = keyspan_shutdown, }; #endif