diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-02-01 03:06:05 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-01 08:53:20 -0800 |
commit | 37cc7943788c841b03a48c00751dfac0ad9f5b12 (patch) | |
tree | e25d4f7738b675cbb5129da9eaa6c0b56e398e1b /arch/sh/kernel | |
parent | 8d27e08191379b7a3302a33a6efdb8bdfd319c95 (diff) | |
download | blackbird-op-linux-37cc7943788c841b03a48c00751dfac0ad9f5b12.tar.gz blackbird-op-linux-37cc7943788c841b03a48c00751dfac0ad9f5b12.zip |
[PATCH] sh: convert voyagergx to platform device, drop sh-bus
Trivial patch updating the voyagergx cchip code to reference a platform device
instead, now that the dma mask is taken care of. Given this, there's no
longer any reason to drag around the SH-bus code, so kill that off entirely.
Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/Makefile | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/bus.c | 197 |
2 files changed, 1 insertions, 198 deletions
diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile index 5bfc33bec5d0..59d5b748752f 100644 --- a/arch/sh/kernel/cpu/Makefile +++ b/arch/sh/kernel/cpu/Makefile @@ -2,7 +2,7 @@ # Makefile for the Linux/SuperH CPU-specifc backends. # -obj-y += irq/ init.o bus.o clock.o +obj-y += irq/ init.o clock.o obj-$(CONFIG_CPU_SH2) += sh2/ obj-$(CONFIG_CPU_SH3) += sh3/ diff --git a/arch/sh/kernel/cpu/bus.c b/arch/sh/kernel/cpu/bus.c deleted file mode 100644 index fc6c4bd40c65..000000000000 --- a/arch/sh/kernel/cpu/bus.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * arch/sh/kernel/cpu/bus.c - * - * Virtual bus for SuperH. - * - * Copyright (C) 2004 Paul Mundt - * - * Shamelessly cloned from arch/arm/mach-omap/bus.c, which was written - * by: - * - * Copyright (C) 2003 - 2004 Nokia Corporation - * Written by Tony Lindgren <tony@atomide.com> - * Portions of code based on sa1111.c. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ -#include <linux/kernel.h> -#include <linux/device.h> -#include <linux/init.h> -#include <linux/module.h> -#include <asm/bus-sh.h> - -static int sh_bus_match(struct device *dev, struct device_driver *drv) -{ - struct sh_driver *shdrv = to_sh_driver(drv); - struct sh_dev *shdev = to_sh_dev(dev); - - return shdev->dev_id == shdrv->dev_id; -} - -static int sh_bus_suspend(struct device *dev, pm_message_t state) -{ - struct sh_dev *shdev = to_sh_dev(dev); - struct sh_driver *shdrv = to_sh_driver(dev->driver); - - if (shdrv && shdrv->suspend) - return shdrv->suspend(shdev, state); - - return 0; -} - -static int sh_bus_resume(struct device *dev) -{ - struct sh_dev *shdev = to_sh_dev(dev); - struct sh_driver *shdrv = to_sh_driver(dev->driver); - - if (shdrv && shdrv->resume) - return shdrv->resume(shdev); - - return 0; -} - -static int sh_device_probe(struct device *dev) -{ - struct sh_dev *shdev = to_sh_dev(dev); - struct sh_driver *shdrv = to_sh_driver(dev->driver); - - if (shdrv && shdrv->probe) - return shdrv->probe(shdev); - - return -ENODEV; -} - -static int sh_device_remove(struct device *dev) -{ - struct sh_dev *shdev = to_sh_dev(dev); - struct sh_driver *shdrv = to_sh_driver(dev->driver); - - if (shdrv && shdrv->remove) - return shdrv->remove(shdev); - - return 0; -} - -static struct device sh_bus_devices[SH_NR_BUSES] = { - { - .bus_id = SH_BUS_NAME_VIRT, - }, -}; - -struct bus_type sh_bus_types[SH_NR_BUSES] = { - { - .name = SH_BUS_NAME_VIRT, - .match = sh_bus_match, - .probe = sh_bus_probe, - .remove = sh_bus_remove, - .suspend = sh_bus_suspend, - .resume = sh_bus_resume, - }, -}; - -int sh_device_register(struct sh_dev *dev) -{ - if (!dev) - return -EINVAL; - - if (dev->bus_id < 0 || dev->bus_id >= SH_NR_BUSES) { - printk(KERN_ERR "%s: bus_id invalid: %s bus: %d\n", - __FUNCTION__, dev->name, dev->bus_id); - return -EINVAL; - } - - dev->dev.parent = &sh_bus_devices[dev->bus_id]; - dev->dev.bus = &sh_bus_types[dev->bus_id]; - - /* This is needed for USB OHCI to work */ - if (dev->dma_mask) - dev->dev.dma_mask = dev->dma_mask; - if (dev->coherent_dma_mask) - dev->dev.coherent_dma_mask = dev->coherent_dma_mask; - - snprintf(dev->dev.bus_id, BUS_ID_SIZE, "%s%u", - dev->name, dev->dev_id); - - printk(KERN_INFO "Registering SH device '%s'. Parent at %s\n", - dev->dev.bus_id, dev->dev.parent->bus_id); - - return device_register(&dev->dev); -} - -void sh_device_unregister(struct sh_dev *dev) -{ - device_unregister(&dev->dev); -} - -int sh_driver_register(struct sh_driver *drv) -{ - if (!drv) - return -EINVAL; - - if (drv->bus_id < 0 || drv->bus_id >= SH_NR_BUSES) { - printk(KERN_ERR "%s: bus_id invalid: bus: %d device %d\n", - __FUNCTION__, drv->bus_id, drv->dev_id); - return -EINVAL; - } - - drv->drv.bus = &sh_bus_types[drv->bus_id]; - - return driver_register(&drv->drv); -} - -void sh_driver_unregister(struct sh_driver *drv) -{ - driver_unregister(&drv->drv); -} - -static int __init sh_bus_init(void) -{ - int i, ret = 0; - - for (i = 0; i < SH_NR_BUSES; i++) { - ret = device_register(&sh_bus_devices[i]); - if (ret != 0) { - printk(KERN_ERR "Unable to register bus device %s\n", - sh_bus_devices[i].bus_id); - continue; - } - - ret = bus_register(&sh_bus_types[i]); - if (ret != 0) { - printk(KERN_ERR "Unable to register bus %s\n", - sh_bus_types[i].name); - device_unregister(&sh_bus_devices[i]); - } - } - - printk(KERN_INFO "SH Virtual Bus initialized\n"); - - return ret; -} - -static void __exit sh_bus_exit(void) -{ - int i; - - for (i = 0; i < SH_NR_BUSES; i++) { - bus_unregister(&sh_bus_types[i]); - device_unregister(&sh_bus_devices[i]); - } -} - -module_init(sh_bus_init); -module_exit(sh_bus_exit); - -MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>"); -MODULE_DESCRIPTION("SH Virtual Bus"); -MODULE_LICENSE("GPL"); - -EXPORT_SYMBOL(sh_bus_types); -EXPORT_SYMBOL(sh_device_register); -EXPORT_SYMBOL(sh_device_unregister); -EXPORT_SYMBOL(sh_driver_register); -EXPORT_SYMBOL(sh_driver_unregister); - |