]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/ps3/system-bus.c
powerpc/ps3: Printing fixups for l64 to ll64 conversion arch/powerpc
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / ps3 / system-bus.c
index 661e9f77ebf6be4c70d5e013e65be1229cf665cb..58311a867851affc29310d3557dd5410350983ff 100644 (file)
@@ -31,7 +31,7 @@
 #include "platform.h"
 
 static struct device ps3_system_bus = {
-       .bus_id = "ps3_system",
+       .init_name = "ps3_system",
 };
 
 /* FIXME: need device usage counters! */
@@ -175,14 +175,14 @@ int ps3_open_hv_device(struct ps3_system_bus_device *dev)
                return ps3_open_hv_device_sb(dev);
 
        case PS3_MATCH_ID_SOUND:
-       case PS3_MATCH_ID_GRAPHICS:
+       case PS3_MATCH_ID_GPU:
                return ps3_open_hv_device_gpu(dev);
 
        case PS3_MATCH_ID_AV_SETTINGS:
        case PS3_MATCH_ID_SYSTEM_MANAGER:
                pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
                        __LINE__, dev->match_id);
-               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
+               pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,
                        dev->bus_id);
                BUG();
                return -EINVAL;
@@ -213,14 +213,14 @@ int ps3_close_hv_device(struct ps3_system_bus_device *dev)
                return ps3_close_hv_device_sb(dev);
 
        case PS3_MATCH_ID_SOUND:
-       case PS3_MATCH_ID_GRAPHICS:
+       case PS3_MATCH_ID_GPU:
                return ps3_close_hv_device_gpu(dev);
 
        case PS3_MATCH_ID_AV_SETTINGS:
        case PS3_MATCH_ID_SYSTEM_MANAGER:
                pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
                        __LINE__, dev->match_id);
-               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
+               pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,
                        dev->bus_id);
                BUG();
                return -EINVAL;
@@ -240,7 +240,7 @@ EXPORT_SYMBOL_GPL(ps3_close_hv_device);
 static void _dump_mmio_region(const struct ps3_mmio_region* r,
        const char* func, int line)
 {
-       pr_debug("%s:%d: dev       %lu:%lu\n", func, line, r->dev->bus_id,
+       pr_debug("%s:%d: dev       %llu:%llu\n", func, line, r->dev->bus_id,
                r->dev->dev_id);
        pr_debug("%s:%d: bus_addr  %lxh\n", func, line, r->bus_addr);
        pr_debug("%s:%d: len       %lxh\n", func, line, r->len);
@@ -250,9 +250,11 @@ static void _dump_mmio_region(const struct ps3_mmio_region* r,
 static int ps3_sb_mmio_region_create(struct ps3_mmio_region *r)
 {
        int result;
+       u64 lpar_addr;
 
        result = lv1_map_device_mmio_region(r->dev->bus_id, r->dev->dev_id,
-               r->bus_addr, r->len, r->page_size, &r->lpar_addr);
+               r->bus_addr, r->len, r->page_size, &lpar_addr);
+       r->lpar_addr = lpar_addr;
 
        if (result) {
                pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n",
@@ -356,12 +358,12 @@ static int ps3_system_bus_match(struct device *_dev,
        if (result)
                pr_info("%s:%d: dev=%u.%u(%s), drv=%u.%u(%s): match\n",
                        __func__, __LINE__,
-                       dev->match_id, dev->match_sub_id, dev->core.bus_id,
+                       dev->match_id, dev->match_sub_id, dev_name(&dev->core),
                        drv->match_id, drv->match_sub_id, drv->core.name);
        else
                pr_debug("%s:%d: dev=%u.%u(%s), drv=%u.%u(%s): miss\n",
                        __func__, __LINE__,
-                       dev->match_id, dev->match_sub_id, dev->core.bus_id,
+                       dev->match_id, dev->match_sub_id, dev_name(&dev->core),
                        drv->match_id, drv->match_sub_id, drv->core.name);
 
        return result;
@@ -383,9 +385,9 @@ static int ps3_system_bus_probe(struct device *_dev)
                result = drv->probe(dev);
        else
                pr_debug("%s:%d: %s no probe method\n", __func__, __LINE__,
-                       dev->core.bus_id);
+                       dev_name(&dev->core));
 
-       pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev->core.bus_id);
+       pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev_name(&dev->core));
        return result;
 }
 
@@ -407,7 +409,7 @@ static int ps3_system_bus_remove(struct device *_dev)
                dev_dbg(&dev->core, "%s:%d %s: no remove method\n",
                        __func__, __LINE__, drv->core.name);
 
-       pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev->core.bus_id);
+       pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev_name(&dev->core));
        return result;
 }
 
