Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: ipack: Move device ids from ipoctal.c to ipack_ids.h.

Rename them in the process.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jens Taprogge and committed by
Greg Kroah-Hartman
7db5e3cb e8ed3276

+16 -15
+11 -15
drivers/staging/ipack/devices/ipoctal.c
··· 25 25 #include "ipoctal.h" 26 26 #include "scc2698.h" 27 27 28 - #define IP_OCTAL_MANUFACTURER_ID 0xF0 29 - #define IP_OCTAL_232_ID 0x22 30 - #define IP_OCTAL_422_ID 0x2A 31 - #define IP_OCTAL_485_ID 0x48 32 - 33 28 #define IP_OCTAL_ID_SPACE_VECTOR 0x41 34 29 #define IP_OCTAL_NB_BLOCKS 4 35 30 ··· 226 231 /* In case of RS-485, change from TX to RX when finishing TX. 227 232 * Half-duplex. 228 233 */ 229 - if ((ipoctal->board_id == IP_OCTAL_485_ID) && 234 + if ((ipoctal->board_id == IPACK1_DEVICE_ID_SBS_OCTAL_485) && 230 235 (sr & SR_TX_EMPTY) && 231 236 (ipoctal->nb_bytes[channel] == 0)) { 232 237 ipoctal_write_io_reg(ipoctal, ··· 299 304 if ((ipoctal->nb_bytes[channel] == 0) && 300 305 (waitqueue_active(&ipoctal->queue[channel]))) { 301 306 302 - if (ipoctal->board_id != IP_OCTAL_485_ID) { 307 + if (ipoctal->board_id != IPACK1_DEVICE_ID_SBS_OCTAL_485) { 303 308 ipoctal->write = 1; 304 309 wake_up_interruptible(&ipoctal->queue[channel]); 305 310 } ··· 317 322 unsigned char manufacturerID; 318 323 unsigned char board_id; 319 324 325 + 320 326 manufacturerID = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MANUFACTURER_ID); 321 - if (manufacturerID != IP_OCTAL_MANUFACTURER_ID) 327 + if (manufacturerID != IPACK1_VENDOR_ID_SBS) 322 328 return -ENODEV; 323 329 324 330 board_id = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MODEL); 325 331 switch (board_id) { 326 - case IP_OCTAL_232_ID: 327 - case IP_OCTAL_422_ID: 328 - case IP_OCTAL_485_ID: 332 + case IPACK1_DEVICE_ID_SBS_OCTAL_232: 333 + case IPACK1_DEVICE_ID_SBS_OCTAL_422: 334 + case IPACK1_DEVICE_ID_SBS_OCTAL_485: 329 335 *id = board_id; 330 336 break; 331 337 default: ··· 539 543 ipoctal_copy_write_buffer(ipoctal, channel, buf, count); 540 544 541 545 /* As the IP-OCTAL 485 only supports half duplex, do it manually */ 542 - if (ipoctal->board_id == IP_OCTAL_485_ID) { 546 + if (ipoctal->board_id == IPACK1_DEVICE_ID_SBS_OCTAL_485) { 543 547 ipoctal_write_io_reg(ipoctal, 544 548 &ipoctal->chan_regs[channel].w.cr, 545 549 CR_DISABLE_RX); ··· 650 654 651 655 /* Set the flow control */ 652 656 switch (ipoctal->board_id) { 653 - case IP_OCTAL_232_ID: 657 + case IPACK1_DEVICE_ID_SBS_OCTAL_232: 654 658 if (cflag & CRTSCTS) { 655 659 mr1 |= MR1_RxRTS_CONTROL_ON; 656 660 mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_ON; ··· 659 663 mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_OFF; 660 664 } 661 665 break; 662 - case IP_OCTAL_422_ID: 666 + case IPACK1_DEVICE_ID_SBS_OCTAL_422: 663 667 mr1 |= MR1_RxRTS_CONTROL_OFF; 664 668 mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_OFF; 665 669 break; 666 - case IP_OCTAL_485_ID: 670 + case IPACK1_DEVICE_ID_SBS_OCTAL_485: 667 671 mr1 |= MR1_RxRTS_CONTROL_OFF; 668 672 mr2 |= MR2_TxRTS_CONTROL_ON | MR2_CTS_ENABLE_TX_OFF; 669 673 break;
+5
drivers/staging/ipack/ipack_ids.h
··· 25 25 #define IPACK1_VENDOR_ID_UNREGISTRED13 0x0D 26 26 #define IPACK1_VENDOR_ID_UNREGISTRED14 0x0E 27 27 #define IPACK1_VENDOR_ID_UNREGISTRED15 0x0F 28 + 29 + #define IPACK1_VENDOR_ID_SBS 0xF0 30 + #define IPACK1_DEVICE_ID_SBS_OCTAL_232 0x22 31 + #define IPACK1_DEVICE_ID_SBS_OCTAL_422 0x2A 32 + #define IPACK1_DEVICE_ID_SBS_OCTAL_485 0x48