diff options
author | Thomas Maier <balagi@justmail.de> | 2006-10-04 05:15:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:13 -0400 |
commit | 7822082d4e054fbdec8cf26590a350e3496c5cc9 (patch) | |
tree | f8731351324ff031b1162626a1f2d745af258ee7 /drivers/block | |
parent | d321765f7cbc2dc0683374c91bb3720d57331d37 (diff) |
[PATCH] pktcdvd: Replace pktcdvd strings with macro DRIVER_NAME.
pktcdvd: Replace pktcdvd strings with macro DRIVER_NAME.
Signed-off-by: Thomas Maier <balagi@justmail.de>
Signed-off-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/pktcdvd.c | 124 |
1 files changed, 63 insertions, 61 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index a6b2aa67c9b2..8a73a054a15a 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -62,6 +62,8 @@ | |||
62 | 62 | ||
63 | #include <asm/uaccess.h> | 63 | #include <asm/uaccess.h> |
64 | 64 | ||
65 | #define DRIVER_NAME "pktcdvd" | ||
66 | |||
65 | #if PACKET_DEBUG | 67 | #if PACKET_DEBUG |
66 | #define DPRINTK(fmt, args...) printk(KERN_NOTICE fmt, ##args) | 68 | #define DPRINTK(fmt, args...) printk(KERN_NOTICE fmt, ##args) |
67 | #else | 69 | #else |
@@ -89,7 +91,7 @@ static void pkt_bio_finished(struct pktcdvd_device *pd) | |||
89 | { | 91 | { |
90 | BUG_ON(atomic_read(&pd->cdrw.pending_bios) <= 0); | 92 | BUG_ON(atomic_read(&pd->cdrw.pending_bios) <= 0); |
91 | if (atomic_dec_and_test(&pd->cdrw.pending_bios)) { | 93 | if (atomic_dec_and_test(&pd->cdrw.pending_bios)) { |
92 | VPRINTK("pktcdvd: queue empty\n"); | 94 | VPRINTK(DRIVER_NAME": queue empty\n"); |
93 | atomic_set(&pd->iosched.attention, 1); | 95 | atomic_set(&pd->iosched.attention, 1); |
94 | wake_up(&pd->wqueue); | 96 | wake_up(&pd->wqueue); |
95 | } | 97 | } |
@@ -400,7 +402,7 @@ static void pkt_dump_sense(struct packet_command *cgc) | |||
400 | int i; | 402 | int i; |
401 | struct request_sense *sense = cgc->sense; | 403 | struct request_sense *sense = cgc->sense; |
402 | 404 | ||
403 | printk("pktcdvd:"); | 405 | printk(DRIVER_NAME":"); |
404 | for (i = 0; i < CDROM_PACKET_SIZE; i++) | 406 | for (i = 0; i < CDROM_PACKET_SIZE; i++) |
405 | printk(" %02x", cgc->cmd[i]); | 407 | printk(" %02x", cgc->cmd[i]); |
406 | printk(" - "); | 408 | printk(" - "); |
@@ -528,7 +530,7 @@ static void pkt_iosched_process_queue(struct pktcdvd_device *pd) | |||
528 | need_write_seek = 0; | 530 | need_write_seek = 0; |
529 | if (need_write_seek && reads_queued) { | 531 | if (need_write_seek && reads_queued) { |
530 | if (atomic_read(&pd->cdrw.pending_bios) > 0) { | 532 | if (atomic_read(&pd->cdrw.pending_bios) > 0) { |
531 | VPRINTK("pktcdvd: write, waiting\n"); | 533 | VPRINTK(DRIVER_NAME": write, waiting\n"); |
532 | break; | 534 | break; |
533 | } | 535 | } |
534 | pkt_flush_cache(pd); | 536 | pkt_flush_cache(pd); |
@@ -537,7 +539,7 @@ static void pkt_iosched_process_queue(struct pktcdvd_device *pd) | |||
537 | } else { | 539 | } else { |
538 | if (!reads_queued && writes_queued) { | 540 | if (!reads_queued && writes_queued) { |
539 | if (atomic_read(&pd->cdrw.pending_bios) > 0) { | 541 | if (atomic_read(&pd->cdrw.pending_bios) > 0) { |
540 | VPRINTK("pktcdvd: read, waiting\n"); | 542 | VPRINTK(DRIVER_NAME": read, waiting\n"); |
541 | break; | 543 | break; |
542 | } | 544 | } |
543 | pd->iosched.writing = 1; | 545 | pd->iosched.writing = 1; |
@@ -600,7 +602,7 @@ static int pkt_set_segment_merging(struct pktcdvd_device *pd, request_queue_t *q | |||
600 | set_bit(PACKET_MERGE_SEGS, &pd->flags); | 602 | set_bit(PACKET_MERGE_SEGS, &pd->flags); |
601 | return 0; | 603 | return 0; |
602 | } else { | 604 | } else { |
603 | printk("pktcdvd: cdrom max_phys_segments too small\n"); | 605 | printk(DRIVER_NAME": cdrom max_phys_segments too small\n"); |
604 | return -EIO; | 606 | return -EIO; |
605 | } | 607 | } |
606 | } | 608 | } |
@@ -1049,7 +1051,7 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
1049 | for (f = 0; f < pkt->frames; f++) | 1051 | for (f = 0; f < pkt->frames; f++) |
1050 | if (!bio_add_page(pkt->w_bio, bvec[f].bv_page, CD_FRAMESIZE, bvec[f].bv_offset)) | 1052 | if (!bio_add_page(pkt->w_bio, bvec[f].bv_page, CD_FRAMESIZE, bvec[f].bv_offset)) |
1051 | BUG(); | 1053 | BUG(); |
1052 | VPRINTK("pktcdvd: vcnt=%d\n", pkt->w_bio->bi_vcnt); | 1054 | VPRINTK(DRIVER_NAME": vcnt=%d\n", pkt->w_bio->bi_vcnt); |
1053 | 1055 | ||
1054 | atomic_set(&pkt->io_wait, 1); | 1056 | atomic_set(&pkt->io_wait, 1); |
1055 | pkt->w_bio->bi_rw = WRITE; | 1057 | pkt->w_bio->bi_rw = WRITE; |
@@ -1286,7 +1288,7 @@ work_to_do: | |||
1286 | 1288 | ||
1287 | static void pkt_print_settings(struct pktcdvd_device *pd) | 1289 | static void pkt_print_settings(struct pktcdvd_device *pd) |
1288 | { | 1290 | { |
1289 | printk("pktcdvd: %s packets, ", pd->settings.fp ? "Fixed" : "Variable"); | 1291 | printk(DRIVER_NAME": %s packets, ", pd->settings.fp ? "Fixed" : "Variable"); |
1290 | printk("%u blocks, ", pd->settings.size >> 2); | 1292 | printk("%u blocks, ", pd->settings.size >> 2); |
1291 | printk("Mode-%c disc\n", pd->settings.block_mode == 8 ? '1' : '2'); | 1293 | printk("Mode-%c disc\n", pd->settings.block_mode == 8 ? '1' : '2'); |
1292 | } | 1294 | } |
@@ -1471,7 +1473,7 @@ static int pkt_set_write_settings(struct pktcdvd_device *pd) | |||
1471 | /* | 1473 | /* |
1472 | * paranoia | 1474 | * paranoia |
1473 | */ | 1475 | */ |
1474 | printk("pktcdvd: write mode wrong %d\n", wp->data_block_type); | 1476 | printk(DRIVER_NAME": write mode wrong %d\n", wp->data_block_type); |
1475 | return 1; | 1477 | return 1; |
1476 | } | 1478 | } |
1477 | wp->packet_size = cpu_to_be32(pd->settings.size >> 2); | 1479 | wp->packet_size = cpu_to_be32(pd->settings.size >> 2); |
@@ -1515,7 +1517,7 @@ static int pkt_writable_track(struct pktcdvd_device *pd, track_information *ti) | |||
1515 | if (ti->rt == 1 && ti->blank == 0) | 1517 | if (ti->rt == 1 && ti->blank == 0) |
1516 | return 1; | 1518 | return 1; |
1517 | 1519 | ||
1518 | printk("pktcdvd: bad state %d-%d-%d\n", ti->rt, ti->blank, ti->packet); | 1520 | printk(DRIVER_NAME": bad state %d-%d-%d\n", ti->rt, ti->blank, ti->packet); |
1519 | return 0; | 1521 | return 0; |
1520 | } | 1522 | } |
1521 | 1523 | ||
@@ -1533,7 +1535,7 @@ static int pkt_writable_disc(struct pktcdvd_device *pd, disc_information *di) | |||
1533 | case 0x12: /* DVD-RAM */ | 1535 | case 0x12: /* DVD-RAM */ |
1534 | return 1; | 1536 | return 1; |
1535 | default: | 1537 | default: |
1536 | VPRINTK("pktcdvd: Wrong disc profile (%x)\n", pd->mmc3_profile); | 1538 | VPRINTK(DRIVER_NAME": Wrong disc profile (%x)\n", pd->mmc3_profile); |
1537 | return 0; | 1539 | return 0; |
1538 | } | 1540 | } |
1539 | 1541 | ||
@@ -1542,22 +1544,22 @@ static int pkt_writable_disc(struct pktcdvd_device *pd, disc_information *di) | |||
1542 | * but i'm not sure, should we leave this to user apps? probably. | 1544 | * but i'm not sure, should we leave this to user apps? probably. |
1543 | */ | 1545 | */ |
1544 | if (di->disc_type == 0xff) { | 1546 | if (di->disc_type == 0xff) { |
1545 | printk("pktcdvd: Unknown disc. No track?\n"); | 1547 | printk(DRIVER_NAME": Unknown disc. No track?\n"); |
1546 | return 0; | 1548 | return 0; |
1547 | } | 1549 | } |
1548 | 1550 | ||
1549 | if (di->disc_type != 0x20 && di->disc_type != 0) { | 1551 | if (di->disc_type != 0x20 && di->disc_type != 0) { |
1550 | printk("pktcdvd: Wrong disc type (%x)\n", di->disc_type); | 1552 | printk(DRIVER_NAME": Wrong disc type (%x)\n", di->disc_type); |
1551 | return 0; | 1553 | return 0; |
1552 | } | 1554 | } |
1553 | 1555 | ||
1554 | if (di->erasable == 0) { | 1556 | if (di->erasable == 0) { |
1555 | printk("pktcdvd: Disc not erasable\n"); | 1557 | printk(DRIVER_NAME": Disc not erasable\n"); |
1556 | return 0; | 1558 | return 0; |
1557 | } | 1559 | } |
1558 | 1560 | ||
1559 | if (di->border_status == PACKET_SESSION_RESERVED) { | 1561 | if (di->border_status == PACKET_SESSION_RESERVED) { |
1560 | printk("pktcdvd: Can't write to last track (reserved)\n"); | 1562 | printk(DRIVER_NAME": Can't write to last track (reserved)\n"); |
1561 | return 0; | 1563 | return 0; |
1562 | } | 1564 | } |
1563 | 1565 | ||
@@ -1593,12 +1595,12 @@ static int pkt_probe_settings(struct pktcdvd_device *pd) | |||
1593 | 1595 | ||
1594 | track = 1; /* (di.last_track_msb << 8) | di.last_track_lsb; */ | 1596 | track = 1; /* (di.last_track_msb << 8) | di.last_track_lsb; */ |
1595 | if ((ret = pkt_get_track_info(pd, track, 1, &ti))) { | 1597 | if ((ret = pkt_get_track_info(pd, track, 1, &ti))) { |
1596 | printk("pktcdvd: failed get_track\n"); | 1598 | printk(DRIVER_NAME": failed get_track\n"); |
1597 | return ret; | 1599 | return ret; |
1598 | } | 1600 | } |
1599 | 1601 | ||
1600 | if (!pkt_writable_track(pd, &ti)) { | 1602 | if (!pkt_writable_track(pd, &ti)) { |
1601 | printk("pktcdvd: can't write to this track\n"); | 1603 | printk(DRIVER_NAME": can't write to this track\n"); |
1602 | return -EROFS; | 1604 | return -EROFS; |
1603 | } | 1605 | } |
1604 | 1606 | ||
@@ -1608,11 +1610,11 @@ static int pkt_probe_settings(struct pktcdvd_device *pd) | |||
1608 | */ | 1610 | */ |
1609 | pd->settings.size = be32_to_cpu(ti.fixed_packet_size) << 2; | 1611 | pd->settings.size = be32_to_cpu(ti.fixed_packet_size) << 2; |
1610 | if (pd->settings.size == 0) { | 1612 | if (pd->settings.size == 0) { |
1611 | printk("pktcdvd: detected zero packet size!\n"); | 1613 | printk(DRIVER_NAME": detected zero packet size!\n"); |
1612 | return -ENXIO; | 1614 | return -ENXIO; |
1613 | } | 1615 | } |
1614 | if (pd->settings.size > PACKET_MAX_SECTORS) { | 1616 | if (pd->settings.size > PACKET_MAX_SECTORS) { |
1615 | printk("pktcdvd: packet size is too big\n"); | 1617 | printk(DRIVER_NAME": packet size is too big\n"); |
1616 | return -EROFS; | 1618 | return -EROFS; |
1617 | } | 1619 | } |
1618 | pd->settings.fp = ti.fp; | 1620 | pd->settings.fp = ti.fp; |
@@ -1654,7 +1656,7 @@ static int pkt_probe_settings(struct pktcdvd_device *pd) | |||
1654 | pd->settings.block_mode = PACKET_BLOCK_MODE2; | 1656 | pd->settings.block_mode = PACKET_BLOCK_MODE2; |
1655 | break; | 1657 | break; |
1656 | default: | 1658 | default: |
1657 | printk("pktcdvd: unknown data mode\n"); | 1659 | printk(DRIVER_NAME": unknown data mode\n"); |
1658 | return -EROFS; | 1660 | return -EROFS; |
1659 | } | 1661 | } |
1660 | return 0; | 1662 | return 0; |
@@ -1688,10 +1690,10 @@ static int pkt_write_caching(struct pktcdvd_device *pd, int set) | |||
1688 | cgc.buflen = cgc.cmd[8] = 2 + ((buf[0] << 8) | (buf[1] & 0xff)); | 1690 | cgc.buflen = cgc.cmd[8] = 2 + ((buf[0] << 8) | (buf[1] & 0xff)); |
1689 | ret = pkt_mode_select(pd, &cgc); | 1691 | ret = pkt_mode_select(pd, &cgc); |
1690 | if (ret) { | 1692 | if (ret) { |
1691 | printk("pktcdvd: write caching control failed\n"); | 1693 | printk(DRIVER_NAME": write caching control failed\n"); |
1692 | pkt_dump_sense(&cgc); | 1694 | pkt_dump_sense(&cgc); |
1693 | } else if (!ret && set) | 1695 | } else if (!ret && set) |
1694 | printk("pktcdvd: enabled write caching on %s\n", pd->name); | 1696 | printk(DRIVER_NAME": enabled write caching on %s\n", pd->name); |
1695 | return ret; | 1697 | return ret; |
1696 | } | 1698 | } |
1697 | 1699 | ||
@@ -1805,11 +1807,11 @@ static int pkt_media_speed(struct pktcdvd_device *pd, unsigned *speed) | |||
1805 | } | 1807 | } |
1806 | 1808 | ||
1807 | if (!buf[6] & 0x40) { | 1809 | if (!buf[6] & 0x40) { |
1808 | printk("pktcdvd: Disc type is not CD-RW\n"); | 1810 | printk(DRIVER_NAME": Disc type is not CD-RW\n"); |
1809 | return 1; | 1811 | return 1; |
1810 | } | 1812 | } |
1811 | if (!buf[6] & 0x4) { | 1813 | if (!buf[6] & 0x4) { |
1812 | printk("pktcdvd: A1 values on media are not valid, maybe not CDRW?\n"); | 1814 | printk(DRIVER_NAME": A1 values on media are not valid, maybe not CDRW?\n"); |
1813 | return 1; | 1815 | return 1; |
1814 | } | 1816 | } |
1815 | 1817 | ||
@@ -1829,14 +1831,14 @@ static int pkt_media_speed(struct pktcdvd_device *pd, unsigned *speed) | |||
1829 | *speed = us_clv_to_speed[sp]; | 1831 | *speed = us_clv_to_speed[sp]; |
1830 | break; | 1832 | break; |
1831 | default: | 1833 | default: |
1832 | printk("pktcdvd: Unknown disc sub-type %d\n",st); | 1834 | printk(DRIVER_NAME": Unknown disc sub-type %d\n",st); |
1833 | return 1; | 1835 | return 1; |
1834 | } | 1836 | } |
1835 | if (*speed) { | 1837 | if (*speed) { |
1836 | printk("pktcdvd: Max. media speed: %d\n",*speed); | 1838 | printk(DRIVER_NAME": Max. media speed: %d\n",*speed); |
1837 | return 0; | 1839 | return 0; |
1838 | } else { | 1840 | } else { |
1839 | printk("pktcdvd: Unknown speed %d for sub-type %d\n",sp,st); | 1841 | printk(DRIVER_NAME": Unknown speed %d for sub-type %d\n",sp,st); |
1840 | return 1; | 1842 | return 1; |
1841 | } | 1843 | } |
1842 | } | 1844 | } |
@@ -1847,7 +1849,7 @@ static int pkt_perform_opc(struct pktcdvd_device *pd) | |||
1847 | struct request_sense sense; | 1849 | struct request_sense sense; |
1848 | int ret; | 1850 | int ret; |
1849 | 1851 | ||
1850 | VPRINTK("pktcdvd: Performing OPC\n"); | 1852 | VPRINTK(DRIVER_NAME": Performing OPC\n"); |
1851 | 1853 | ||
1852 | init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE); | 1854 | init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE); |
1853 | cgc.sense = &sense; | 1855 | cgc.sense = &sense; |
@@ -1865,12 +1867,12 @@ static int pkt_open_write(struct pktcdvd_device *pd) | |||
1865 | unsigned int write_speed, media_write_speed, read_speed; | 1867 | unsigned int write_speed, media_write_speed, read_speed; |
1866 | 1868 | ||
1867 | if ((ret = pkt_probe_settings(pd))) { | 1869 | if ((ret = pkt_probe_settings(pd))) { |
1868 | VPRINTK("pktcdvd: %s failed probe\n", pd->name); | 1870 | VPRINTK(DRIVER_NAME": %s failed probe\n", pd->name); |
1869 | return ret; | 1871 | return ret; |
1870 | } | 1872 | } |
1871 | 1873 | ||
1872 | if ((ret = pkt_set_write_settings(pd))) { | 1874 | if ((ret = pkt_set_write_settings(pd))) { |
1873 | DPRINTK("pktcdvd: %s failed saving write settings\n", pd->name); | 1875 | DPRINTK(DRIVER_NAME": %s failed saving write settings\n", pd->name); |
1874 | return -EIO; | 1876 | return -EIO; |
1875 | } | 1877 | } |
1876 | 1878 | ||
@@ -1882,26 +1884,26 @@ static int pkt_open_write(struct pktcdvd_device *pd) | |||
1882 | case 0x13: /* DVD-RW */ | 1884 | case 0x13: /* DVD-RW */ |
1883 | case 0x1a: /* DVD+RW */ | 1885 | case 0x1a: /* DVD+RW */ |
1884 | case 0x12: /* DVD-RAM */ | 1886 | case 0x12: /* DVD-RAM */ |
1885 | DPRINTK("pktcdvd: write speed %ukB/s\n", write_speed); | 1887 | DPRINTK(DRIVER_NAME": write speed %ukB/s\n", write_speed); |
1886 | break; | 1888 | break; |
1887 | default: | 1889 | default: |
1888 | if ((ret = pkt_media_speed(pd, &media_write_speed))) | 1890 | if ((ret = pkt_media_speed(pd, &media_write_speed))) |
1889 | media_write_speed = 16; | 1891 | media_write_speed = 16; |
1890 | write_speed = min(write_speed, media_write_speed * 177); | 1892 | write_speed = min(write_speed, media_write_speed * 177); |
1891 | DPRINTK("pktcdvd: write speed %ux\n", write_speed / 176); | 1893 | DPRINTK(DRIVER_NAME": write speed %ux\n", write_speed / 176); |
1892 | break; | 1894 | break; |
1893 | } | 1895 | } |
1894 | read_speed = write_speed; | 1896 | read_speed = write_speed; |
1895 | 1897 | ||
1896 | if ((ret = pkt_set_speed(pd, write_speed, read_speed))) { | 1898 | if ((ret = pkt_set_speed(pd, write_speed, read_speed))) { |
1897 | DPRINTK("pktcdvd: %s couldn't set write speed\n", pd->name); | 1899 | DPRINTK(DRIVER_NAME": %s couldn't set write speed\n", pd->name); |
1898 | return -EIO; | 1900 | return -EIO; |
1899 | } | 1901 | } |
1900 | pd->write_speed = write_speed; | 1902 | pd->write_speed = write_speed; |
1901 | pd->read_speed = read_speed; | 1903 | pd->read_speed = read_speed; |
1902 | 1904 | ||
1903 | if ((ret = pkt_perform_opc(pd))) { | 1905 | if ((ret = pkt_perform_opc(pd))) { |
1904 | DPRINTK("pktcdvd: %s Optimum Power Calibration failed\n", pd->name); | 1906 | DPRINTK(DRIVER_NAME": %s Optimum Power Calibration failed\n", pd->name); |
1905 | } | 1907 | } |
1906 | 1908 | ||
1907 | return 0; | 1909 | return 0; |
@@ -1929,7 +1931,7 @@ static int pkt_open_dev(struct pktcdvd_device *pd, int write) | |||
1929 | goto out_putdev; | 1931 | goto out_putdev; |
1930 | 1932 | ||
1931 | if ((ret = pkt_get_last_written(pd, &lba))) { | 1933 | if ((ret = pkt_get_last_written(pd, &lba))) { |
1932 | printk("pktcdvd: pkt_get_last_written failed\n"); | 1934 | printk(DRIVER_NAME": pkt_get_last_written failed\n"); |
1933 | goto out_unclaim; | 1935 | goto out_unclaim; |
1934 | } | 1936 | } |
1935 | 1937 | ||
@@ -1959,11 +1961,11 @@ static int pkt_open_dev(struct pktcdvd_device *pd, int write) | |||
1959 | 1961 | ||
1960 | if (write) { | 1962 | if (write) { |
1961 | if (!pkt_grow_pktlist(pd, CONFIG_CDROM_PKTCDVD_BUFFERS)) { | 1963 | if (!pkt_grow_pktlist(pd, CONFIG_CDROM_PKTCDVD_BUFFERS)) { |
1962 | printk("pktcdvd: not enough memory for buffers\n"); | 1964 | printk(DRIVER_NAME": not enough memory for buffers\n"); |
1963 | ret = -ENOMEM; | 1965 | ret = -ENOMEM; |
1964 | goto out_unclaim; | 1966 | goto out_unclaim; |
1965 | } | 1967 | } |
1966 | printk("pktcdvd: %lukB available on disc\n", lba << 1); | 1968 | printk(DRIVER_NAME": %lukB available on disc\n", lba << 1); |
1967 | } | 1969 | } |
1968 | 1970 | ||
1969 | return 0; | 1971 | return 0; |
@@ -1983,7 +1985,7 @@ out: | |||
1983 | static void pkt_release_dev(struct pktcdvd_device *pd, int flush) | 1985 | static void pkt_release_dev(struct pktcdvd_device *pd, int flush) |
1984 | { | 1986 | { |
1985 | if (flush && pkt_flush_cache(pd)) | 1987 | if (flush && pkt_flush_cache(pd)) |
1986 | DPRINTK("pktcdvd: %s not flushing cache\n", pd->name); | 1988 | DPRINTK(DRIVER_NAME": %s not flushing cache\n", pd->name); |
1987 | 1989 | ||
1988 | pkt_lock_door(pd, 0); | 1990 | pkt_lock_door(pd, 0); |
1989 | 1991 | ||
@@ -2006,7 +2008,7 @@ static int pkt_open(struct inode *inode, struct file *file) | |||
2006 | struct pktcdvd_device *pd = NULL; | 2008 | struct pktcdvd_device *pd = NULL; |
2007 | int ret; | 2009 | int ret; |
2008 | 2010 | ||
2009 | VPRINTK("pktcdvd: entering open\n"); | 2011 | VPRINTK(DRIVER_NAME": entering open\n"); |
2010 | 2012 | ||
2011 | mutex_lock(&ctl_mutex); | 2013 | mutex_lock(&ctl_mutex); |
2012 | pd = pkt_find_dev_from_minor(iminor(inode)); | 2014 | pd = pkt_find_dev_from_minor(iminor(inode)); |
@@ -2040,7 +2042,7 @@ static int pkt_open(struct inode *inode, struct file *file) | |||
2040 | out_dec: | 2042 | out_dec: |
2041 | pd->refcnt--; | 2043 | pd->refcnt--; |
2042 | out: | 2044 | out: |
2043 | VPRINTK("pktcdvd: failed open (%d)\n", ret); | 2045 | VPRINTK(DRIVER_NAME": failed open (%d)\n", ret); |
2044 | mutex_unlock(&ctl_mutex); | 2046 | mutex_unlock(&ctl_mutex); |
2045 | return ret; | 2047 | return ret; |
2046 | } | 2048 | } |
@@ -2088,7 +2090,7 @@ static int pkt_make_request(request_queue_t *q, struct bio *bio) | |||
2088 | 2090 | ||
2089 | pd = q->queuedata; | 2091 | pd = q->queuedata; |
2090 | if (!pd) { | 2092 | if (!pd) { |
2091 | printk("pktcdvd: %s incorrect request queue\n", bdevname(bio->bi_bdev, b)); | 2093 | printk(DRIVER_NAME": %s incorrect request queue\n", bdevname(bio->bi_bdev, b)); |
2092 | goto end_io; | 2094 | goto end_io; |
2093 | } | 2095 | } |
2094 | 2096 | ||
@@ -2110,13 +2112,13 @@ static int pkt_make_request(request_queue_t *q, struct bio *bio) | |||
2110 | } | 2112 | } |
2111 | 2113 | ||
2112 | if (!test_bit(PACKET_WRITABLE, &pd->flags)) { | 2114 | if (!test_bit(PACKET_WRITABLE, &pd->flags)) { |
2113 | printk("pktcdvd: WRITE for ro device %s (%llu)\n", | 2115 | printk(DRIVER_NAME": WRITE for ro device %s (%llu)\n", |
2114 | pd->name, (unsigned long long)bio->bi_sector); | 2116 | pd->name, (unsigned long long)bio->bi_sector); |
2115 | goto end_io; | 2117 | goto end_io; |
2116 | } | 2118 | } |
2117 | 2119 | ||
2118 | if (!bio->bi_size || (bio->bi_size % CD_FRAMESIZE)) { | 2120 | if (!bio->bi_size || (bio->bi_size % CD_FRAMESIZE)) { |
2119 | printk("pktcdvd: wrong bio size\n"); | 2121 | printk(DRIVER_NAME": wrong bio size\n"); |
2120 | goto end_io; | 2122 | goto end_io; |
2121 | } | 2123 | } |
2122 | 2124 | ||
@@ -2319,7 +2321,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) | |||
2319 | struct block_device *bdev; | 2321 | struct block_device *bdev; |
2320 | 2322 | ||
2321 | if (pd->pkt_dev == dev) { | 2323 | if (pd->pkt_dev == dev) { |
2322 | printk("pktcdvd: Recursive setup not allowed\n"); | 2324 | printk(DRIVER_NAME": Recursive setup not allowed\n"); |
2323 | return -EBUSY; | 2325 | return -EBUSY; |
2324 | } | 2326 | } |
2325 | for (i = 0; i < MAX_WRITERS; i++) { | 2327 | for (i = 0; i < MAX_WRITERS; i++) { |
@@ -2327,11 +2329,11 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) | |||
2327 | if (!pd2) | 2329 | if (!pd2) |
2328 | continue; | 2330 | continue; |
2329 | if (pd2->bdev->bd_dev == dev) { | 2331 | if (pd2->bdev->bd_dev == dev) { |
2330 | printk("pktcdvd: %s already setup\n", bdevname(pd2->bdev, b)); | 2332 | printk(DRIVER_NAME": %s already setup\n", bdevname(pd2->bdev, b)); |
2331 | return -EBUSY; | 2333 | return -EBUSY; |
2332 | } | 2334 | } |
2333 | if (pd2->pkt_dev == dev) { | 2335 | if (pd2->pkt_dev == dev) { |
2334 | printk("pktcdvd: Can't chain pktcdvd devices\n"); | 2336 | printk(DRIVER_NAME": Can't chain pktcdvd devices\n"); |
2335 | return -EBUSY; | 2337 | return -EBUSY; |
2336 | } | 2338 | } |
2337 | } | 2339 | } |
@@ -2354,7 +2356,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) | |||
2354 | atomic_set(&pd->cdrw.pending_bios, 0); | 2356 | atomic_set(&pd->cdrw.pending_bios, 0); |
2355 | pd->cdrw.thread = kthread_run(kcdrwd, pd, "%s", pd->name); | 2357 | pd->cdrw.thread = kthread_run(kcdrwd, pd, "%s", pd->name); |
2356 | if (IS_ERR(pd->cdrw.thread)) { | 2358 | if (IS_ERR(pd->cdrw.thread)) { |
2357 | printk("pktcdvd: can't start kernel thread\n"); | 2359 | printk(DRIVER_NAME": can't start kernel thread\n"); |
2358 | ret = -ENOMEM; | 2360 | ret = -ENOMEM; |
2359 | goto out_mem; | 2361 | goto out_mem; |
2360 | } | 2362 | } |
@@ -2364,7 +2366,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) | |||
2364 | proc->data = pd; | 2366 | proc->data = pd; |
2365 | proc->proc_fops = &pkt_proc_fops; | 2367 | proc->proc_fops = &pkt_proc_fops; |
2366 | } | 2368 | } |
2367 | DPRINTK("pktcdvd: writer %s mapped to %s\n", pd->name, bdevname(bdev, b)); | 2369 | DPRINTK(DRIVER_NAME": writer %s mapped to %s\n", pd->name, bdevname(bdev, b)); |
2368 | return 0; | 2370 | return 0; |
2369 | 2371 | ||
2370 | out_mem: | 2372 | out_mem: |
@@ -2401,7 +2403,7 @@ static int pkt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u | |||
2401 | return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg); | 2403 | return blkdev_ioctl(pd->bdev->bd_inode, file, cmd, arg); |
2402 | 2404 | ||
2403 | default: | 2405 | default: |
2404 | VPRINTK("pktcdvd: Unknown ioctl for %s (%x)\n", pd->name, cmd); | 2406 | VPRINTK(DRIVER_NAME": Unknown ioctl for %s (%x)\n", pd->name, cmd); |
2405 | return -ENOTTY; | 2407 | return -ENOTTY; |
2406 | } | 2408 | } |
2407 | 2409 | ||
@@ -2446,7 +2448,7 @@ static int pkt_setup_dev(struct pkt_ctrl_command *ctrl_cmd) | |||
2446 | if (!pkt_devs[idx]) | 2448 | if (!pkt_devs[idx]) |
2447 | break; | 2449 | break; |
2448 | if (idx == MAX_WRITERS) { | 2450 | if (idx == MAX_WRITERS) { |
2449 | printk("pktcdvd: max %d writers supported\n", MAX_WRITERS); | 2451 | printk(DRIVER_NAME": max %d writers supported\n", MAX_WRITERS); |
2450 | return -EBUSY; | 2452 | return -EBUSY; |
2451 | } | 2453 | } |
2452 | 2454 | ||
@@ -2470,7 +2472,7 @@ static int pkt_setup_dev(struct pkt_ctrl_command *ctrl_cmd) | |||
2470 | 2472 | ||
2471 | spin_lock_init(&pd->lock); | 2473 | spin_lock_init(&pd->lock); |
2472 | spin_lock_init(&pd->iosched.lock); | 2474 | spin_lock_init(&pd->iosched.lock); |
2473 | sprintf(pd->name, "pktcdvd%d", idx); | 2475 | sprintf(pd->name, DRIVER_NAME"%d", idx); |
2474 | init_waitqueue_head(&pd->wqueue); | 2476 | init_waitqueue_head(&pd->wqueue); |
2475 | pd->bio_queue = RB_ROOT; | 2477 | pd->bio_queue = RB_ROOT; |
2476 | 2478 | ||
@@ -2478,7 +2480,7 @@ static int pkt_setup_dev(struct pkt_ctrl_command *ctrl_cmd) | |||
2478 | disk->first_minor = idx; | 2480 | disk->first_minor = idx; |
2479 | disk->fops = &pktcdvd_ops; | 2481 | disk->fops = &pktcdvd_ops; |
2480 | disk->flags = GENHD_FL_REMOVABLE; | 2482 | disk->flags = GENHD_FL_REMOVABLE; |
2481 | sprintf(disk->disk_name, "pktcdvd%d", idx); | 2483 | sprintf(disk->disk_name, DRIVER_NAME"%d", idx); |
2482 | disk->private_data = pd; | 2484 | disk->private_data = pd; |
2483 | disk->queue = blk_alloc_queue(GFP_KERNEL); | 2485 | disk->queue = blk_alloc_queue(GFP_KERNEL); |
2484 | if (!disk->queue) | 2486 | if (!disk->queue) |
@@ -2520,7 +2522,7 @@ static int pkt_remove_dev(struct pkt_ctrl_command *ctrl_cmd) | |||
2520 | break; | 2522 | break; |
2521 | } | 2523 | } |
2522 | if (idx == MAX_WRITERS) { | 2524 | if (idx == MAX_WRITERS) { |
2523 | DPRINTK("pktcdvd: dev not setup\n"); | 2525 | DPRINTK(DRIVER_NAME": dev not setup\n"); |
2524 | return -ENXIO; | 2526 | return -ENXIO; |
2525 | } | 2527 | } |
2526 | 2528 | ||
@@ -2533,7 +2535,7 @@ static int pkt_remove_dev(struct pkt_ctrl_command *ctrl_cmd) | |||
2533 | blkdev_put(pd->bdev); | 2535 | blkdev_put(pd->bdev); |
2534 | 2536 | ||
2535 | remove_proc_entry(pd->name, pkt_proc); | 2537 | remove_proc_entry(pd->name, pkt_proc); |
2536 | DPRINTK("pktcdvd: writer %s unmapped\n", pd->name); | 2538 | DPRINTK(DRIVER_NAME": writer %s unmapped\n", pd->name); |
2537 | 2539 | ||
2538 | del_gendisk(pd->disk); | 2540 | del_gendisk(pd->disk); |
2539 | blk_cleanup_queue(pd->disk->queue); | 2541 | blk_cleanup_queue(pd->disk->queue); |
@@ -2610,7 +2612,7 @@ static struct file_operations pkt_ctl_fops = { | |||
2610 | 2612 | ||
2611 | static struct miscdevice pkt_misc = { | 2613 | static struct miscdevice pkt_misc = { |
2612 | .minor = MISC_DYNAMIC_MINOR, | 2614 | .minor = MISC_DYNAMIC_MINOR, |
2613 | .name = "pktcdvd", | 2615 | .name = DRIVER_NAME, |
2614 | .fops = &pkt_ctl_fops | 2616 | .fops = &pkt_ctl_fops |
2615 | }; | 2617 | }; |
2616 | 2618 | ||
@@ -2623,9 +2625,9 @@ static int __init pkt_init(void) | |||
2623 | if (!psd_pool) | 2625 | if (!psd_pool) |
2624 | return -ENOMEM; | 2626 | return -ENOMEM; |
2625 | 2627 | ||
2626 | ret = register_blkdev(pkt_major, "pktcdvd"); | 2628 | ret = register_blkdev(pkt_major, DRIVER_NAME); |
2627 | if (ret < 0) { | 2629 | if (ret < 0) { |
2628 | printk("pktcdvd: Unable to register block device\n"); | 2630 | printk(DRIVER_NAME": Unable to register block device\n"); |
2629 | goto out2; | 2631 | goto out2; |
2630 | } | 2632 | } |
2631 | if (!pkt_major) | 2633 | if (!pkt_major) |
@@ -2633,18 +2635,18 @@ static int __init pkt_init(void) | |||
2633 | 2635 | ||
2634 | ret = misc_register(&pkt_misc); | 2636 | ret = misc_register(&pkt_misc); |
2635 | if (ret) { | 2637 | if (ret) { |
2636 | printk("pktcdvd: Unable to register misc device\n"); | 2638 | printk(DRIVER_NAME": Unable to register misc device\n"); |
2637 | goto out; | 2639 | goto out; |
2638 | } | 2640 | } |
2639 | 2641 | ||
2640 | mutex_init(&ctl_mutex); | 2642 | mutex_init(&ctl_mutex); |
2641 | 2643 | ||
2642 | pkt_proc = proc_mkdir("pktcdvd", proc_root_driver); | 2644 | pkt_proc = proc_mkdir(DRIVER_NAME, proc_root_driver); |
2643 | 2645 | ||
2644 | return 0; | 2646 | return 0; |
2645 | 2647 | ||
2646 | out: | 2648 | out: |
2647 | unregister_blkdev(pkt_major, "pktcdvd"); | 2649 | unregister_blkdev(pkt_major, DRIVER_NAME); |
2648 | out2: | 2650 | out2: |
2649 | mempool_destroy(psd_pool); | 2651 | mempool_destroy(psd_pool); |
2650 | return ret; | 2652 | return ret; |
@@ -2652,9 +2654,9 @@ out2: | |||
2652 | 2654 | ||
2653 | static void __exit pkt_exit(void) | 2655 | static void __exit pkt_exit(void) |
2654 | { | 2656 | { |
2655 | remove_proc_entry("pktcdvd", proc_root_driver); | 2657 | remove_proc_entry(DRIVER_NAME, proc_root_driver); |
2656 | misc_deregister(&pkt_misc); | 2658 | misc_deregister(&pkt_misc); |
2657 | unregister_blkdev(pkt_major, "pktcdvd"); | 2659 | unregister_blkdev(pkt_major, DRIVER_NAME); |
2658 | mempool_destroy(psd_pool); | 2660 | mempool_destroy(psd_pool); |
2659 | } | 2661 | } |
2660 | 2662 | ||