~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/s390/net/ctcm_main.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#define KMSG_COMPONENT "ctcm"
25
25
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
26
26
 
 
27
#include <linux/kernel_stat.h>
27
28
#include <linux/module.h>
28
29
#include <linux/init.h>
29
30
#include <linux/kernel.h>
51
52
 
52
53
#include <asm/idals.h>
53
54
 
54
 
#include "cu3088.h"
55
55
#include "ctcm_fsms.h"
56
56
#include "ctcm_main.h"
57
57
 
58
58
/* Some common global variables */
59
59
 
 
60
/**
 
61
 * The root device for ctcm group devices
 
62
 */
 
63
static struct device *ctcm_root_dev;
 
64
 
60
65
/*
61
66
 * Linked list of all detected channels.
62
67
 */
246
251
 *
247
252
 * returns Pointer to a channel or NULL if no matching channel available.
248
253
 */
249
 
static struct channel *channel_get(enum channel_types type,
 
254
static struct channel *channel_get(enum ctcm_channel_types type,
250
255
                                        char *id, int direction)
251
256
{
252
257
        struct channel *ch = channels;
263
268
                else {
264
269
                        ch->flags |= CHANNEL_FLAGS_INUSE;
265
270
                        ch->flags &= ~CHANNEL_FLAGS_RWMASK;
266
 
                        ch->flags |= (direction == WRITE)
 
271
                        ch->flags |= (direction == CTCM_WRITE)
267
272
                            ? CHANNEL_FLAGS_WRITE : CHANNEL_FLAGS_READ;
268
273
                        fsm_newstate(ch->fsm, CTC_STATE_STOPPED);
269
274
                }
384
389
                CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR,
385
390
                        "%s(%s): %s trans_skb allocation error",
386
391
                        CTCM_FUNTAIL, ch->id,
387
 
                        (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX");
 
392
                        (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ?
 
393
                                "RX" : "TX");
388
394
                return -ENOMEM;
389
395
        }
390
396
 
395
401
                CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR,
396
402
                        "%s(%s): %s set norm_cda failed",
397
403
                        CTCM_FUNTAIL, ch->id,
398
 
                        (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX");
 
404
                        (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ?
 
405
                                "RX" : "TX");
399
406
                return -ENOMEM;
400
407
        }
401
408
 
599
606
 
600
607
        priv = dev->ml_priv;
601
608
        grp = priv->mpcg;
602
 
        ch = priv->channel[WRITE];
 
609
        ch = priv->channel[CTCM_WRITE];
603
610
 
604
611
        /* sweep processing is not complete until response and request */
605
612
        /* has completed for all read channels in group                */
606
613
        if (grp->in_sweep == 0) {
607
614
                grp->in_sweep = 1;
608
 
                grp->sweep_rsp_pend_num = grp->active_channels[READ];
609
 
                grp->sweep_req_pend_num = grp->active_channels[READ];
 
615
                grp->sweep_rsp_pend_num = grp->active_channels[CTCM_READ];
 
616
                grp->sweep_req_pend_num = grp->active_channels[CTCM_READ];
610
617
        }
611
618
 
612
619
        sweep_skb = __dev_alloc_skb(MPC_BUFSIZE_DEFAULT, GFP_ATOMIC|GFP_DMA);
907
914
                return NETDEV_TX_BUSY;
908
915
 
909
916
        dev->trans_start = jiffies;
910
 
        if (ctcm_transmit_skb(priv->channel[WRITE], skb) != 0)
 
917
        if (ctcm_transmit_skb(priv->channel[CTCM_WRITE], skb) != 0)
911
918
                return NETDEV_TX_BUSY;
912
919
        return NETDEV_TX_OK;
913
920
}
990
997
        }
991
998
 
992
999
        dev->trans_start = jiffies;