@@ -432,7 +434,7 @@ static void ps3_system_bus_shutdown(struct device *_dev)
        BUG_ON(!drv);
 
        dev_dbg(&dev->core, "%s:%d: %s -> %s\n", __func__, __LINE__,
-               dev->core.bus_id, drv->core.name);
+               dev_name(&dev->core), drv->core.name);
 
        if (drv->shutdown)
                drv->shutdown(dev);
@@ -453,7 +455,8 @@ static int ps3_system_bus_uevent(struct device *_dev, struct kobj_uevent_env *en
 {
        struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
 
-       if (add_uevent_var(env, "MODALIAS=ps3:%d", dev->match_id))
+       if (add_uevent_var(env, "MODALIAS=ps3:%d:%d", dev->match_id,
+                          dev->match_sub_id))
                return -ENOMEM;
        return 0;
 }
@@ -462,7 +465,8 @@ static ssize_t modalias_show(struct device *_dev, struct device_attribute *a,
        char *buf)
 {
        struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
-       int len = snprintf(buf, PAGE_SIZE, "ps3:%d\n", dev->match_id);
+       int len = snprintf(buf, PAGE_SIZE, "ps3:%d:%d\n", dev->match_id,
+                          dev->match_sub_id);
 
        return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
 }
@@ -566,7 +570,7 @@ static dma_addr_t ps3_sb_map_page(struct device *_dev, struct page *page,
 {
        struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
        int result;
-       unsigned long bus_addr;
+       dma_addr_t bus_addr;
        void *ptr = page_address(page) + offset;
 
        result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size,
@@ -588,7 +592,7 @@ static dma_addr_t ps3_ioc0_map_page(struct device *_dev, struct page *page,
 {
        struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
        int result;
-       unsigned long bus_addr;
+       dma_addr_t bus_addr;
        u64 iopte_flag;
        void *ptr = page_address(page) + offset;
 
@@ -742,22 +746,18 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev)
        switch (dev->dev_type) {
        case PS3_DEVICE_TYPE_IOC0:
                dev->core.archdata.dma_ops = &ps3_ioc0_dma_ops;
-               snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
-                       "ioc0_%02x", ++dev_ioc0_count);
+               dev_set_name(&dev->core, "ioc0_%02x", ++dev_ioc0_count);
                break;
        case PS3_DEVICE_TYPE_SB:
                dev->core.archdata.dma_ops = &ps3_sb_dma_ops;
-               snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
-                       "sb_%02x", ++dev_sb_count);
+               dev_set_name(&dev->core, "sb_%02x", ++dev_sb_count);
 
                break;
        case PS3_DEVICE_TYPE_VUART:
-               snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
-                       "vuart_%02x", ++dev_vuart_count);
+               dev_set_name(&dev->core, "vuart_%02x", ++dev_vuart_count);
                break;
        case PS3_DEVICE_TYPE_LPM:
-               snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
-                       "lpm_%02x", ++dev_lpm_count);
+               dev_set_name(&dev->core, "lpm_%02x", ++dev_lpm_count);
                break;
        default:
                BUG();
@@ -766,7 +766,7 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev)
        dev->core.archdata.of_node = NULL;
        set_dev_node(&dev->core, 0);
 
-       pr_debug("%s:%d add %s\n", __func__, __LINE__, dev->core.bus_id);
+       pr_debug("%s:%d add %s\n", __func__, __LINE__, dev_name(&dev->core));
 
        result = device_register(&dev->core);
        return result;