can: c_can: Modify c_can device names
authorAnilKumar Ch <anilkumar@ti.com>
Thu, 2 Aug 2012 13:13:09 +0000 (18:43 +0530)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 21 Sep 2012 21:58:47 +0000 (23:58 +0200)
Modify c_can device names from *_CAN_DEVTYPE to BOSCH_*_CAN to make
use of same names for array indexes in c_can_id_table[] as well as
device names.

This patch also add indexes to c_can_id_table array.

Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/c_can/c_can.h
drivers/net/can/c_can/c_can_pci.c
drivers/net/can/c_can/c_can_platform.c

index 01a7049ab990eacd173c76edecede0b912e14382..4e56baa9c2da28d386f314ed1e7ad37a088f065e 100644 (file)
@@ -143,8 +143,9 @@ static const u16 reg_map_d_can[] = {
 };
 
 enum c_can_dev_id {
-       C_CAN_DEVTYPE,
-       D_CAN_DEVTYPE,
+       BOSCH_C_CAN_PLATFORM,
+       BOSCH_C_CAN,
+       BOSCH_D_CAN,
 };
 
 /* c_can private data structure */
index 1011146ea51319accbdcf6658d9c22de723e3be7..3d7830bcd2bf83fa55346754f74c2205eae4b3f7 100644 (file)
@@ -120,10 +120,10 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
 
        /* Configure CAN type */
        switch (c_can_pci_data->type) {
-       case C_CAN_DEVTYPE:
+       case BOSCH_C_CAN:
                priv->regs = reg_map_c_can;
                break;
-       case D_CAN_DEVTYPE:
+       case BOSCH_D_CAN:
                priv->regs = reg_map_d_can;
                priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
                break;
@@ -192,7 +192,7 @@ static void __devexit c_can_pci_remove(struct pci_dev *pdev)
 }
 
 static struct c_can_pci_data c_can_sta2x11= {
-       .type = C_CAN_DEVTYPE,
+       .type = BOSCH_C_CAN,
        .reg_align = C_CAN_REG_ALIGN_32,
        .freq = 52000000, /* 52 Mhz */
 };
index 6ff7ad006c300b5a9c499e6bf3465e4cb8b7f2bc..5c46d1cc5cf576613abe858cc29baeb046875c1e 100644 (file)
@@ -116,7 +116,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
        priv = netdev_priv(dev);
        id = platform_get_device_id(pdev);
        switch (id->driver_data) {
-       case C_CAN_DEVTYPE:
+       case BOSCH_C_CAN:
                priv->regs = reg_map_c_can;
                switch (mem->flags & IORESOURCE_MEM_TYPE_MASK) {
                case IORESOURCE_MEM_32BIT:
@@ -130,7 +130,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
                        break;
                }
                break;
-       case D_CAN_DEVTYPE:
+       case BOSCH_D_CAN:
                priv->regs = reg_map_d_can;
                priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
                priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;
@@ -196,15 +196,17 @@ static int __devexit c_can_plat_remove(struct platform_device *pdev)
 }
 
 static const struct platform_device_id c_can_id_table[] = {
-       {
+       [BOSCH_C_CAN_PLATFORM] = {
                .name = KBUILD_MODNAME,
-               .driver_data = C_CAN_DEVTYPE,
-       }, {
+               .driver_data = BOSCH_C_CAN,
+       },
+       [BOSCH_C_CAN] = {
                .name = "c_can",
-               .driver_data = C_CAN_DEVTYPE,
-       }, {
+               .driver_data = BOSCH_C_CAN,
+       },
+       [BOSCH_D_CAN] = {
                .name = "d_can",
-               .driver_data = D_CAN_DEVTYPE,
+               .driver_data = BOSCH_D_CAN,
        }, {
        }
 };