993
 
        if (ctcmpc_transmit_skb(priv->channel[WRITE], skb) != 0) {
 
1000
        if (ctcmpc_transmit_skb(priv->channel[CTCM_WRITE], skb) != 0) {
994
1001
                CTCM_DBF_TEXT_(MPC_ERROR, CTC_DBF_ERROR,
995
1002
                        "%s(%s): device error - dropped",
996
1003
                                        CTCM_FUNTAIL, dev->name);
1031
1038
                return -EINVAL;
1032
1039
 
1033
1040
        priv = dev->ml_priv;
1034
 
        max_bufsize = priv->channel[READ]->max_bufsize;
 
1041
        max_bufsize = priv->channel[CTCM_READ]->max_bufsize;
1035
1042
 
1036
1043
        if (IS_MPC(priv)) {
1037
1044
                if (new_mtu > max_bufsize - TH_HEADER_LENGTH)
1148
1155
                                dev_fsm, dev_fsm_len, GFP_KERNEL);
1149
1156
        if (priv->fsm == NULL) {
1150
1157
                CTCMY_DBF_DEV(SETUP, dev, "init_fsm error");
1151
 
                kfree(dev);
 
1158
                free_netdev(dev);
1152
1159
                return NULL;
1153
1160
        }
1154
1161
        fsm_newstate(priv->fsm, DEV_STATE_STOPPED);
1159
1166
                grp = ctcmpc_init_mpc_group(priv);
1160
1167
                if (grp == NULL) {
1161
1168
                        MPC_DBF_DEV(SETUP, dev, "init_mpc_group error");
1162
 
                        kfree(dev);
 
1169
                        free_netdev(dev);
1163
1170
                        return NULL;
1164
1171
                }
1165
1172
                tasklet_init(&grp->mpc_tasklet2,
1198
1205
        int cstat;
1199
1206
        int dstat;
1200
1207
 
 
1208
        kstat_cpu(smp_processor_id()).irqs[IOINT_CTC]++;
1201
1209
        CTCM_DBF_TEXT_(TRACE, CTC_DBF_DEBUG,
1202
1210
                "Enter %s(%s)", CTCM_FUNTAIL, dev_name(&cdev->dev));
1203
1211
 
1222
1230
        priv = dev_get_drvdata(&cgdev->dev);
1223
1231
 
1224
1232
        /* Try to extract channel from driver data. */
1225
 
        if (priv->channel[READ]->cdev == cdev)
1226
 
                ch = priv->channel[READ];
1227
 
        else if (priv->channel[WRITE]->cdev == cdev)
1228
 
                ch = priv->channel[WRITE];
 
1233
        if (priv->channel[CTCM_READ]->cdev == cdev)
 
1234
                ch = priv->channel[CTCM_READ];
 
1235
        else if (priv->channel[CTCM_WRITE]->cdev == cdev)
 
1236
                ch = priv->channel[CTCM_WRITE];
1229
1237
        else {
1230
1238
                dev_err(&cdev->dev,
1231
1239
                        "%s: Internal error: Can't determine channel for "
1342
1350
 *
1343
1351
 * returns 0 on success, !0 on error.
1344
1352
 */
1345
 
static int add_channel(struct ccw_device *cdev, enum channel_types type,
 
1353
static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type,
1346
1354
                                struct ctcm_priv *priv)
1347
1355
{
1348
1356
        struct channel **c = &channels;
1360
1368
 
1361
1369
        ch->protocol = priv->protocol;
1362
1370
        if (IS_MPC(priv)) {
1363
 
                ch->discontact_th = (struct th_header *)
1364
 
                                kzalloc(TH_HEADER_LENGTH, gfp_type());
 
1371
                ch->discontact_th = kzalloc(TH_HEADER_LENGTH, gfp_type());
1365
1372
                if (ch->discontact_th == NULL)
1366
1373
                                        goto nomem_return;
1367
1374
 
1375
1382
        } else
1376
1383
                ccw_num = 8;
1377
1384
 
1378
 
        ch->ccw = (struct ccw1 *)
1379
 
                kzalloc(ccw_num * sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
 
1385
        ch->ccw = kzalloc(ccw_num * sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
1380
1386
        if (ch->ccw == NULL)
1381
1387
                                        goto nomem_return;
1382
1388
 
1501
1507
/*
1502
1508
 * Return type of a detected device.
1503
1509
 */
1504
 
static enum channel_types get_channel_type(struct ccw_device_id *id)
 
1510
static enum ctcm_channel_types get_channel_type(struct ccw_device_id *id)
1505
1511
{
1506
 
        enum channel_types type;
1507
 
        type = (enum channel_types)id->driver_info;
 
1512
        enum ctcm_channel_types type;
 
1513
        type = (enum ctcm_channel_types)id->driver_info;
1508
1514
 
1509
 
        if (type == channel_type_ficon)
1510
 
                type = channel_type_escon;
 
1515
        if (type == ctcm_channel_type_ficon)
 
1516
                type = ctcm_channel_type_escon;
1511
1517
 
1512
1518
        return type;
1513
1519
}
1525
1531
        char read_id[CTCM_ID_SIZE];
1526
1532
        char write_id[CTCM_ID_SIZE];
1527
1533
        int direction;
1528
 
        enum channel_types type;
 
1534
        enum ctcm_channel_types type;
1529
1535
        struct ctcm_priv *priv;
1530
1536
        struct net_device *dev;
1531
1537
        struct ccw_device *cdev0;
1532
1538
        struct ccw_device *cdev1;
 
1539
        struct channel *readc;
 
1540
        struct channel *writec;
1533
1541
        int ret;
 
1542
        int result;
1534
1543
 
1535
1544
        priv = dev_get_drvdata(&cgdev->dev);
1536
 
        if (!priv)
1537
 
                return -ENODEV;
 
1545
        if (!priv) {
 
1546
                result = -ENODEV;
 
1547
                goto out_err_result;
 
1548
        }
1538
1549
 
1539
1550
        cdev0 = cgdev->cdev[0];
1540
1551
        cdev1 = cgdev->cdev[1];
1545
1556
        snprintf(write_id, CTCM_ID_SIZE, "ch-%s", dev_name(&cdev1->dev));
1546
1557
 
1547
1558
        ret = add_channel(cdev0, type, priv);
1548
 
        if (ret)
1549
 
                return ret;
 
1559
        if (ret) {
 
1560
                result = ret;
 
1561
                goto out_err_result;
 
1562
        }
1550
1563
        ret = add_channel(cdev1, type, priv);
1551
 
        if (ret)
1552
 
                return ret;
 
1564
        if (ret) {
 
1565
                result = ret;
 
1566
                goto out_remove_channel1;
 
1567
        }
1553
1568
 
1554
1569
        ret = ccw_device_set_online(cdev0);
1555
1570
        if (ret != 0) {
1556
 
                /* may be ok to fail now - can be done later */
1557
1571
                CTCM_DBF_TEXT_(TRACE, CTC_DBF_NOTICE,
1558
1572
                        "%s(%s) set_online rc=%d",
1559
1573
                                CTCM_FUNTAIL, read_id, ret);
 
1574
                result = -EIO;
 
1575
                goto out_remove_channel2;
1560
1576
        }
1561
1577
 
1562
1578
        ret = ccw_device_set_online(cdev1);
1563
1579
        if (ret != 0) {
1564
 
                /* may be ok to fail now - can be done later */
1565
1580
                CTCM_DBF_TEXT_(TRACE, CTC_DBF_NOTICE,
1566
1581
                        "%s(%s) set_online rc=%d",
1567
1582
                                CTCM_FUNTAIL, write_id, ret);
 
1583
 
 
1584
                result = -EIO;
 
1585
                goto out_ccw1;
1568
1586
        }
1569
1587
 
1570
1588
        dev = ctcm_init_netdevice(priv);
1571
 
        if (dev == NULL)
1572
 
                        goto out;
 
1589
        if (dev == NULL) {
 
1590
                result = -ENODEV;
 
1591
                goto out_ccw2;
 
1592
        }
1573
1593
 
1574
 
        for (direction = READ; direction <= WRITE; direction++) {
 
1594
        for (direction = CTCM_READ; direction <= CTCM_WRITE; direction++) {
1575
1595
                priv->channel[direction] =
1576
 
                    channel_get(type, direction == READ ? read_id : write_id,
1577
 
                                direction);
 
1596
                        channel_get(type, direction == CTCM_READ ?
 
1597
                                read_id : write_id, direction);
1578
1598
                if (priv->channel[direction] == NULL) {
1579
 
                        if (direction == WRITE)
1580
 
                                channel_free(priv->channel[READ]);
 
1599
                        if (direction == CTCM_WRITE)
 
1600
                                channel_free(priv->channel[CTCM_READ]);
1581
1601
                        goto out_dev;
1582
1602
                }
1583
1603
                priv->channel[direction]->netdev = dev;
1587
1607
        /* sysfs magic */
1588
1608
        SET_NETDEV_DEV(dev, &cgdev->dev);
1589
1609
 
1590
 
        if (register_netdev(dev))
1591
 
                        goto out_dev;
 
1610
        if (register_netdev(dev)) {
 
1611
                result = -ENODEV;
 
1612
                goto out_dev;
 
1613
        }
1592
1614
 
1593
1615
        if (ctcm_add_attributes(&cgdev->dev)) {
1594
 
                unregister_netdev(dev);
1595
 
                        goto out_dev;
 
1616
                result = -ENODEV;
 
1617
                goto out_unregister;
1596
1618
        }
1597
1619
 
1598
1620
        strlcpy(priv->fsm->name, dev->name, sizeof(priv->fsm->name));
1599
1621
 
1600
1622
        dev_info(&dev->dev,
1601
1623
                "setup OK : r/w = %s/%s, protocol : %d\n",
1602
 
                        priv->channel[READ]->id,
1603
 
                        priv->channel[WRITE]->id, priv->protocol);
 
1624
                        priv->channel[CTCM_READ]->id,
 
1625
                        priv->channel[CTCM_WRITE]->id, priv->protocol);
1604
1626
 
1605
1627
        CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO,
1606
1628
                "setup(%s) OK : r/w = %s/%s, protocol : %d", dev->name,
1607
 
                        priv->channel[READ]->id,
1608
 
                        priv->channel[WRITE]->id, priv->protocol);
 
1629
                        priv->channel[CTCM_READ]->id,
 
1630
                        priv->channel[CTCM_WRITE]->id, priv->protocol);
1609
1631
 
1610
1632
        return 0;
 
1633
out_unregister:
 
1634
        unregister_netdev(dev);
1611
1635
out_dev:
1612
1636
        ctcm_free_netdevice(dev);
1613
 
out:
 
1637
out_ccw2:
1614
1638
        ccw_device_set_offline(cgdev->cdev[1]);
 
1639
out_ccw1:
1615
1640
        ccw_device_set_offline(cgdev->cdev[0]);
1616
 
 
1617
 
        return -ENODEV;
 
1641
out_remove_channel2:
 
1642
        readc = channel_get(type, read_id, CTCM_READ);
 
1643
        channel_remove(readc);
 
1644
out_remove_channel1:
 
1645
        writec = channel_get(type, write_id, CTCM_WRITE);
 
1646
        channel_remove(writec);
 
1647
out_err_result:
 
1648
        return result;
1618
1649
}
1619
1650
 
1620
1651
/**
1633
1664
        if (!priv)
1634
1665
                return -ENODEV;
1635
1666
 
1636
 
        if (priv->channel[READ]) {
1637
 
                dev = priv->channel[READ]->netdev;
 
1667
        if (priv->channel[CTCM_READ]) {
 
1668
                dev = priv->channel[CTCM_READ]->netdev;
1638
1669
                CTCM_DBF_DEV(SETUP, dev, "");
1639
1670
                /* Close the device */
1640
1671
                ctcm_close(dev);
1641
1672
                dev->flags &= ~IFF_RUNNING;
1642
1673
                ctcm_remove_attributes(&cgdev->dev);
1643
 
                channel_free(priv->channel[READ]);
 
1674
                channel_free(priv->channel[CTCM_READ]);
1644
1675
        } else
1645
1676
                dev = NULL;
1646
1677
 
1647
 
        if (priv->channel[WRITE])
1648
 
                channel_free(priv->channel[WRITE]);
 
1678
        if (priv->channel[CTCM_WRITE])
 
1679
                channel_free(priv->channel[CTCM_WRITE]);
1649
1680
 
1650
1681
        if (dev) {
1651
1682
                unregister_netdev(dev);
1658
1689
        ccw_device_set_offline(cgdev->cdev[1]);
1659
1690
        ccw_device_set_offline(cgdev->cdev[0]);
1660
1691
 
1661
 
        if (priv->channel[READ])
1662
 
                channel_remove(priv->channel[READ]);
1663
 
        if (priv->channel[WRITE])
1664
 
                channel_remove(priv->channel[WRITE]);
1665
 
        priv->channel[READ] = priv->channel[WRITE] = NULL;
 
1692
        if (priv->channel[CTCM_READ])
 
1693
                channel_remove(priv->channel[CTCM_READ]);
 
1694
        if (priv->channel[CTCM_WRITE])
 
1695
                channel_remove(priv->channel[CTCM_WRITE]);
 
1696
        priv->channel[CTCM_READ] = priv->channel[CTCM_WRITE] = NULL;
1666
1697
 
1667
1698
        return 0;
1668
1699
 
1693
1724
 
1694
1725
        if (gdev->state == CCWGROUP_OFFLINE)
1695
1726
                return 0;
1696
 
        netif_device_detach(priv->channel[READ]->netdev);
1697
 
        ctcm_close(priv->channel[READ]->netdev);
 
1727
        netif_device_detach(priv->channel[CTCM_READ]->netdev);
 
1728
        ctcm_close(priv->channel[CTCM_READ]->netdev);
 
1729
        if (!wait_event_timeout(priv->fsm->wait_q,
 
1730
            fsm_getstate(priv->fsm) == DEV_STATE_STOPPED, CTCM_TIME_5_SEC)) {
 
1731
                netif_device_attach(priv->channel[CTCM_READ]->netdev);
 
1732
                return -EBUSY;
 
1733
        }
1698
1734
        ccw_device_set_offline(gdev->cdev[1]);
1699
1735
        ccw_device_set_offline(gdev->cdev[0]);
1700
1736
        return 0;
1713
1749
        rc = ccw_device_set_online(gdev->cdev[0]);
1714
1750
        if (rc)
1715
1751
                goto err_out;
1716
 
        ctcm_open(priv->channel[READ]->netdev);
 
1752
        ctcm_open(priv->channel[CTCM_READ]->netdev);
1717
1753
err_out:
1718
 
        netif_device_attach(priv->channel[READ]->netdev);
 
1754
        netif_device_attach(priv->channel[CTCM_READ]->netdev);
1719
1755
        return rc;
1720
1756
}
1721
1757
 
 
1758
static struct ccw_device_id ctcm_ids[] = {
 
1759
        {CCW_DEVICE(0x3088, 0x08), .driver_info = ctcm_channel_type_parallel},
 
1760
        {CCW_DEVICE(0x3088, 0x1e), .driver_info = ctcm_channel_type_ficon},
 
1761
        {CCW_DEVICE(0x3088, 0x1f), .driver_info = ctcm_channel_type_escon},
 
1762
        {},
 
1763
};
 
1764
MODULE_DEVICE_TABLE(ccw, ctcm_ids);
 
1765
 
 
1766
static struct ccw_driver ctcm_ccw_driver = {
 
1767
        .owner  = THIS_MODULE,
 
1768
        .name   = "ctcm",
 
1769
        .ids    = ctcm_ids,
 
1770
        .probe  = ccwgroup_probe_ccwdev,
 
1771
        .remove = ccwgroup_remove_ccwdev,
 
1772
};
 
1773
 
1722
1774
static struct ccwgroup_driver ctcm_group_driver = {
1723
1775
        .owner       = THIS_MODULE,
1724
1776
        .name        = CTC_DRIVER_NAME,
1733
1785
        .restore     = ctcm_pm_resume,
1734
1786
};
1735
1787
 
 
1788
static ssize_t
 
1789
ctcm_driver_group_store(struct device_driver *ddrv, const char *buf,
 
1790
                        size_t count)
 
1791
{
 
1792
        int err;
 
1793
 
 
1794
        err = ccwgroup_create_from_string(ctcm_root_dev,
 
1795
                                          ctcm_group_driver.driver_id,
 
1796
                                          &ctcm_ccw_driver, 2, buf);
 
1797
        return err ? err : count;
 
1798
}
 
1799
 
 
1800
static DRIVER_ATTR(group, 0200, NULL, ctcm_driver_group_store);
 
1801
 
 
1802
static struct attribute *ctcm_group_attrs[] = {
 
1803
        &driver_attr_group.attr,
 
1804
        NULL,
 
1805
};
 
1806
 
 
1807
static struct attribute_group ctcm_group_attr_group = {
 
1808
        .attrs = ctcm_group_attrs,
 
1809
};
 
1810
 
 
1811
static const struct attribute_group *ctcm_group_attr_groups[] = {
 
1812
        &ctcm_group_attr_group,
 
1813
        NULL,
 
1814
};
1736
1815
 
1737
1816
/*
1738
1817
 * Module related routines
1746
1825
 */
1747
1826
static void __exit ctcm_exit(void)
1748
1827
{
1749
 
        unregister_cu3088_discipline(&ctcm_group_driver);
 
1828
        driver_remove_file(&ctcm_group_driver.driver, &driver_attr_group);
 
1829
        ccwgroup_driver_unregister(&ctcm_group_driver);
 
1830
        ccw_driver_unregister(&ctcm_ccw_driver);
 
1831
        root_device_unregister(ctcm_root_dev);
1750
1832
        ctcm_unregister_dbf_views();
1751
1833
        pr_info("CTCM driver unloaded\n");
1752
1834
}
1772
1854
        channels = NULL;
1773
1855
 
1774
1856
        ret = ctcm_register_dbf_views();
1775
 
        if (ret) {
1776
 
                return ret;
1777
 
        }
1778
 
        ret = register_cu3088_discipline(&ctcm_group_driver);
1779
 
        if (ret) {
1780
 
                ctcm_unregister_dbf_views();
1781
 
                pr_err("%s / register_cu3088_discipline failed, ret = %d\n",
1782
 
                        __func__, ret);
1783
 
                return ret;
1784
 
        }
 
1857
        if (ret)
 
1858
                goto out_err;
 
1859
        ctcm_root_dev = root_device_register("ctcm");
 
1860
        ret = IS_ERR(ctcm_root_dev) ? PTR_ERR(ctcm_root_dev) : 0;
 
1861
        if (ret)
 
1862
                goto register_err;
 
1863
        ret = ccw_driver_register(&ctcm_ccw_driver);
 
1864
        if (ret)
 
1865
                goto ccw_err;
 
1866
        ctcm_group_driver.driver.groups = ctcm_group_attr_groups;
 
1867
        ret = ccwgroup_driver_register(&ctcm_group_driver);
 
1868
        if (ret)
 
1869
                goto ccwgroup_err;
1785
1870
        print_banner();
 
1871
        return 0;
 
1872
 
 
1873
ccwgroup_err:
 
1874
        ccw_driver_unregister(&ctcm_ccw_driver);
 
1875
ccw_err:
 
1876
        root_device_unregister(ctcm_root_dev);
 
1877
register_err:
 
1878
        ctcm_unregister_dbf_views();
 
1879
out_err:
 
1880
        pr_err("%s / Initializing the ctcm device driver failed, ret = %d\n",
 
1881
                __func__, ret);
1786
1882
        return ret;
1787
1883
}
1788
1884