PCI: hotplug: pciehp: Removed check for hotplug of display devices
[safe/jmp/linux-2.6] / drivers / block / ps3disk.c
index 1299db1..3b419e3 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <linux/ata.h>
 #include <linux/blkdev.h>
+#include <linux/slab.h>
 
 #include <asm/lv1call.h>
 #include <asm/ps3stor.h>
@@ -82,7 +83,7 @@ enum lv1_ata_in_out {
 static int ps3disk_major;
 
 
-static struct block_device_operations ps3disk_fops = {
+static const struct block_device_operations ps3disk_fops = {
        .owner          = THIS_MODULE,
 };
 
@@ -120,7 +121,7 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev,
 static int ps3disk_submit_request_sg(struct ps3_storage_device *dev,
                                     struct request *req)
 {
-       struct ps3disk_private *priv = dev_get_drvdata(&dev->sbd.core);
+       struct ps3disk_private *priv = ps3_system_bus_get_drvdata(&dev->sbd);
        int write = rq_data_dir(req), res;
        const char *op = write ? "write" : "read";
        u64 start_sector, sectors;
@@ -168,7 +169,7 @@ static int ps3disk_submit_request_sg(struct ps3_storage_device *dev,
 static int ps3disk_submit_flush_request(struct ps3_storage_device *dev,
                                        struct request *req)
 {
-       struct ps3disk_private *priv = dev_get_drvdata(&dev->sbd.core);
+       struct ps3disk_private *priv = ps3_system_bus_get_drvdata(&dev->sbd);
        u64 res;
 
        dev_dbg(&dev->sbd.core, "%s:%u: flush request\n", __func__, __LINE__);
@@ -213,7 +214,7 @@ static void ps3disk_do_request(struct ps3_storage_device *dev,
 static void ps3disk_request(struct request_queue *q)
 {
        struct ps3_storage_device *dev = q->queuedata;
-       struct ps3disk_private *priv = dev_get_drvdata(&dev->sbd.core);
+       struct ps3disk_private *priv = ps3_system_bus_get_drvdata(&dev->sbd);
 
        if (priv->req) {
                dev_dbg(&dev->sbd.core, "%s:%u busy\n", __func__, __LINE__);
@@ -245,7 +246,7 @@ static irqreturn_t ps3disk_interrupt(int irq, void *data)
                return IRQ_HANDLED;
        }
 
-       priv = dev_get_drvdata(&dev->sbd.core);
+       priv = ps3_system_bus_get_drvdata(&dev->sbd);
        req = priv->req;
        if (!req) {
                dev_dbg(&dev->sbd.core,
@@ -364,7 +365,7 @@ static void ata_id_c_string(const u16 *id, unsigned char *s, unsigned int ofs,
 
 static int ps3disk_identify(struct ps3_storage_device *dev)
 {
-       struct ps3disk_private *priv = dev_get_drvdata(&dev->sbd.core);
+       struct ps3disk_private *priv = ps3_system_bus_get_drvdata(&dev->sbd);
        struct lv1_ata_cmnd_block ata_cmnd;
        u16 *id = dev->bounce_buf;
        u64 res;
@@ -445,7 +446,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)
                goto fail;
        }
 
-       dev_set_drvdata(&dev->sbd.core, priv);
+       ps3_system_bus_set_drvdata(_dev, priv);
        spin_lock_init(&priv->lock);
 
        dev->bounce_size = BOUNCE_SIZE;
@@ -474,7 +475,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)
 
        blk_queue_bounce_limit(queue, BLK_BOUNCE_HIGH);
 
-       blk_queue_max_sectors(queue, dev->bounce_size >> 9);
+       blk_queue_max_hw_sectors(queue, dev->bounce_size >> 9);
        blk_queue_segment_boundary(queue, -1UL);
        blk_queue_dma_alignment(queue, dev->blk_size-1);
        blk_queue_logical_block_size(queue, dev->blk_size);
@@ -482,8 +483,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)
        blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH,
                          ps3disk_prepare_flush);
 
-       blk_queue_max_phys_segments(queue, -1);
-       blk_queue_max_hw_segments(queue, -1);
+       blk_queue_max_segments(queue, -1);
        blk_queue_max_segment_size(queue, dev->bounce_size);
 
        gendisk = alloc_disk(PS3DISK_MINORS);
@@ -523,7 +523,7 @@ fail_free_bounce:
        kfree(dev->bounce_buf);
 fail_free_priv:
        kfree(priv);
-       dev_set_drvdata(&dev->sbd.core, NULL);
+       ps3_system_bus_set_drvdata(_dev, NULL);
 fail:
        mutex_lock(&ps3disk_mask_mutex);
        __clear_bit(devidx, &ps3disk_mask);
@@ -534,7 +534,7 @@ fail:
 static int ps3disk_remove(struct ps3_system_bus_device *_dev)
 {
        struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
-       struct ps3disk_private *priv = dev_get_drvdata(&dev->sbd.core);
+       struct ps3disk_private *priv = ps3_system_bus_get_drvdata(&dev->sbd);
 
        mutex_lock(&ps3disk_mask_mutex);
        __clear_bit(MINOR(disk_devt(priv->gendisk)) / PS3DISK_MINORS,
@@ -548,7 +548,7 @@ static int ps3disk_remove(struct ps3_system_bus_device *_dev)
        ps3stor_teardown(dev);
        kfree(dev->bounce_buf);
        kfree(priv);
-       dev_set_drvdata(&dev->sbd.core, NULL);
+       ps3_system_bus_set_drvdata(_dev, NULL);
        return 0;
 }