1
0
Fork 0

Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6

* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6: (21 commits)
  tty: serial: altera_jtaguart: Add device tree support
  tty: serial: altera_uart: Add devicetree support
  dt: eliminate of_platform_driver shim code
  dt: Eliminate of_platform_{,un}register_driver
  dt/serial: Eliminate users of of_platform_{,un}register_driver
  dt/usb: Eliminate users of of_platform_{,un}register_driver
  dt/video: Eliminate users of of_platform_{,un}register_driver
  dt/net: Eliminate users of of_platform_{,un}register_driver
  dt/sound: Eliminate users of of_platform_{,un}register_driver
  dt/spi: Eliminate users of of_platform_{,un}register_driver
  dt: uartlite: merge platform and of_platform driver bindings
  dt: xilinx_hwicap: merge platform and of_platform driver bindings
  ipmi: convert OF driver to platform driver
  leds/leds-gpio: merge platform_driver with of_platform_driver
  dt/sparc: Eliminate users of of_platform_{,un}register_driver
  dt/powerpc: Eliminate users of of_platform_{,un}register_driver
  dt/powerpc: move of_bus_type infrastructure to ibmebus
  drivercore/dt: add a match table pointer to struct device
  dt: Typo fix.
  altera_ps2: Add devicetree support
  ...
hifive-unleashed-5.1
Linus Torvalds 2011-03-16 17:28:10 -07:00
commit 4c5811bf46
178 changed files with 1423 additions and 1741 deletions

View File

@ -0,0 +1,4 @@
Altera JTAG UART
Required properties:
- compatible : should be "ALTR,juart-1.0"

View File

@ -0,0 +1,7 @@
Altera UART
Required properties:
- compatible : should be "ALTR,uart-1.0"
Optional properties:
- clock-frequency : frequency of the clock input to the UART

View File

@ -0,0 +1,4 @@
Altera UP PS/2 controller
Required properties:
- compatible : should be "ALTR,ps2-1.0".

View File

@ -332,6 +332,7 @@ static void __devinit pcibios_scan_phb(struct pci_controller *hose)
hose->global_number);
return;
}
bus.dev->of_node = of_node_get(node);
bus->secondary = hose->first_busno;
hose->bus = bus;

View File

@ -164,13 +164,13 @@ extern void setup_indirect_pci(struct pci_controller* hose,
resource_size_t cfg_addr,
resource_size_t cfg_data, u32 flags);
#ifndef CONFIG_PPC64
static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
{
return bus->sysdata;
}
#ifndef CONFIG_PPC64
static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
{
struct pci_controller *host;
@ -228,19 +228,10 @@ extern void * update_dn_pci_info(struct device_node *dn, void *data);
/* Get a device_node from a pci_dev. This code must be fast except
* in the case where the sysdata is incorrect and needs to be fixed
* up (this will only happen once).
* In this case the sysdata will have been inherited from a PCI host
* bridge or a PCI-PCI bridge further up the tree, so it will point
* to a valid struct pci_dn, just not the one we want.
*/
* up (this will only happen once). */
static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
{
struct device_node *dn = dev->sysdata;
struct pci_dn *pdn = dn->data;
if (pdn && pdn->devfn == dev->devfn && pdn->busno == dev->bus->number)
return dn; /* fast path. sysdata is good */
return fetch_dev_dn(dev);
return dev->dev.of_node ? dev->dev.of_node : fetch_dev_dn(dev);
}
static inline int pci_device_from_OF_node(struct device_node *np,
@ -258,7 +249,7 @@ static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
if (bus->self)
return pci_device_to_OF_node(bus->self);
else
return bus->sysdata; /* Must be root bus (PHB) */
return bus->dev.of_node; /* Must be root bus (PHB) */
}
/** Find the bus corresponding to the indicated device node */
@ -270,14 +261,6 @@ extern void pcibios_remove_pci_devices(struct pci_bus *bus);
/** Discover new pci devices under this bus, and add them */
extern void pcibios_add_pci_devices(struct pci_bus *bus);
static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
{
struct device_node *busdn = bus->sysdata;
BUG_ON(busdn == NULL);
return PCI_DN(busdn)->phb;
}
extern void isa_bridge_find_early(struct pci_controller *hose);

View File

@ -201,7 +201,7 @@ extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
extern void pcibios_setup_bus_devices(struct pci_bus *bus);
extern void pcibios_setup_bus_self(struct pci_bus *bus);
extern void pcibios_setup_phb_io_space(struct pci_controller *hose);
extern void pcibios_scan_phb(struct pci_controller *hose, void *sysdata);
extern void pcibios_scan_phb(struct pci_controller *hose);
#endif /* __KERNEL__ */
#endif /* __ASM_POWERPC_PCI_H */

View File

@ -201,13 +201,14 @@ int ibmebus_register_driver(struct of_platform_driver *drv)
/* If the driver uses devices that ibmebus doesn't know, add them */
ibmebus_create_devices(drv->driver.of_match_table);
return of_register_driver(drv, &ibmebus_bus_type);
drv->driver.bus = &ibmebus_bus_type;
return driver_register(&drv->driver);
}
EXPORT_SYMBOL(ibmebus_register_driver);
void ibmebus_unregister_driver(struct of_platform_driver *drv)
{
of_unregister_driver(drv);
driver_unregister(&drv->driver);
}
EXPORT_SYMBOL(ibmebus_unregister_driver);
@ -308,15 +309,410 @@ static ssize_t ibmebus_store_remove(struct bus_type *bus,
}
}
static struct bus_attribute ibmebus_bus_attrs[] = {
__ATTR(probe, S_IWUSR, NULL, ibmebus_store_probe),
__ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove),
__ATTR_NULL
};
static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv)
{
const struct of_device_id *matches = drv->of_match_table;
if (!matches)
return 0;
return of_match_device(matches, dev) != NULL;
}
static int ibmebus_bus_device_probe(struct device *dev)
{
int error = -ENODEV;
struct of_platform_driver *drv;
struct platform_device *of_dev;
const struct of_device_id *match;
drv = to_of_platform_driver(dev->driver);
of_dev = to_platform_device(dev);
if (!drv->probe)
return error;
of_dev_get(of_dev);
match = of_match_device(drv->driver.of_match_table, dev);
if (match)
error = drv->probe(of_dev, match);
if (error)
of_dev_put(of_dev);
return error;
}
static int ibmebus_bus_device_remove(struct device *dev)
{
struct platform_device *of_dev = to_platform_device(dev);
struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
if (dev->driver && drv->remove)
drv->remove(of_dev);
return 0;
}
static void ibmebus_bus_device_shutdown(struct device *dev)
{
struct platform_device *of_dev = to_platform_device(dev);
struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
if (dev->driver && drv->shutdown)
drv->shutdown(of_dev);
}
/*
* ibmebus_bus_device_attrs
*/
static ssize_t devspec_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct platform_device *ofdev;
ofdev = to_platform_device(dev);
return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name);
}
static ssize_t name_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct platform_device *ofdev;
ofdev = to_platform_device(dev);
return sprintf(buf, "%s\n", ofdev->dev.of_node->name);
}
static ssize_t modalias_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
ssize_t len = of_device_get_modalias(dev, buf, PAGE_SIZE - 2);
buf[len] = '\n';
buf[len+1] = 0;
return len+1;
}
struct device_attribute ibmebus_bus_device_attrs[] = {
__ATTR_RO(devspec),
__ATTR_RO(name),
__ATTR_RO(modalias),
__ATTR_NULL
};
#ifdef CONFIG_PM_SLEEP
static int ibmebus_bus_legacy_suspend(struct device *dev, pm_message_t mesg)
{
struct platform_device *of_dev = to_platform_device(dev);
struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
int ret = 0;
if (dev->driver && drv->suspend)
ret = drv->suspend(of_dev, mesg);
return ret;
}
static int ibmebus_bus_legacy_resume(struct device *dev)
{
struct platform_device *of_dev = to_platform_device(dev);
struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
int ret = 0;
if (dev->driver && drv->resume)
ret = drv->resume(of_dev);
return ret;
}
static int ibmebus_bus_pm_prepare(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (drv && drv->pm && drv->pm->prepare)
ret = drv->pm->prepare(dev);
return ret;
}
static void ibmebus_bus_pm_complete(struct device *dev)
{
struct device_driver *drv = dev->driver;
if (drv && drv->pm && drv->pm->complete)
drv->pm->complete(dev);
}
#ifdef CONFIG_SUSPEND
static int ibmebus_bus_pm_suspend(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->suspend)
ret = drv->pm->suspend(dev);
} else {
ret = ibmebus_bus_legacy_suspend(dev, PMSG_SUSPEND);
}
return ret;
}
static int ibmebus_bus_pm_suspend_noirq(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->suspend_noirq)
ret = drv->pm->suspend_noirq(dev);
}
return ret;
}
static int ibmebus_bus_pm_resume(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->resume)
ret = drv->pm->resume(dev);
} else {
ret = ibmebus_bus_legacy_resume(dev);
}
return ret;
}
static int ibmebus_bus_pm_resume_noirq(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->resume_noirq)
ret = drv->pm->resume_noirq(dev);
}
return ret;
}
#else /* !CONFIG_SUSPEND */
#define ibmebus_bus_pm_suspend NULL
#define ibmebus_bus_pm_resume NULL
#define ibmebus_bus_pm_suspend_noirq NULL
#define ibmebus_bus_pm_resume_noirq NULL
#endif /* !CONFIG_SUSPEND */
#ifdef CONFIG_HIBERNATION
static int ibmebus_bus_pm_freeze(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->freeze)
ret = drv->pm->freeze(dev);
} else {
ret = ibmebus_bus_legacy_suspend(dev, PMSG_FREEZE);
}
return ret;
}
static int ibmebus_bus_pm_freeze_noirq(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->freeze_noirq)
ret = drv->pm->freeze_noirq(dev);
}
return ret;
}
static int ibmebus_bus_pm_thaw(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->thaw)
ret = drv->pm->thaw(dev);
} else {
ret = ibmebus_bus_legacy_resume(dev);
}
return ret;
}
static int ibmebus_bus_pm_thaw_noirq(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->thaw_noirq)
ret = drv->pm->thaw_noirq(dev);
}
return ret;
}
static int ibmebus_bus_pm_poweroff(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->poweroff)
ret = drv->pm->poweroff(dev);
} else {
ret = ibmebus_bus_legacy_suspend(dev, PMSG_HIBERNATE);
}
return ret;
}
static int ibmebus_bus_pm_poweroff_noirq(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->poweroff_noirq)
ret = drv->pm->poweroff_noirq(dev);
}
return ret;
}
static int ibmebus_bus_pm_restore(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->restore)
ret = drv->pm->restore(dev);
} else {
ret = ibmebus_bus_legacy_resume(dev);
}
return ret;
}
static int ibmebus_bus_pm_restore_noirq(struct device *dev)
{
struct device_driver *drv = dev->driver;
int ret = 0;
if (!drv)
return 0;
if (drv->pm) {
if (drv->pm->restore_noirq)
ret = drv->pm->restore_noirq(dev);
}
return ret;
}
#else /* !CONFIG_HIBERNATION */
#define ibmebus_bus_pm_freeze NULL
#define ibmebus_bus_pm_thaw NULL
#define ibmebus_bus_pm_poweroff NULL
#define ibmebus_bus_pm_restore NULL
#define ibmebus_bus_pm_freeze_noirq NULL
#define ibmebus_bus_pm_thaw_noirq NULL
#define ibmebus_bus_pm_poweroff_noirq NULL
#define ibmebus_bus_pm_restore_noirq NULL
#endif /* !CONFIG_HIBERNATION */
static struct dev_pm_ops ibmebus_bus_dev_pm_ops = {
.prepare = ibmebus_bus_pm_prepare,
.complete = ibmebus_bus_pm_complete,
.suspend = ibmebus_bus_pm_suspend,
.resume = ibmebus_bus_pm_resume,
.freeze = ibmebus_bus_pm_freeze,
.thaw = ibmebus_bus_pm_thaw,
.poweroff = ibmebus_bus_pm_poweroff,
.restore = ibmebus_bus_pm_restore,
.suspend_noirq = ibmebus_bus_pm_suspend_noirq,
.resume_noirq = ibmebus_bus_pm_resume_noirq,
.freeze_noirq = ibmebus_bus_pm_freeze_noirq,
.thaw_noirq = ibmebus_bus_pm_thaw_noirq,
.poweroff_noirq = ibmebus_bus_pm_poweroff_noirq,
.restore_noirq = ibmebus_bus_pm_restore_noirq,
};
#define IBMEBUS_BUS_PM_OPS_PTR (&ibmebus_bus_dev_pm_ops)
#else /* !CONFIG_PM_SLEEP */
#define IBMEBUS_BUS_PM_OPS_PTR NULL
#endif /* !CONFIG_PM_SLEEP */
struct bus_type ibmebus_bus_type = {
.name = "ibmebus",
.uevent = of_device_uevent,
.bus_attrs = ibmebus_bus_attrs
.bus_attrs = ibmebus_bus_attrs,
.match = ibmebus_bus_bus_match,
.probe = ibmebus_bus_device_probe,
.remove = ibmebus_bus_device_remove,
.shutdown = ibmebus_bus_device_shutdown,
.dev_attrs = ibmebus_bus_device_attrs,
.pm = IBMEBUS_BUS_PM_OPS_PTR,
};
EXPORT_SYMBOL(ibmebus_bus_type);
@ -326,7 +722,7 @@ static int __init ibmebus_bus_init(void)
printk(KERN_INFO "IBM eBus Device Driver\n");
err = of_bus_type_init(&ibmebus_bus_type, "ibmebus");
err = bus_register(&ibmebus_bus_type);
if (err) {
printk(KERN_ERR "%s: failed to register IBM eBus.\n",
__func__);

View File

@ -36,8 +36,7 @@
* lacking some bits needed here.
*/
static int __devinit of_pci_phb_probe(struct platform_device *dev,
const struct of_device_id *match)
static int __devinit of_pci_phb_probe(struct platform_device *dev)
{
struct pci_controller *phb;
@ -74,7 +73,7 @@ static int __devinit of_pci_phb_probe(struct platform_device *dev,
#endif /* CONFIG_EEH */
/* Scan the bus */
pcibios_scan_phb(phb, dev->dev.of_node);
pcibios_scan_phb(phb);
if (phb->bus == NULL)
return -ENXIO;
@ -104,7 +103,7 @@ static struct of_device_id of_pci_phb_ids[] = {
{}
};
static struct of_platform_driver of_pci_phb_driver = {
static struct platform_driver of_pci_phb_driver = {
.probe = of_pci_phb_probe,
.driver = {
.name = "of-pci",
@ -115,7 +114,7 @@ static struct of_platform_driver of_pci_phb_driver = {
static __init int of_pci_phb_init(void)
{
return of_register_platform_driver(&of_pci_phb_driver);
return platform_driver_register(&of_pci_phb_driver);
}
device_initcall(of_pci_phb_init);

View File

@ -1688,13 +1688,8 @@ int early_find_capability(struct pci_controller *hose, int bus, int devfn,
/**
* pci_scan_phb - Given a pci_controller, setup and scan the PCI bus
* @hose: Pointer to the PCI host controller instance structure
* @sysdata: value to use for sysdata pointer. ppc32 and ppc64 differ here
*
* Note: the 'data' pointer is a temporary measure. As 32 and 64 bit
* pci code gets merged, this parameter should become unnecessary because
* both will use the same value.
*/
void __devinit pcibios_scan_phb(struct pci_controller *hose, void *sysdata)
void __devinit pcibios_scan_phb(struct pci_controller *hose)
{
struct pci_bus *bus;
struct device_node *node = hose->dn;
@ -1704,13 +1699,13 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose, void *sysdata)
node ? node->full_name : "<NO NAME>");
/* Create an empty bus for the toplevel */
bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops,
sysdata);
bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, hose);
if (bus == NULL) {
pr_err("Failed to create bus for PCI domain %04x\n",
hose->global_number);
return;
}
bus->dev.of_node = of_node_get(node);
bus->secondary = hose->first_busno;
hose->bus = bus;

View File

@ -381,7 +381,7 @@ static int __init pcibios_init(void)
if (pci_assign_all_buses)
hose->first_busno = next_busno;
hose->last_busno = 0xff;
pcibios_scan_phb(hose, hose);
pcibios_scan_phb(hose);
pci_bus_add_devices(hose->bus);
if (pci_assign_all_buses || next_busno <= hose->last_busno)
next_busno = hose->last_busno + pcibios_assign_bus_offset;

View File

@ -64,7 +64,7 @@ static int __init pcibios_init(void)
/* Scan all of the recorded PCI controllers. */
list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
pcibios_scan_phb(hose, hose->dn);
pcibios_scan_phb(hose);
pci_bus_add_devices(hose->bus);
}
@ -242,10 +242,10 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
break;
bus = NULL;
}
if (bus == NULL || bus->sysdata == NULL)
if (bus == NULL || bus->dev.of_node == NULL)
return -ENODEV;
hose_node = (struct device_node *)bus->sysdata;
hose_node = bus->dev.of_node;
hose = PCI_DN(hose_node)->phb;
switch (which) {

View File

@ -161,7 +161,7 @@ static void *is_devfn_node(struct device_node *dn, void *data)
/*
* This is the "slow" path for looking up a device_node from a
* pci_dev. It will hunt for the device under its parent's
* phb and then update sysdata for a future fastpath.
* phb and then update of_node pointer.
*
* It may also do fixups on the actual device since this happens
* on the first read/write.
@ -170,16 +170,19 @@ static void *is_devfn_node(struct device_node *dn, void *data)
* In this case it may probe for real hardware ("just in case")
* and add a device_node to the device tree if necessary.
*
* Is this function necessary anymore now that dev->dev.of_node is
* used to store the node pointer?
*
*/
struct device_node *fetch_dev_dn(struct pci_dev *dev)
{
struct device_node *orig_dn = dev->sysdata;
struct device_node *orig_dn = dev->dev.of_node;
struct device_node *dn;
unsigned long searchval = (dev->bus->number << 8) | dev->devfn;
dn = traverse_pci_devices(orig_dn, is_devfn_node, (void *)searchval);
if (dn)
dev->sysdata = dn;
dev->dev.of_node = dn;
return dn;
}
EXPORT_SYMBOL(fetch_dev_dn);

View File

@ -135,7 +135,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
pr_debug(" create device, devfn: %x, type: %s\n", devfn, type);
dev->bus = bus;
dev->sysdata = node;
dev->dev.of_node = of_node_get(node);
dev->dev.parent = bus->bridge;
dev->dev.bus = &pci_bus_type;
dev->devfn = devfn;
@ -238,7 +238,7 @@ void __devinit of_scan_pci_bridge(struct device_node *node,
bus->primary = dev->bus->number;
bus->subordinate = busrange[1];
bus->bridge_ctl = 0;
bus->sysdata = node;
bus->dev.of_node = of_node_get(node);
/* parse ranges property */
/* PCI #address-cells == 3 and #size-cells == 2 always */

View File

@ -147,8 +147,7 @@ mpc52xx_wkup_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
return 0;
}
static int __devinit mpc52xx_wkup_gpiochip_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit mpc52xx_wkup_gpiochip_probe(struct platform_device *ofdev)
{
struct mpc52xx_gpiochip *chip;
struct mpc52xx_gpio_wkup __iomem *regs;
@ -191,7 +190,7 @@ static const struct of_device_id mpc52xx_wkup_gpiochip_match[] = {
{}
};
static struct of_platform_driver mpc52xx_wkup_gpiochip_driver = {
static struct platform_driver mpc52xx_wkup_gpiochip_driver = {
.driver = {
.name = "gpio_wkup",
.owner = THIS_MODULE,
@ -310,8 +309,7 @@ mpc52xx_simple_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
return 0;
}
static int __devinit mpc52xx_simple_gpiochip_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit mpc52xx_simple_gpiochip_probe(struct platform_device *ofdev)
{
struct mpc52xx_gpiochip *chip;
struct gpio_chip *gc;
@ -349,7 +347,7 @@ static const struct of_device_id mpc52xx_simple_gpiochip_match[] = {
{}
};
static struct of_platform_driver mpc52xx_simple_gpiochip_driver = {
static struct platform_driver mpc52xx_simple_gpiochip_driver = {
.driver = {
.name = "gpio",
.owner = THIS_MODULE,
@ -361,10 +359,10 @@ static struct of_platform_driver mpc52xx_simple_gpiochip_driver = {
static int __init mpc52xx_gpio_init(void)
{
if (of_register_platform_driver(&mpc52xx_wkup_gpiochip_driver))
if (platform_driver_register(&mpc52xx_wkup_gpiochip_driver))
printk(KERN_ERR "Unable to register wakeup GPIO driver\n");
if (of_register_platform_driver(&mpc52xx_simple_gpiochip_driver))
if (platform_driver_register(&mpc52xx_simple_gpiochip_driver))
printk(KERN_ERR "Unable to register simple GPIO driver\n");
return 0;

View File

@ -721,8 +721,7 @@ static inline int mpc52xx_gpt_wdt_setup(struct mpc52xx_gpt_priv *gpt,
/* ---------------------------------------------------------------------
* of_platform bus binding code
*/
static int __devinit mpc52xx_gpt_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit mpc52xx_gpt_probe(struct platform_device *ofdev)
{
struct mpc52xx_gpt_priv *gpt;
@ -781,7 +780,7 @@ static const struct of_device_id mpc52xx_gpt_match[] = {
{}
};
static struct of_platform_driver mpc52xx_gpt_driver = {
static struct platform_driver mpc52xx_gpt_driver = {
.driver = {
.name = "mpc52xx-gpt",
.owner = THIS_MODULE,
@ -793,10 +792,7 @@ static struct of_platform_driver mpc52xx_gpt_driver = {
static int __init mpc52xx_gpt_init(void)
{
if (of_register_platform_driver(&mpc52xx_gpt_driver))
pr_err("error registering MPC52xx GPT driver\n");
return 0;
return platform_driver_register(&mpc52xx_gpt_driver);
}
/* Make sure GPIOs and IRQs get set up before anyone tries to use them */

View File

@ -436,8 +436,7 @@ void mpc52xx_lpbfifo_abort(struct mpc52xx_lpbfifo_request *req)
}
EXPORT_SYMBOL(mpc52xx_lpbfifo_abort);
static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit mpc52xx_lpbfifo_probe(struct platform_device *op)
{
struct resource res;
int rc = -ENOMEM;
@ -536,7 +535,7 @@ static struct of_device_id mpc52xx_lpbfifo_match[] __devinitconst = {
{},
};
static struct of_platform_driver mpc52xx_lpbfifo_driver = {
static struct platform_driver mpc52xx_lpbfifo_driver = {
.driver = {
.name = "mpc52xx-lpbfifo",
.owner = THIS_MODULE,
@ -551,14 +550,12 @@ static struct of_platform_driver mpc52xx_lpbfifo_driver = {
*/
static int __init mpc52xx_lpbfifo_init(void)
{
pr_debug("Registering LocalPlus bus FIFO driver\n");
return of_register_platform_driver(&mpc52xx_lpbfifo_driver);
return platform_driver_register(&mpc52xx_lpbfifo_driver);
}
module_init(mpc52xx_lpbfifo_init);
static void __exit mpc52xx_lpbfifo_exit(void)
{
pr_debug("Unregistering LocalPlus bus FIFO driver\n");
of_unregister_platform_driver(&mpc52xx_lpbfifo_driver);
platform_driver_unregister(&mpc52xx_lpbfifo_driver);
}
module_exit(mpc52xx_lpbfifo_exit);

View File

@ -111,8 +111,7 @@ static struct mdiobb_ctrl ep8248e_mdio_ctrl = {
.ops = &ep8248e_mdio_ops,
};
static int __devinit ep8248e_mdio_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit ep8248e_mdio_probe(struct platform_device *ofdev)
{
struct mii_bus *bus;
struct resource res;
@ -167,7 +166,7 @@ static const struct of_device_id ep8248e_mdio_match[] = {
{},
};
static struct of_platform_driver ep8248e_mdio_driver = {
static struct platform_driver ep8248e_mdio_driver = {
.driver = {
.name = "ep8248e-mdio-bitbang",
.owner = THIS_MODULE,
@ -308,7 +307,7 @@ static __initdata struct of_device_id of_bus_ids[] = {
static int __init declare_of_platform_devices(void)
{
of_platform_bus_probe(NULL, of_bus_ids, NULL);
of_register_platform_driver(&ep8248e_mdio_driver);
platform_driver_register(&ep8248e_mdio_driver);
return 0;
}

View File

@ -318,14 +318,18 @@ static const struct platform_suspend_ops mpc83xx_suspend_ops = {
.end = mpc83xx_suspend_end,
};
static int pmc_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int pmc_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct resource res;
struct pmc_type *type = match->data;
struct pmc_type *type;
int ret = 0;
if (!ofdev->dev.of_match)
return -EINVAL;
type = ofdev->dev.of_match->data;
if (!of_device_is_available(np))
return -ENODEV;
@ -422,7 +426,7 @@ static struct of_device_id pmc_match[] = {
{}
};
static struct of_platform_driver pmc_driver = {
static struct platform_driver pmc_driver = {
.driver = {
.name = "mpc83xx-pmc",
.owner = THIS_MODULE,
@ -434,7 +438,7 @@ static struct of_platform_driver pmc_driver = {
static int pmc_init(void)
{
return of_register_platform_driver(&pmc_driver);
return platform_driver_register(&pmc_driver);
}
module_init(pmc_init);

View File

@ -328,7 +328,7 @@ static struct irq_host_ops msic_host_ops = {
.map = msic_host_map,
};
static int axon_msi_shutdown(struct platform_device *device)
static void axon_msi_shutdown(struct platform_device *device)
{
struct axon_msic *msic = dev_get_drvdata(&device->dev);
u32 tmp;
@ -338,12 +338,9 @@ static int axon_msi_shutdown(struct platform_device *device)
tmp = dcr_read(msic->dcr_host, MSIC_CTRL_REG);
tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE;
msic_dcr_write(msic, MSIC_CTRL_REG, tmp);
return 0;
}
static int axon_msi_probe(struct platform_device *device,
const struct of_device_id *device_id)
static int axon_msi_probe(struct platform_device *device)
{
struct device_node *dn = device->dev.of_node;
struct axon_msic *msic;
@ -446,7 +443,7 @@ static const struct of_device_id axon_msi_device_id[] = {
{}
};
static struct of_platform_driver axon_msi_driver = {
static struct platform_driver axon_msi_driver = {
.probe = axon_msi_probe,
.shutdown = axon_msi_shutdown,
.driver = {
@ -458,7 +455,7 @@ static struct of_platform_driver axon_msi_driver = {
static int __init axon_msi_init(void)
{
return of_register_platform_driver(&axon_msi_driver);
return platform_driver_register(&axon_msi_driver);
}
subsys_initcall(axon_msi_init);

View File

@ -216,8 +216,7 @@ static int gpio_mdio_reset(struct mii_bus *bus)
}
static int __devinit gpio_mdio_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit gpio_mdio_probe(struct platform_device *ofdev)
{
struct device *dev = &ofdev->dev;
struct device_node *np = ofdev->dev.of_node;
@ -299,7 +298,7 @@ static struct of_device_id gpio_mdio_match[] =
};
MODULE_DEVICE_TABLE(of, gpio_mdio_match);
static struct of_platform_driver gpio_mdio_driver =
static struct platform_driver gpio_mdio_driver =
{
.probe = gpio_mdio_probe,
.remove = gpio_mdio_remove,
@ -326,13 +325,13 @@ int gpio_mdio_init(void)
if (!gpio_regs)
return -ENODEV;
return of_register_platform_driver(&gpio_mdio_driver);
return platform_driver_register(&gpio_mdio_driver);
}
module_init(gpio_mdio_init);
void gpio_mdio_exit(void)
{
of_unregister_platform_driver(&gpio_mdio_driver);
platform_driver_unregister(&gpio_mdio_driver);
if (gpio_regs)
iounmap(gpio_regs);
}

View File

@ -149,7 +149,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
if (dn->child)
eeh_add_device_tree_early(dn);
pcibios_scan_phb(phb, dn);
pcibios_scan_phb(phb);
pcibios_finish_adding_to_bus(phb->bus);
return phb;

View File

@ -172,10 +172,9 @@ static const struct block_device_operations axon_ram_devops = {
/**
* axon_ram_probe - probe() method for platform driver
* @device, @device_id: see of_platform_driver method
* @device: see platform_driver method
*/
static int axon_ram_probe(struct platform_device *device,
const struct of_device_id *device_id)
static int axon_ram_probe(struct platform_device *device)
{
static int axon_ram_bank_id = -1;
struct axon_ram_bank *bank;
@ -326,7 +325,7 @@ static struct of_device_id axon_ram_device_id[] = {
{}
};
static struct of_platform_driver axon_ram_driver = {
static struct platform_driver axon_ram_driver = {
.probe = axon_ram_probe,
.remove = axon_ram_remove,
.driver = {
@ -350,7 +349,7 @@ axon_ram_init(void)
}
azfs_minor = 0;
return of_register_platform_driver(&axon_ram_driver);
return platform_driver_register(&axon_ram_driver);
}
/**
@ -359,7 +358,7 @@ axon_ram_init(void)
static void __exit
axon_ram_exit(void)
{
of_unregister_platform_driver(&axon_ram_driver);
platform_driver_unregister(&axon_ram_driver);
unregister_blkdev(azfs_major, AXON_RAM_DEVICE_NAME);
}

View File

@ -365,8 +365,7 @@ bcom_engine_cleanup(void)
/* OF platform driver */
/* ======================================================================== */
static int __devinit mpc52xx_bcom_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit mpc52xx_bcom_probe(struct platform_device *op)
{
struct device_node *ofn_sram;
struct resource res_bcom;
@ -492,7 +491,7 @@ static struct of_device_id mpc52xx_bcom_of_match[] = {
MODULE_DEVICE_TABLE(of, mpc52xx_bcom_of_match);
static struct of_platform_driver mpc52xx_bcom_of_platform_driver = {
static struct platform_driver mpc52xx_bcom_of_platform_driver = {
.probe = mpc52xx_bcom_probe,
.remove = mpc52xx_bcom_remove,
.driver = {
@ -510,13 +509,13 @@ static struct of_platform_driver mpc52xx_bcom_of_platform_driver = {
static int __init
mpc52xx_bcom_init(void)
{
return of_register_platform_driver(&mpc52xx_bcom_of_platform_driver);
return platform_driver_register(&mpc52xx_bcom_of_platform_driver);
}
static void __exit
mpc52xx_bcom_exit(void)
{
of_unregister_platform_driver(&mpc52xx_bcom_of_platform_driver);
platform_driver_unregister(&mpc52xx_bcom_of_platform_driver);
}
/* If we're not a module, we must make sure everything is setup before */

View File

@ -71,8 +71,7 @@ static int __init get_offset_from_cmdline(char *str)
__setup("cache-sram-size=", get_size_from_cmdline);
__setup("cache-sram-offset=", get_offset_from_cmdline);
static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev,
const struct of_device_id *match)
static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev)
{
long rval;
unsigned int rem;
@ -204,7 +203,7 @@ static struct of_device_id mpc85xx_l2ctlr_of_match[] = {
{},
};
static struct of_platform_driver mpc85xx_l2ctlr_of_platform_driver = {
static struct platform_driver mpc85xx_l2ctlr_of_platform_driver = {
.driver = {
.name = "fsl-l2ctlr",
.owner = THIS_MODULE,
@ -216,12 +215,12 @@ static struct of_platform_driver mpc85xx_l2ctlr_of_platform_driver = {
static __init int mpc85xx_l2ctlr_of_init(void)
{
return of_register_platform_driver(&mpc85xx_l2ctlr_of_platform_driver);
return platform_driver_register(&mpc85xx_l2ctlr_of_platform_driver);
}
static void __exit mpc85xx_l2ctlr_of_exit(void)
{
of_unregister_platform_driver(&mpc85xx_l2ctlr_of_platform_driver);
platform_driver_unregister(&mpc85xx_l2ctlr_of_platform_driver);
}
subsys_initcall(mpc85xx_l2ctlr_of_init);

View File

@ -273,8 +273,7 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)
return 0;
}
static int __devinit fsl_of_msi_probe(struct platform_device *dev,
const struct of_device_id *match)
static int __devinit fsl_of_msi_probe(struct platform_device *dev)
{
struct fsl_msi *msi;
struct resource res;
@ -282,11 +281,15 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev,
int rc;
int virt_msir;
const u32 *p;
struct fsl_msi_feature *features = match->data;
struct fsl_msi_feature *features;
struct fsl_msi_cascade_data *cascade_data = NULL;
int len;
u32 offset;
if (!dev->dev.of_match)
return -EINVAL;
features = dev->dev.of_match->data;
printk(KERN_DEBUG "Setting up Freescale MSI support\n");
msi = kzalloc(sizeof(struct fsl_msi), GFP_KERNEL);
@ -411,7 +414,7 @@ static const struct of_device_id fsl_of_msi_ids[] = {
{}
};
static struct of_platform_driver fsl_of_msi_driver = {
static struct platform_driver fsl_of_msi_driver = {
.driver = {
.name = "fsl-msi",
.owner = THIS_MODULE,
@ -423,7 +426,7 @@ static struct of_platform_driver fsl_of_msi_driver = {
static __init int fsl_of_msi_init(void)
{
return of_register_platform_driver(&fsl_of_msi_driver);
return platform_driver_register(&fsl_of_msi_driver);
}
subsys_initcall(fsl_of_msi_init);

View File

@ -58,8 +58,7 @@ static const struct platform_suspend_ops pmc_suspend_ops = {
.enter = pmc_suspend_enter,
};
static int pmc_probe(struct platform_device *ofdev,
const struct of_device_id *id)
static int pmc_probe(struct platform_device *ofdev)
{
pmc_regs = of_iomap(ofdev->dev.of_node, 0);
if (!pmc_regs)
@ -76,7 +75,7 @@ static const struct of_device_id pmc_ids[] = {
{ },
};
static struct of_platform_driver pmc_driver = {
static struct platform_driver pmc_driver = {
.driver = {
.name = "fsl-pmc",
.owner = THIS_MODULE,
@ -87,6 +86,6 @@ static struct of_platform_driver pmc_driver = {
static int __init pmc_init(void)
{
return of_register_platform_driver(&pmc_driver);
return platform_driver_register(&pmc_driver);
}
device_initcall(pmc_init);

View File

@ -1570,8 +1570,7 @@ err_ops:
/* The probe function for RapidIO peer-to-peer network.
*/
static int __devinit fsl_of_rio_rpn_probe(struct platform_device *dev,
const struct of_device_id *match)
static int __devinit fsl_of_rio_rpn_probe(struct platform_device *dev)
{
int rc;
printk(KERN_INFO "Setting up RapidIO peer-to-peer network %s\n",
@ -1594,7 +1593,7 @@ static const struct of_device_id fsl_of_rio_rpn_ids[] = {
{},
};
static struct of_platform_driver fsl_of_rio_rpn_driver = {
static struct platform_driver fsl_of_rio_rpn_driver = {
.driver = {
.name = "fsl-of-rio",
.owner = THIS_MODULE,
@ -1605,7 +1604,7 @@ static struct of_platform_driver fsl_of_rio_rpn_driver = {
static __init int fsl_of_rio_rpn_init(void)
{
return of_register_platform_driver(&fsl_of_rio_rpn_driver);
return platform_driver_register(&fsl_of_rio_rpn_driver);
}
subsys_initcall(fsl_of_rio_rpn_init);

View File

@ -121,8 +121,7 @@ static void pmi_notify_handlers(struct work_struct *work)
spin_unlock(&data->handler_spinlock);
}
static int pmi_of_probe(struct platform_device *dev,
const struct of_device_id *match)
static int pmi_of_probe(struct platform_device *dev)
{
struct device_node *np = dev->dev.of_node;
int rc;
@ -205,7 +204,7 @@ static int pmi_of_remove(struct platform_device *dev)
return 0;
}
static struct of_platform_driver pmi_of_platform_driver = {
static struct platform_driver pmi_of_platform_driver = {
.probe = pmi_of_probe,
.remove = pmi_of_remove,
.driver = {
@ -217,13 +216,13 @@ static struct of_platform_driver pmi_of_platform_driver = {
static int __init pmi_module_init(void)
{
return of_register_platform_driver(&pmi_of_platform_driver);
return platform_driver_register(&pmi_of_platform_driver);
}
module_init(pmi_module_init);
static void __exit pmi_module_exit(void)
{
of_unregister_platform_driver(&pmi_of_platform_driver);
platform_driver_unregister(&pmi_of_platform_driver);
}
module_exit(pmi_module_exit);

View File

@ -659,8 +659,7 @@ static int qe_resume(struct platform_device *ofdev)
return 0;
}
static int qe_probe(struct platform_device *ofdev,
const struct of_device_id *id)
static int qe_probe(struct platform_device *ofdev)
{
return 0;
}
@ -670,7 +669,7 @@ static const struct of_device_id qe_ids[] = {
{ },
};
static struct of_platform_driver qe_driver = {
static struct platform_driver qe_driver = {
.driver = {
.name = "fsl-qe",
.owner = THIS_MODULE,
@ -682,7 +681,7 @@ static struct of_platform_driver qe_driver = {
static int __init qe_drv_init(void)
{
return of_register_platform_driver(&qe_driver);
return platform_driver_register(&qe_driver);
}
device_initcall(qe_drv_init);
#endif /* defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx) */

View File

@ -103,7 +103,7 @@ static inline unsigned int get_dma_residue(unsigned int dmanr)
return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);
}
static int __devinit ecpp_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit ecpp_probe(struct platform_device *op)
{
unsigned long base = op->resource[0].start;
unsigned long config = op->resource[1].start;
@ -235,7 +235,7 @@ static const struct of_device_id ecpp_match[] = {
{},
};
static struct of_platform_driver ecpp_driver = {
static struct platform_driver ecpp_driver = {
.driver = {
.name = "ecpp",
.owner = THIS_MODULE,
@ -247,7 +247,7 @@ static struct of_platform_driver ecpp_driver = {
static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
{
return of_register_platform_driver(&ecpp_driver);
return platform_driver_register(&ecpp_driver);
}
#endif /* !(_ASM_SPARC64_PARPORT_H */

View File

@ -137,8 +137,7 @@ static const struct file_operations apc_fops = {
static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops };
static int __devinit apc_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit apc_probe(struct platform_device *op)
{
int err;
@ -174,7 +173,7 @@ static struct of_device_id __initdata apc_match[] = {
};
MODULE_DEVICE_TABLE(of, apc_match);
static struct of_platform_driver apc_driver = {
static struct platform_driver apc_driver = {
.driver = {
.name = "apc",
.owner = THIS_MODULE,
@ -185,7 +184,7 @@ static struct of_platform_driver apc_driver = {
static int __init apc_init(void)
{
return of_register_platform_driver(&apc_driver);
return platform_driver_register(&apc_driver);
}
/* This driver is not critical to the boot process

View File

@ -102,8 +102,7 @@ static struct of_device_id __initdata auxio_match[] = {
MODULE_DEVICE_TABLE(of, auxio_match);
static int __devinit auxio_probe(struct platform_device *dev,
const struct of_device_id *match)
static int __devinit auxio_probe(struct platform_device *dev)
{
struct device_node *dp = dev->dev.of_node;
unsigned long size;
@ -132,7 +131,7 @@ static int __devinit auxio_probe(struct platform_device *dev,
return 0;
}
static struct of_platform_driver auxio_driver = {
static struct platform_driver auxio_driver = {
.probe = auxio_probe,
.driver = {
.name = "auxio",
@ -143,7 +142,7 @@ static struct of_platform_driver auxio_driver = {
static int __init auxio_init(void)
{
return of_register_platform_driver(&auxio_driver);
return platform_driver_register(&auxio_driver);
}
/* Must be after subsys_initcall() so that busses are probed. Must

View File

@ -59,8 +59,7 @@ static int __devinit clock_board_calc_nslots(struct clock_board *p)
}
}
static int __devinit clock_board_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit clock_board_probe(struct platform_device *op)
{
struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL);
int err = -ENOMEM;
@ -148,7 +147,7 @@ static struct of_device_id __initdata clock_board_match[] = {
{},
};
static struct of_platform_driver clock_board_driver = {
static struct platform_driver clock_board_driver = {
.probe = clock_board_probe,
.driver = {
.name = "clock_board",
@ -157,8 +156,7 @@ static struct of_platform_driver clock_board_driver = {
},
};
static int __devinit fhc_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit fhc_probe(struct platform_device *op)
{
struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL);
int err = -ENOMEM;
@ -254,7 +252,7 @@ static struct of_device_id __initdata fhc_match[] = {
{},
};
static struct of_platform_driver fhc_driver = {
static struct platform_driver fhc_driver = {
.probe = fhc_probe,
.driver = {
.name = "fhc",
@ -265,8 +263,8 @@ static struct of_platform_driver fhc_driver = {
static int __init sunfire_init(void)
{
(void) of_register_platform_driver(&fhc_driver);
(void) of_register_platform_driver(&clock_board_driver);
(void) platform_driver_register(&fhc_driver);
(void) platform_driver_register(&clock_board_driver);
return 0;
}

View File

@ -392,8 +392,7 @@ static void __devinit jbusmc_construct_dimm_groups(struct jbusmc *p,
}
}
static int __devinit jbusmc_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit jbusmc_probe(struct platform_device *op)
{
const struct linux_prom64_registers *mem_regs;
struct device_node *mem_node;
@ -690,8 +689,7 @@ static void chmc_fetch_decode_regs(struct chmc *p)
chmc_read_mcreg(p, CHMCTRL_DECODE4));
}
static int __devinit chmc_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit chmc_probe(struct platform_device *op)
{
struct device_node *dp = op->dev.of_node;
unsigned long ver;
@ -765,13 +763,12 @@ out_free:
goto out;
}
static int __devinit us3mc_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit us3mc_probe(struct platform_device *op)
{
if (mc_type == MC_TYPE_SAFARI)
return chmc_probe(op, match);
return chmc_probe(op);
else if (mc_type == MC_TYPE_JBUS)
return jbusmc_probe(op, match);
return jbusmc_probe(op);
return -ENODEV;
}
@ -810,7 +807,7 @@ static const struct of_device_id us3mc_match[] = {
};
MODULE_DEVICE_TABLE(of, us3mc_match);
static struct of_platform_driver us3mc_driver = {
static struct platform_driver us3mc_driver = {
.driver = {
.name = "us3mc",
.owner = THIS_MODULE,
@ -848,7 +845,7 @@ static int __init us3mc_init(void)
ret = register_dimm_printer(us3mc_dimm_printer);
if (!ret) {
ret = of_register_platform_driver(&us3mc_driver);
ret = platform_driver_register(&us3mc_driver);
if (ret)
unregister_dimm_printer(us3mc_dimm_printer);
}
@ -859,7 +856,7 @@ static void __exit us3mc_cleanup(void)
{
if (us3mc_platform()) {
unregister_dimm_printer(us3mc_dimm_printer);
of_unregister_platform_driver(&us3mc_driver);
platform_driver_unregister(&us3mc_driver);
}
}

View File

@ -455,8 +455,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
return 0;
}
static int __devinit fire_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit fire_probe(struct platform_device *op)
{
struct device_node *dp = op->dev.of_node;
struct pci_pbm_info *pbm;
@ -507,7 +506,7 @@ static struct of_device_id __initdata fire_match[] = {
{},
};
static struct of_platform_driver fire_driver = {
static struct platform_driver fire_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
@ -518,7 +517,7 @@ static struct of_platform_driver fire_driver = {
static int __init fire_init(void)
{
return of_register_platform_driver(&fire_driver);
return platform_driver_register(&fire_driver);
}
subsys_initcall(fire_init);

View File

@ -503,8 +503,7 @@ static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid)
#define PSYCHO_CONFIGSPACE 0x001000000UL
static int __devinit psycho_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit psycho_probe(struct platform_device *op)
{
const struct linux_prom64_registers *pr_regs;
struct device_node *dp = op->dev.of_node;
@ -601,7 +600,7 @@ static struct of_device_id __initdata psycho_match[] = {
{},
};
static struct of_platform_driver psycho_driver = {
static struct platform_driver psycho_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
@ -612,7 +611,7 @@ static struct of_platform_driver psycho_driver = {
static int __init psycho_init(void)
{
return of_register_platform_driver(&psycho_driver);
return platform_driver_register(&psycho_driver);
}
subsys_initcall(psycho_init);

View File

@ -452,8 +452,7 @@ static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,
sabre_scan_bus(pbm, &op->dev);
}
static int __devinit sabre_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit sabre_probe(struct platform_device *op)
{
const struct linux_prom64_registers *pr_regs;
struct device_node *dp = op->dev.of_node;
@ -464,7 +463,7 @@ static int __devinit sabre_probe(struct platform_device *op,
const u32 *vdma;
u64 clear_irq;
hummingbird_p = (match->data != NULL);
hummingbird_p = op->dev.of_match && (op->dev.of_match->data != NULL);
if (!hummingbird_p) {
struct device_node *cpu_dp;
@ -595,7 +594,7 @@ static struct of_device_id __initdata sabre_match[] = {
{},
};
static struct of_platform_driver sabre_driver = {
static struct platform_driver sabre_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
@ -606,7 +605,7 @@ static struct of_platform_driver sabre_driver = {
static int __init sabre_init(void)
{
return of_register_platform_driver(&sabre_driver);
return platform_driver_register(&sabre_driver);
}
subsys_initcall(sabre_init);

View File

@ -1460,10 +1460,11 @@ out_err:
return err;
}
static int __devinit schizo_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit schizo_probe(struct platform_device *op)
{
return __schizo_init(op, (unsigned long) match->data);
if (!op->dev.of_match)
return -EINVAL;
return __schizo_init(op, (unsigned long) op->dev.of_match->data);
}
/* The ordering of this table is very important. Some Tomatillo
@ -1490,7 +1491,7 @@ static struct of_device_id __initdata schizo_match[] = {
{},
};
static struct of_platform_driver schizo_driver = {
static struct platform_driver schizo_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
@ -1501,7 +1502,7 @@ static struct of_platform_driver schizo_driver = {
static int __init schizo_init(void)
{
return of_register_platform_driver(&schizo_driver);
return platform_driver_register(&schizo_driver);
}
subsys_initcall(schizo_init);

View File

@ -918,8 +918,7 @@ static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
return 0;
}
static int __devinit pci_sun4v_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit pci_sun4v_probe(struct platform_device *op)
{
const struct linux_prom64_registers *regs;
static int hvapi_negotiated = 0;
@ -1008,7 +1007,7 @@ static struct of_device_id __initdata pci_sun4v_match[] = {
{},
};
static struct of_platform_driver pci_sun4v_driver = {
static struct platform_driver pci_sun4v_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
@ -1019,7 +1018,7 @@ static struct of_platform_driver pci_sun4v_driver = {
static int __init pci_sun4v_init(void)
{
return of_register_platform_driver(&pci_sun4v_driver);
return platform_driver_register(&pci_sun4v_driver);
}
subsys_initcall(pci_sun4v_init);

View File

@ -51,8 +51,7 @@ static void pmc_swift_idle(void)
#endif
}
static int __devinit pmc_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit pmc_probe(struct platform_device *op)
{
regs = of_ioremap(&op->resource[0], 0,
resource_size(&op->resource[0]), PMC_OBPNAME);
@ -78,7 +77,7 @@ static struct of_device_id __initdata pmc_match[] = {
};
MODULE_DEVICE_TABLE(of, pmc_match);
static struct of_platform_driver pmc_driver = {
static struct platform_driver pmc_driver = {
.driver = {
.name = "pmc",
.owner = THIS_MODULE,
@ -89,7 +88,7 @@ static struct of_platform_driver pmc_driver = {
static int __init pmc_init(void)
{
return of_register_platform_driver(&pmc_driver);
return platform_driver_register(&pmc_driver);
}
/* This driver is not critical to the boot process

View File

@ -33,7 +33,7 @@ static int __devinit has_button_interrupt(unsigned int irq, struct device_node *
return 1;
}
static int __devinit power_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit power_probe(struct platform_device *op)
{
struct resource *res = &op->resource[0];
unsigned int irq = op->archdata.irqs[0];
@ -59,7 +59,7 @@ static struct of_device_id __initdata power_match[] = {
{},
};
static struct of_platform_driver power_driver = {
static struct platform_driver power_driver = {
.probe = power_probe,
.driver = {
.name = "power",
@ -70,7 +70,7 @@ static struct of_platform_driver power_driver = {
static int __init power_init(void)
{
return of_register_platform_driver(&power_driver);
return platform_driver_register(&power_driver);
}
device_initcall(power_init);

View File

@ -137,7 +137,7 @@ static struct platform_device m48t59_rtc = {
},
};
static int __devinit clock_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit clock_probe(struct platform_device *op)
{
struct device_node *dp = op->dev.of_node;
const char *model = of_get_property(dp, "model", NULL);
@ -171,7 +171,7 @@ static struct of_device_id __initdata clock_match[] = {
{},
};
static struct of_platform_driver clock_driver = {
static struct platform_driver clock_driver = {
.probe = clock_probe,
.driver = {
.name = "rtc",
@ -184,7 +184,7 @@ static struct of_platform_driver clock_driver = {
/* Probe for the mostek real time clock chip. */
static int __init clock_init(void)
{
return of_register_platform_driver(&clock_driver);
return platform_driver_register(&clock_driver);
}
/* Must be after subsys_initcall() so that busses are probed. Must
* be before device_initcall() because things like the RTC driver

View File

@ -419,7 +419,7 @@ static struct platform_device rtc_cmos_device = {
.num_resources = 1,
};
static int __devinit rtc_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit rtc_probe(struct platform_device *op)
{
struct resource *r;
@ -462,7 +462,7 @@ static struct of_device_id __initdata rtc_match[] = {
{},
};
static struct of_platform_driver rtc_driver = {
static struct platform_driver rtc_driver = {
.probe = rtc_probe,
.driver = {
.name = "rtc",
@ -477,7 +477,7 @@ static struct platform_device rtc_bq4802_device = {
.num_resources = 1,
};
static int __devinit bq4802_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit bq4802_probe(struct platform_device *op)
{
printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
@ -495,7 +495,7 @@ static struct of_device_id __initdata bq4802_match[] = {
{},
};
static struct of_platform_driver bq4802_driver = {
static struct platform_driver bq4802_driver = {
.probe = bq4802_probe,
.driver = {
.name = "bq4802",
@ -534,7 +534,7 @@ static struct platform_device m48t59_rtc = {
},
};
static int __devinit mostek_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit mostek_probe(struct platform_device *op)
{
struct device_node *dp = op->dev.of_node;
@ -559,7 +559,7 @@ static struct of_device_id __initdata mostek_match[] = {
{},
};
static struct of_platform_driver mostek_driver = {
static struct platform_driver mostek_driver = {
.probe = mostek_probe,
.driver = {
.name = "mostek",
@ -586,9 +586,9 @@ static int __init clock_init(void)
if (tlb_type == hypervisor)
return platform_device_register(&rtc_sun4v_device);
(void) of_register_platform_driver(&rtc_driver);
(void) of_register_platform_driver(&mostek_driver);
(void) of_register_platform_driver(&bq4802_driver);
(void) platform_driver_register(&rtc_driver);
(void) platform_driver_register(&mostek_driver);
(void) platform_driver_register(&bq4802_driver);
return 0;
}

View File

@ -680,7 +680,7 @@ mpc52xx_ata_remove_one(struct device *dev)
/* ======================================================================== */
static int __devinit
mpc52xx_ata_probe(struct platform_device *op, const struct of_device_id *match)
mpc52xx_ata_probe(struct platform_device *op)
{
unsigned int ipb_freq;
struct resource res_mem;
@ -883,7 +883,7 @@ static struct of_device_id mpc52xx_ata_of_match[] = {
};
static struct of_platform_driver mpc52xx_ata_of_platform_driver = {
static struct platform_driver mpc52xx_ata_of_platform_driver = {
.probe = mpc52xx_ata_probe,
.remove = mpc52xx_ata_remove,
#ifdef CONFIG_PM
@ -906,13 +906,13 @@ static int __init
mpc52xx_ata_init(void)
{
printk(KERN_INFO "ata: MPC52xx IDE/ATA libata driver\n");
return of_register_platform_driver(&mpc52xx_ata_of_platform_driver);
return platform_driver_register(&mpc52xx_ata_of_platform_driver);
}
static void __exit
mpc52xx_ata_exit(void)
{
of_unregister_platform_driver(&mpc52xx_ata_of_platform_driver);
platform_driver_unregister(&mpc52xx_ata_of_platform_driver);
}
module_init(mpc52xx_ata_init);

View File

@ -14,8 +14,7 @@
#include <linux/of_platform.h>
#include <linux/ata_platform.h>
static int __devinit pata_of_platform_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit pata_of_platform_probe(struct platform_device *ofdev)
{
int ret;
struct device_node *dn = ofdev->dev.of_node;
@ -90,7 +89,7 @@ static struct of_device_id pata_of_platform_match[] = {
};
MODULE_DEVICE_TABLE(of, pata_of_platform_match);
static struct of_platform_driver pata_of_platform_driver = {
static struct platform_driver pata_of_platform_driver = {
.driver = {
.name = "pata_of_platform",
.owner = THIS_MODULE,
@ -102,13 +101,13 @@ static struct of_platform_driver pata_of_platform_driver = {
static int __init pata_of_platform_init(void)
{
return of_register_platform_driver(&pata_of_platform_driver);
return platform_driver_register(&pata_of_platform_driver);
}
module_init(pata_of_platform_init);
static void __exit pata_of_platform_exit(void)
{
of_unregister_platform_driver(&pata_of_platform_driver);
platform_driver_unregister(&pata_of_platform_driver);
}
module_exit(pata_of_platform_exit);

View File

@ -1625,8 +1625,7 @@ static const struct ata_port_info sata_dwc_port_info[] = {
},
};
static int sata_dwc_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int sata_dwc_probe(struct platform_device *ofdev)
{
struct sata_dwc_device *hsdev;
u32 idr, versionr;
@ -1764,7 +1763,7 @@ static const struct of_device_id sata_dwc_match[] = {
};
MODULE_DEVICE_TABLE(of, sata_dwc_match);
static struct of_platform_driver sata_dwc_driver = {
static struct platform_driver sata_dwc_driver = {
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
@ -1776,12 +1775,12 @@ static struct of_platform_driver sata_dwc_driver = {
static int __init sata_dwc_init(void)
{
return of_register_platform_driver(&sata_dwc_driver);
return platform_driver_register(&sata_dwc_driver);
}
static void __exit sata_dwc_exit(void)
{
of_unregister_platform_driver(&sata_dwc_driver);
platform_driver_unregister(&sata_dwc_driver);
}
module_init(sata_dwc_init);

View File

@ -1300,8 +1300,7 @@ static const struct ata_port_info sata_fsl_port_info[] = {
},
};
static int sata_fsl_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int sata_fsl_probe(struct platform_device *ofdev)
{
int retval = -ENXIO;
void __iomem *hcr_base = NULL;
@ -1437,7 +1436,7 @@ static struct of_device_id fsl_sata_match[] = {
MODULE_DEVICE_TABLE(of, fsl_sata_match);
static struct of_platform_driver fsl_sata_driver = {
static struct platform_driver fsl_sata_driver = {
.driver = {
.name = "fsl-sata",
.owner = THIS_MODULE,
@ -1453,13 +1452,13 @@ static struct of_platform_driver fsl_sata_driver = {
static int __init sata_fsl_init(void)
{
of_register_platform_driver(&fsl_sata_driver);
platform_driver_register(&fsl_sata_driver);
return 0;
}
static void __exit sata_fsl_exit(void)
{
of_unregister_platform_driver(&fsl_sata_driver);
platform_driver_unregister(&fsl_sata_driver);
}
MODULE_LICENSE("GPL");

View File

@ -2643,14 +2643,17 @@ fore200e_init(struct fore200e* fore200e, struct device *parent)
}
#ifdef CONFIG_SBUS
static int __devinit fore200e_sba_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit fore200e_sba_probe(struct platform_device *op)
{
const struct fore200e_bus *bus = match->data;
const struct fore200e_bus *bus;
struct fore200e *fore200e;
static int index = 0;
int err;
if (!op->dev.of_match)
return -EINVAL;
bus = op->dev.of_match->data;
fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL);
if (!fore200e)
return -ENOMEM;
@ -2694,7 +2697,7 @@ static const struct of_device_id fore200e_sba_match[] = {
};
MODULE_DEVICE_TABLE(of, fore200e_sba_match);
static struct of_platform_driver fore200e_sba_driver = {
static struct platform_driver fore200e_sba_driver = {
.driver = {
.name = "fore_200e",
.owner = THIS_MODULE,
@ -2795,7 +2798,7 @@ static int __init fore200e_module_init(void)
printk(FORE200E "FORE Systems 200E-series ATM driver - version " FORE200E_VERSION "\n");
#ifdef CONFIG_SBUS
err = of_register_platform_driver(&fore200e_sba_driver);
err = platform_driver_register(&fore200e_sba_driver);
if (err)
return err;
#endif
@ -2806,7 +2809,7 @@ static int __init fore200e_module_init(void)
#ifdef CONFIG_SBUS
if (err)
of_unregister_platform_driver(&fore200e_sba_driver);
platform_driver_unregister(&fore200e_sba_driver);
#endif
return err;
@ -2818,7 +2821,7 @@ static void __exit fore200e_module_cleanup(void)
pci_unregister_driver(&fore200e_pca_driver);
#endif
#ifdef CONFIG_SBUS
of_unregister_platform_driver(&fore200e_sba_driver);
platform_driver_unregister(&fore200e_sba_driver);
#endif
}

View File

@ -1195,16 +1195,13 @@ static struct platform_driver ace_platform_driver = {
*/
#if defined(CONFIG_OF)
static int __devinit
ace_of_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit ace_of_probe(struct platform_device *op)
{
struct resource res;
resource_size_t physaddr;
const u32 *id;
int irq, bus_width, rc;
dev_dbg(&op->dev, "ace_of_probe(%p, %p)\n", op, match);
/* device id */
id = of_get_property(op->dev.of_node, "port-number", NULL);
@ -1245,7 +1242,7 @@ static const struct of_device_id ace_of_match[] __devinitconst = {
};
MODULE_DEVICE_TABLE(of, ace_of_match);
static struct of_platform_driver ace_of_driver = {
static struct platform_driver ace_of_driver = {
.probe = ace_of_probe,
.remove = __devexit_p(ace_of_remove),
.driver = {
@ -1259,12 +1256,12 @@ static struct of_platform_driver ace_of_driver = {
static inline int __init ace_of_register(void)
{
pr_debug("xsysace: registering OF binding\n");
return of_register_platform_driver(&ace_of_driver);
return platform_driver_register(&ace_of_driver);
}
static inline void __exit ace_of_unregister(void)
{
of_unregister_platform_driver(&ace_of_driver);
platform_driver_unregister(&ace_of_driver);
}
#else /* CONFIG_OF */
/* CONFIG_OF not enabled; do nothing helpers */

View File

@ -619,15 +619,17 @@ static void __devinit n2rng_driver_version(void)
pr_info("%s", version);
}
static int __devinit n2rng_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit n2rng_probe(struct platform_device *op)
{
int victoria_falls = (match->data != NULL);
int victoria_falls;
int err = -ENOMEM;
struct n2rng *np;
n2rng_driver_version();
if (!op->dev.of_match)
return -EINVAL;
victoria_falls = (op->dev.of_match->data != NULL);
n2rng_driver_version();
np = kzalloc(sizeof(*np), GFP_KERNEL);
if (!np)
goto out;
@ -750,7 +752,7 @@ static const struct of_device_id n2rng_match[] = {
};
MODULE_DEVICE_TABLE(of, n2rng_match);
static struct of_platform_driver n2rng_driver = {
static struct platform_driver n2rng_driver = {
.driver = {
.name = "n2rng",
.owner = THIS_MODULE,
@ -762,12 +764,12 @@ static struct of_platform_driver n2rng_driver = {
static int __init n2rng_init(void)
{
return of_register_platform_driver(&n2rng_driver);
return platform_driver_register(&n2rng_driver);
}
static void __exit n2rng_exit(void)
{
of_unregister_platform_driver(&n2rng_driver);
platform_driver_unregister(&n2rng_driver);
}
module_init(n2rng_init);

View File

@ -94,8 +94,7 @@ static struct hwrng pasemi_rng = {
.data_read = pasemi_rng_data_read,
};
static int __devinit rng_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit rng_probe(struct platform_device *ofdev)
{
void __iomem *rng_regs;
struct device_node *rng_np = ofdev->dev.of_node;
@ -139,7 +138,7 @@ static struct of_device_id rng_match[] = {
{ },
};
static struct of_platform_driver rng_driver = {
static struct platform_driver rng_driver = {
.driver = {
.name = "pasemi-rng",
.owner = THIS_MODULE,
@ -151,13 +150,13 @@ static struct of_platform_driver rng_driver = {
static int __init rng_init(void)
{
return of_register_platform_driver(&rng_driver);
return platform_driver_register(&rng_driver);
}
module_init(rng_init);
static void __exit rng_exit(void)
{
of_unregister_platform_driver(&rng_driver);
platform_driver_unregister(&rng_driver);
}
module_exit(rng_exit);

View File

@ -66,13 +66,10 @@
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/pnp.h>
#ifdef CONFIG_PPC_OF
#include <linux/of_device.h>
#include <linux/of_platform.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#endif
#define PFX "ipmi_si: "
@ -116,13 +113,7 @@ static char *ipmi_addr_src_to_str[] = { NULL, "hotmod", "hardcoded", "SPMI",
#define DEVICE_NAME "ipmi_si"
static struct platform_driver ipmi_driver = {
.driver = {
.name = DEVICE_NAME,
.bus = &platform_bus_type
}
};
static struct platform_driver ipmi_driver;
/*
* Indexes into stats[] in smi_info below.
@ -308,9 +299,6 @@ static int pci_registered;
#ifdef CONFIG_ACPI
static int pnp_registered;
#endif
#ifdef CONFIG_PPC_OF
static int of_registered;
#endif
static unsigned int kipmid_max_busy_us[SI_MAX_PARMS];
static int num_max_busy_us;
@ -1868,8 +1856,9 @@ static int hotmod_handler(const char *val, struct kernel_param *kp)
return rv;
}
static void __devinit hardcode_find_bmc(void)
static int __devinit hardcode_find_bmc(void)
{
int ret = -ENODEV;
int i;
struct smi_info *info;
@ -1879,7 +1868,7 @@ static void __devinit hardcode_find_bmc(void)
info = smi_info_alloc();
if (!info)
return;
return -ENOMEM;
info->addr_source = SI_HARDCODED;
printk(KERN_INFO PFX "probing via hardcoded address\n");
@ -1932,10 +1921,12 @@ static void __devinit hardcode_find_bmc(void)
if (!add_smi(info)) {
if (try_smi_init(info))
cleanup_one_si(info);
ret = 0;
} else {
kfree(info);
}
}
return ret;
}
#ifdef CONFIG_ACPI
@ -2563,11 +2554,9 @@ static struct pci_driver ipmi_pci_driver = {
};
#endif /* CONFIG_PCI */
#ifdef CONFIG_PPC_OF
static int __devinit ipmi_of_probe(struct platform_device *dev,
const struct of_device_id *match)
static int __devinit ipmi_probe(struct platform_device *dev)
{
#ifdef CONFIG_OF
struct smi_info *info;
struct resource resource;
const __be32 *regsize, *regspacing, *regshift;
@ -2577,6 +2566,9 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
dev_info(&dev->dev, "probing via device tree\n");
if (!dev->dev.of_match)
return -EINVAL;
ret = of_address_to_resource(np, 0, &resource);
if (ret) {
dev_warn(&dev->dev, PFX "invalid address from OF\n");
@ -2609,7 +2601,7 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
return -ENOMEM;
}
info->si_type = (enum si_type) match->data;
info->si_type = (enum si_type) dev->dev.of_match->data;
info->addr_source = SI_DEVICETREE;
info->irq_setup = std_irq_setup;
@ -2640,13 +2632,15 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
kfree(info);
return -EBUSY;
}
#endif
return 0;
}
static int __devexit ipmi_of_remove(struct platform_device *dev)
static int __devexit ipmi_remove(struct platform_device *dev)
{
#ifdef CONFIG_OF
cleanup_one_si(dev_get_drvdata(&dev->dev));
#endif
return 0;
}
@ -2661,16 +2655,15 @@ static struct of_device_id ipmi_match[] =
{},
};
static struct of_platform_driver ipmi_of_platform_driver = {
static struct platform_driver ipmi_driver = {
.driver = {
.name = "ipmi",
.name = DEVICE_NAME,
.owner = THIS_MODULE,
.of_match_table = ipmi_match,
},
.probe = ipmi_of_probe,
.remove = __devexit_p(ipmi_of_remove),
.probe = ipmi_probe,
.remove = __devexit_p(ipmi_remove),
};
#endif /* CONFIG_PPC_OF */
static int wait_for_msg_done(struct smi_info *smi_info)
{
@ -3348,8 +3341,7 @@ static int __devinit init_ipmi_si(void)
return 0;
initialized = 1;
/* Register the device drivers. */
rv = driver_register(&ipmi_driver.driver);
rv = platform_driver_register(&ipmi_driver);
if (rv) {
printk(KERN_ERR PFX "Unable to register driver: %d\n", rv);
return rv;
@ -3373,15 +3365,9 @@ static int __devinit init_ipmi_si(void)
printk(KERN_INFO "IPMI System Interface driver.\n");
hardcode_find_bmc();
/* If the user gave us a device, they presumably want us to use it */
mutex_lock(&smi_infos_lock);
if (!list_empty(&smi_infos)) {
mutex_unlock(&smi_infos_lock);
if (!hardcode_find_bmc())
return 0;
}
mutex_unlock(&smi_infos_lock);
#ifdef CONFIG_PCI
rv = pci_register_driver(&ipmi_pci_driver);
@ -3404,11 +3390,6 @@ static int __devinit init_ipmi_si(void)
spmi_find_bmc();
#endif
#ifdef CONFIG_PPC_OF
of_register_platform_driver(&ipmi_of_platform_driver);
of_registered = 1;
#endif
/* We prefer devices with interrupts, but in the case of a machine
with multiple BMCs we assume that there will be several instances
of a given type so if we succeed in registering a type then also
@ -3556,17 +3537,12 @@ static void __exit cleanup_ipmi_si(void)
pnp_unregister_driver(&ipmi_pnp_driver);
#endif
#ifdef CONFIG_PPC_OF
if (of_registered)
of_unregister_platform_driver(&ipmi_of_platform_driver);
#endif
platform_driver_unregister(&ipmi_driver);
mutex_lock(&smi_infos_lock);
list_for_each_entry_safe(e, tmp_e, &smi_infos, link)
cleanup_one_si(e);
mutex_unlock(&smi_infos_lock);
driver_unregister(&ipmi_driver.driver);
}
module_exit(cleanup_ipmi_si);

View File

@ -714,12 +714,58 @@ static int __devexit hwicap_remove(struct device *dev)
return 0; /* success */
}
#ifdef CONFIG_OF
static int __devinit hwicap_of_probe(struct platform_device *op)
{
struct resource res;
const unsigned int *id;
const char *family;
int rc;
const struct hwicap_driver_config *config = op->dev.of_match->data;
const struct config_registers *regs;
rc = of_address_to_resource(op->dev.of_node, 0, &res);
if (rc) {
dev_err(&op->dev, "invalid address\n");
return rc;
}
id = of_get_property(op->dev.of_node, "port-number", NULL);
/* It's most likely that we're using V4, if the family is not
specified */
regs = &v4_config_registers;
family = of_get_property(op->dev.of_node, "xlnx,family", NULL);
if (family) {
if (!strcmp(family, "virtex2p")) {
regs = &v2_config_registers;
} else if (!strcmp(family, "virtex4")) {
regs = &v4_config_registers;
} else if (!strcmp(family, "virtex5")) {
regs = &v5_config_registers;
}
}
return hwicap_setup(&op->dev, id ? *id : -1, &res, config,
regs);
}
#else
static inline int hwicap_of_probe(struct platform_device *op)
{
return -EINVAL;
}
#endif /* CONFIG_OF */
static int __devinit hwicap_drv_probe(struct platform_device *pdev)
{
struct resource *res;
const struct config_registers *regs;
const char *family;
if (pdev->dev.of_match)
return hwicap_of_probe(pdev);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
@ -748,98 +794,28 @@ static int __devexit hwicap_drv_remove(struct platform_device *pdev)
return hwicap_remove(&pdev->dev);
}
static struct platform_driver hwicap_platform_driver = {
.probe = hwicap_drv_probe,
.remove = hwicap_drv_remove,
.driver = {
.owner = THIS_MODULE,
.name = DRIVER_NAME,
},
};
/* ---------------------------------------------------------------------
* OF bus binding
*/
#if defined(CONFIG_OF)
static int __devinit
hwicap_of_probe(struct platform_device *op, const struct of_device_id *match)
{
struct resource res;
const unsigned int *id;
const char *family;
int rc;
const struct hwicap_driver_config *config = match->data;
const struct config_registers *regs;
dev_dbg(&op->dev, "hwicap_of_probe(%p, %p)\n", op, match);
rc = of_address_to_resource(op->dev.of_node, 0, &res);
if (rc) {
dev_err(&op->dev, "invalid address\n");
return rc;
}
id = of_get_property(op->dev.of_node, "port-number", NULL);
/* It's most likely that we're using V4, if the family is not
specified */
regs = &v4_config_registers;
family = of_get_property(op->dev.of_node, "xlnx,family", NULL);
if (family) {
if (!strcmp(family, "virtex2p")) {
regs = &v2_config_registers;
} else if (!strcmp(family, "virtex4")) {
regs = &v4_config_registers;
} else if (!strcmp(family, "virtex5")) {
regs = &v5_config_registers;
}
}
return hwicap_setup(&op->dev, id ? *id : -1, &res, config,
regs);
}
static int __devexit hwicap_of_remove(struct platform_device *op)
{
return hwicap_remove(&op->dev);
}
/* Match table for of_platform binding */
#ifdef CONFIG_OF
/* Match table for device tree binding */
static const struct of_device_id __devinitconst hwicap_of_match[] = {
{ .compatible = "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config},
{ .compatible = "xlnx,xps-hwicap-1.00.a", .data = &fifo_icap_config},
{},
};
MODULE_DEVICE_TABLE(of, hwicap_of_match);
#else
#define hwicap_of_match NULL
#endif
static struct of_platform_driver hwicap_of_driver = {
.probe = hwicap_of_probe,
.remove = __devexit_p(hwicap_of_remove),
static struct platform_driver hwicap_platform_driver = {
.probe = hwicap_drv_probe,
.remove = hwicap_drv_remove,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.name = DRIVER_NAME,
.of_match_table = hwicap_of_match,
},
};
/* Registration helpers to keep the number of #ifdefs to a minimum */
static inline int __init hwicap_of_register(void)
{
pr_debug("hwicap: calling of_register_platform_driver()\n");
return of_register_platform_driver(&hwicap_of_driver);
}
static inline void __exit hwicap_of_unregister(void)
{
of_unregister_platform_driver(&hwicap_of_driver);
}
#else /* CONFIG_OF */
/* CONFIG_OF not enabled; do nothing helpers */
static inline int __init hwicap_of_register(void) { return 0; }
static inline void __exit hwicap_of_unregister(void) { }
#endif /* CONFIG_OF */
static int __init hwicap_module_init(void)
{
dev_t devt;
@ -856,21 +832,12 @@ static int __init hwicap_module_init(void)
return retval;
retval = platform_driver_register(&hwicap_platform_driver);
if (retval)
goto failed1;
retval = hwicap_of_register();
if (retval)
goto failed2;
goto failed;
return retval;
failed2:
platform_driver_unregister(&hwicap_platform_driver);
failed1:
failed:
unregister_chrdev_region(devt, HWICAP_DEVICES);
return retval;
@ -884,8 +851,6 @@ static void __exit hwicap_module_cleanup(void)
platform_driver_unregister(&hwicap_platform_driver);
hwicap_of_unregister();
unregister_chrdev_region(devt, HWICAP_DEVICES);
}

View File

@ -1150,8 +1150,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {
/**
* Module Initialization Routine
*/
static int __init crypto4xx_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __init crypto4xx_probe(struct platform_device *ofdev)
{
int rc;
struct resource res;
@ -1280,7 +1279,7 @@ static const struct of_device_id crypto4xx_match[] = {
{ },
};
static struct of_platform_driver crypto4xx_driver = {
static struct platform_driver crypto4xx_driver = {
.driver = {
.name = "crypto4xx",
.owner = THIS_MODULE,
@ -1292,12 +1291,12 @@ static struct of_platform_driver crypto4xx_driver = {
static int __init crypto4xx_init(void)
{
return of_register_platform_driver(&crypto4xx_driver);
return platform_driver_register(&crypto4xx_driver);
}
static void __exit crypto4xx_exit(void)
{
of_unregister_platform_driver(&crypto4xx_driver);
platform_driver_unregister(&crypto4xx_driver);
}
module_init(crypto4xx_init);

View File

@ -2004,8 +2004,7 @@ static void __devinit n2_spu_driver_version(void)
pr_info("%s", version);
}
static int __devinit n2_crypto_probe(struct platform_device *dev,
const struct of_device_id *match)
static int __devinit n2_crypto_probe(struct platform_device *dev)
{
struct mdesc_handle *mdesc;
const char *full_name;
@ -2116,8 +2115,7 @@ static void free_ncp(struct n2_mau *mp)
kfree(mp);
}
static int __devinit n2_mau_probe(struct platform_device *dev,
const struct of_device_id *match)
static int __devinit n2_mau_probe(struct platform_device *dev)
{
struct mdesc_handle *mdesc;
const char *full_name;
@ -2211,7 +2209,7 @@ static struct of_device_id n2_crypto_match[] = {
MODULE_DEVICE_TABLE(of, n2_crypto_match);
static struct of_platform_driver n2_crypto_driver = {
static struct platform_driver n2_crypto_driver = {
.driver = {
.name = "n2cp",
.owner = THIS_MODULE,
@ -2235,7 +2233,7 @@ static struct of_device_id n2_mau_match[] = {
MODULE_DEVICE_TABLE(of, n2_mau_match);
static struct of_platform_driver n2_mau_driver = {
static struct platform_driver n2_mau_driver = {
.driver = {
.name = "ncp",
.owner = THIS_MODULE,
@ -2247,20 +2245,20 @@ static struct of_platform_driver n2_mau_driver = {
static int __init n2_init(void)
{
int err = of_register_platform_driver(&n2_crypto_driver);
int err = platform_driver_register(&n2_crypto_driver);
if (!err) {
err = of_register_platform_driver(&n2_mau_driver);
err = platform_driver_register(&n2_mau_driver);
if (err)
of_unregister_platform_driver(&n2_crypto_driver);
platform_driver_unregister(&n2_crypto_driver);
}
return err;
}
static void __exit n2_exit(void)
{
of_unregister_platform_driver(&n2_mau_driver);
of_unregister_platform_driver(&n2_crypto_driver);
platform_driver_unregister(&n2_mau_driver);
platform_driver_unregister(&n2_crypto_driver);
}
module_init(n2_init);

View File

@ -2402,8 +2402,7 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
return t_alg;
}
static int talitos_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int talitos_probe(struct platform_device *ofdev)
{
struct device *dev = &ofdev->dev;
struct device_node *np = ofdev->dev.of_node;
@ -2580,7 +2579,7 @@ static const struct of_device_id talitos_match[] = {
};
MODULE_DEVICE_TABLE(of, talitos_match);
static struct of_platform_driver talitos_driver = {
static struct platform_driver talitos_driver = {
.driver = {
.name = "talitos",
.owner = THIS_MODULE,
@ -2592,13 +2591,13 @@ static struct of_platform_driver talitos_driver = {
static int __init talitos_init(void)
{
return of_register_platform_driver(&talitos_driver);
return platform_driver_register(&talitos_driver);
}
module_init(talitos_init);
static void __exit talitos_exit(void)
{
of_unregister_platform_driver(&talitos_driver);
platform_driver_unregister(&talitos_driver);
}
module_exit(talitos_exit);

View File

@ -1281,8 +1281,7 @@ static void fsl_dma_chan_remove(struct fsldma_chan *chan)
kfree(chan);
}
static int __devinit fsldma_of_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit fsldma_of_probe(struct platform_device *op)
{
struct fsldma_device *fdev;
struct device_node *child;
@ -1414,20 +1413,13 @@ static struct of_platform_driver fsldma_of_driver = {
static __init int fsldma_init(void)
{
int ret;
pr_info("Freescale Elo / Elo Plus DMA driver\n");
ret = of_register_platform_driver(&fsldma_of_driver);
if (ret)
pr_err("fsldma: failed to register platform driver\n");
return ret;
return platform_driver_register(&fsldma_of_driver);
}
static void __exit fsldma_exit(void)
{
of_unregister_platform_driver(&fsldma_of_driver);
platform_driver_unregister(&fsldma_of_driver);
}
subsys_initcall(fsldma_init);

View File

@ -649,8 +649,7 @@ mpc_dma_prep_memcpy(struct dma_chan *chan, dma_addr_t dst, dma_addr_t src,
return &mdesc->desc;
}
static int __devinit mpc_dma_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit mpc_dma_probe(struct platform_device *op)
{
struct device_node *dn = op->dev.of_node;
struct device *dev = &op->dev;
@ -827,7 +826,7 @@ static struct of_device_id mpc_dma_match[] = {
{},
};
static struct of_platform_driver mpc_dma_driver = {
static struct platform_driver mpc_dma_driver = {
.probe = mpc_dma_probe,
.remove = __devexit_p(mpc_dma_remove),
.driver = {
@ -839,13 +838,13 @@ static struct of_platform_driver mpc_dma_driver = {
static int __init mpc_dma_init(void)
{
return of_register_platform_driver(&mpc_dma_driver);
return platform_driver_register(&mpc_dma_driver);
}
module_init(mpc_dma_init);
static void __exit mpc_dma_exit(void)
{
of_unregister_platform_driver(&mpc_dma_driver);
platform_driver_unregister(&mpc_dma_driver);
}
module_exit(mpc_dma_exit);

View File

@ -4393,8 +4393,7 @@ static void ppc440spe_adma_release_irqs(struct ppc440spe_adma_device *adev,
/**
* ppc440spe_adma_probe - probe the asynch device
*/
static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct resource res;
@ -4944,7 +4943,7 @@ static const struct of_device_id ppc440spe_adma_of_match[] __devinitconst = {
};
MODULE_DEVICE_TABLE(of, ppc440spe_adma_of_match);
static struct of_platform_driver ppc440spe_adma_driver = {
static struct platform_driver ppc440spe_adma_driver = {
.probe = ppc440spe_adma_probe,
.remove = __devexit_p(ppc440spe_adma_remove),
.driver = {
@ -4962,7 +4961,7 @@ static __init int ppc440spe_adma_init(void)
if (ret)
return ret;
ret = of_register_platform_driver(&ppc440spe_adma_driver);
ret = platform_driver_register(&ppc440spe_adma_driver);
if (ret) {
pr_err("%s: failed to register platform driver\n",
__func__);
@ -4996,7 +4995,7 @@ out_dev:
/* User will not be able to enable h/w RAID-6 */
pr_err("%s: failed to create RAID-6 driver interface\n",
__func__);
of_unregister_platform_driver(&ppc440spe_adma_driver);
platform_driver_unregister(&ppc440spe_adma_driver);
out_reg:
dcr_unmap(ppc440spe_mq_dcr_host, ppc440spe_mq_dcr_len);
kfree(ppc440spe_dma_fifo_buf);
@ -5011,7 +5010,7 @@ static void __exit ppc440spe_adma_exit(void)
&driver_attr_enable);
driver_remove_file(&ppc440spe_adma_driver.driver,
&driver_attr_devices);
of_unregister_platform_driver(&ppc440spe_adma_driver);
platform_driver_unregister(&ppc440spe_adma_driver);
dcr_unmap(ppc440spe_mq_dcr_host, ppc440spe_mq_dcr_len);
kfree(ppc440spe_dma_fifo_buf);
}

View File

@ -200,8 +200,7 @@ static irqreturn_t mpc85xx_pci_isr(int irq, void *dev_id)
return IRQ_HANDLED;
}
static int __devinit mpc85xx_pci_err_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
{
struct edac_pci_ctl_info *pci;
struct mpc85xx_pci_pdata *pdata;
@ -338,7 +337,7 @@ static struct of_device_id mpc85xx_pci_err_of_match[] = {
};
MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match);
static struct of_platform_driver mpc85xx_pci_err_driver = {
static struct platform_driver mpc85xx_pci_err_driver = {
.probe = mpc85xx_pci_err_probe,
.remove = __devexit_p(mpc85xx_pci_err_remove),
.driver = {
@ -503,8 +502,7 @@ static irqreturn_t mpc85xx_l2_isr(int irq, void *dev_id)
return IRQ_HANDLED;
}
static int __devinit mpc85xx_l2_err_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit mpc85xx_l2_err_probe(struct platform_device *op)
{
struct edac_device_ctl_info *edac_dev;
struct mpc85xx_l2_pdata *pdata;
@ -656,7 +654,7 @@ static struct of_device_id mpc85xx_l2_err_of_match[] = {
};
MODULE_DEVICE_TABLE(of, mpc85xx_l2_err_of_match);
static struct of_platform_driver mpc85xx_l2_err_driver = {
static struct platform_driver mpc85xx_l2_err_driver = {
.probe = mpc85xx_l2_err_probe,
.remove = mpc85xx_l2_err_remove,
.driver = {
@ -956,8 +954,7 @@ static void __devinit mpc85xx_init_csrows(struct mem_ctl_info *mci)
}
}
static int __devinit mpc85xx_mc_err_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit mpc85xx_mc_err_probe(struct platform_device *op)
{
struct mem_ctl_info *mci;
struct mpc85xx_mc_pdata *pdata;
@ -1136,7 +1133,7 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = {
};
MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match);
static struct of_platform_driver mpc85xx_mc_err_driver = {
static struct platform_driver mpc85xx_mc_err_driver = {
.probe = mpc85xx_mc_err_probe,
.remove = mpc85xx_mc_err_remove,
.driver = {
@ -1171,16 +1168,16 @@ static int __init mpc85xx_mc_init(void)
break;
}
res = of_register_platform_driver(&mpc85xx_mc_err_driver);
res = platform_driver_register(&mpc85xx_mc_err_driver);
if (res)
printk(KERN_WARNING EDAC_MOD_STR "MC fails to register\n");
res = of_register_platform_driver(&mpc85xx_l2_err_driver);
res = platform_driver_register(&mpc85xx_l2_err_driver);
if (res)
printk(KERN_WARNING EDAC_MOD_STR "L2 fails to register\n");
#ifdef CONFIG_PCI
res = of_register_platform_driver(&mpc85xx_pci_err_driver);
res = platform_driver_register(&mpc85xx_pci_err_driver);
if (res)
printk(KERN_WARNING EDAC_MOD_STR "PCI fails to register\n");
#endif
@ -1212,10 +1209,10 @@ static void __exit mpc85xx_mc_exit(void)
on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0);
#endif
#ifdef CONFIG_PCI
of_unregister_platform_driver(&mpc85xx_pci_err_driver);
platform_driver_unregister(&mpc85xx_pci_err_driver);
#endif
of_unregister_platform_driver(&mpc85xx_l2_err_driver);
of_unregister_platform_driver(&mpc85xx_mc_err_driver);
platform_driver_unregister(&mpc85xx_l2_err_driver);
platform_driver_unregister(&mpc85xx_mc_err_driver);
}
module_exit(mpc85xx_mc_exit);

View File

@ -184,8 +184,7 @@ struct ppc4xx_ecc_status {
/* Function Prototypes */
static int ppc4xx_edac_probe(struct platform_device *device,
const struct of_device_id *device_id);
static int ppc4xx_edac_probe(struct platform_device *device)
static int ppc4xx_edac_remove(struct platform_device *device);
/* Global Variables */
@ -201,7 +200,7 @@ static struct of_device_id ppc4xx_edac_match[] = {
{ }
};
static struct of_platform_driver ppc4xx_edac_driver = {
static struct platform_driver ppc4xx_edac_driver = {
.probe = ppc4xx_edac_probe,
.remove = ppc4xx_edac_remove,
.driver = {
@ -997,9 +996,6 @@ ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1)
* initialized.
* @op: A pointer to the OpenFirmware device tree node associated
* with the controller this EDAC instance is bound to.
* @match: A pointer to the OpenFirmware device tree match
* information associated with the controller this EDAC instance
* is bound to.
* @dcr_host: A pointer to the DCR data containing the DCR mapping
* for this controller instance.
* @mcopt1: The 32-bit Memory Controller Option 1 register value
@ -1015,7 +1011,6 @@ ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1)
static int __devinit
ppc4xx_edac_mc_init(struct mem_ctl_info *mci,
struct platform_device *op,
const struct of_device_id *match,
const dcr_host_t *dcr_host,
u32 mcopt1)
{
@ -1024,7 +1019,7 @@ ppc4xx_edac_mc_init(struct mem_ctl_info *mci,
struct ppc4xx_edac_pdata *pdata = NULL;
const struct device_node *np = op->dev.of_node;
if (match == NULL)
if (op->dev.of_match == NULL)
return -EINVAL;
/* Initial driver pointers and private data */
@ -1227,9 +1222,6 @@ ppc4xx_edac_map_dcrs(const struct device_node *np, dcr_host_t *dcr_host)
* ppc4xx_edac_probe - check controller and bind driver
* @op: A pointer to the OpenFirmware device tree node associated
* with the controller being probed for driver binding.
* @match: A pointer to the OpenFirmware device tree match
* information associated with the controller being probed
* for driver binding.
*
* This routine probes a specific ibm,sdram-4xx-ddr2 controller
* instance for binding with the driver.
@ -1237,8 +1229,7 @@ ppc4xx_edac_map_dcrs(const struct device_node *np, dcr_host_t *dcr_host)
* Returns 0 if the controller instance was successfully bound to the
* driver; otherwise, < 0 on error.
*/
static int __devinit
ppc4xx_edac_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit ppc4xx_edac_probe(struct platform_device *op)
{
int status = 0;
u32 mcopt1, memcheck;
@ -1304,7 +1295,7 @@ ppc4xx_edac_probe(struct platform_device *op, const struct of_device_id *match)
goto done;
}
status = ppc4xx_edac_mc_init(mci, op, match, &dcr_host, mcopt1);
status = ppc4xx_edac_mc_init(mci, op, &dcr_host, mcopt1);
if (status) {
ppc4xx_edac_mc_printk(KERN_ERR, mci,
@ -1421,7 +1412,7 @@ ppc4xx_edac_init(void)
ppc4xx_edac_opstate_init();
return of_register_platform_driver(&ppc4xx_edac_driver);
return platform_driver_register(&ppc4xx_edac_driver);
}
/**
@ -1434,7 +1425,7 @@ ppc4xx_edac_init(void)
static void __exit
ppc4xx_edac_exit(void)
{
of_unregister_platform_driver(&ppc4xx_edac_driver);
platform_driver_unregister(&ppc4xx_edac_driver);
}
module_init(ppc4xx_edac_init);

View File

@ -234,8 +234,7 @@ static const struct attribute_group env_group = {
.attrs = env_attributes,
};
static int __devinit env_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit env_probe(struct platform_device *op)
{
struct env *p = kzalloc(sizeof(*p), GFP_KERNEL);
int err = -ENOMEM;
@ -299,7 +298,7 @@ static const struct of_device_id env_match[] = {
};
MODULE_DEVICE_TABLE(of, env_match);
static struct of_platform_driver env_driver = {
static struct platform_driver env_driver = {
.driver = {
.name = "ultra45_env",
.owner = THIS_MODULE,
@ -311,12 +310,12 @@ static struct of_platform_driver env_driver = {
static int __init env_init(void)
{
return of_register_platform_driver(&env_driver);
return platform_driver_register(&env_driver);
}
static void __exit env_exit(void)
{
of_unregister_platform_driver(&env_driver);
platform_driver_unregister(&env_driver);
}
module_init(env_init);

View File

@ -634,8 +634,7 @@ static void cpm_i2c_shutdown(struct cpm_i2c *cpm)
cpm_muram_free(cpm->i2c_addr);
}
static int __devinit cpm_i2c_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit cpm_i2c_probe(struct platform_device *ofdev)
{
int result, len;
struct cpm_i2c *cpm;
@ -718,7 +717,7 @@ static const struct of_device_id cpm_i2c_match[] = {
MODULE_DEVICE_TABLE(of, cpm_i2c_match);
static struct of_platform_driver cpm_i2c_driver = {
static struct platform_driver cpm_i2c_driver = {
.probe = cpm_i2c_probe,
.remove = __devexit_p(cpm_i2c_remove),
.driver = {
@ -730,12 +729,12 @@ static struct of_platform_driver cpm_i2c_driver = {
static int __init cpm_i2c_init(void)
{
return of_register_platform_driver(&cpm_i2c_driver);
return platform_driver_register(&cpm_i2c_driver);
}
static void __exit cpm_i2c_exit(void)
{
of_unregister_platform_driver(&cpm_i2c_driver);
platform_driver_unregister(&cpm_i2c_driver);
}
module_init(cpm_i2c_init);

View File

@ -691,8 +691,7 @@ static int __devinit iic_request_irq(struct platform_device *ofdev,
/*
* Register single IIC interface
*/
static int __devinit iic_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit iic_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct ibm_iic_private *dev;
@ -806,7 +805,7 @@ static const struct of_device_id ibm_iic_match[] = {
{}
};
static struct of_platform_driver ibm_iic_driver = {
static struct platform_driver ibm_iic_driver = {
.driver = {
.name = "ibm-iic",
.owner = THIS_MODULE,
@ -818,12 +817,12 @@ static struct of_platform_driver ibm_iic_driver = {
static int __init iic_init(void)
{
return of_register_platform_driver(&ibm_iic_driver);
return platform_driver_register(&ibm_iic_driver);
}
static void __exit iic_exit(void)
{
of_unregister_platform_driver(&ibm_iic_driver);
platform_driver_unregister(&ibm_iic_driver);
}
module_init(iic_init);

View File

@ -560,8 +560,7 @@ static struct i2c_adapter mpc_ops = {
.timeout = HZ,
};
static int __devinit fsl_i2c_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit fsl_i2c_probe(struct platform_device *op)
{
struct mpc_i2c *i2c;
const u32 *prop;
@ -569,6 +568,9 @@ static int __devinit fsl_i2c_probe(struct platform_device *op,
int result = 0;
int plen;
if (!op->dev.of_match)
return -EINVAL;
i2c = kzalloc(sizeof(*i2c), GFP_KERNEL);
if (!i2c)
return -ENOMEM;
@ -603,8 +605,8 @@ static int __devinit fsl_i2c_probe(struct platform_device *op,
clock = *prop;
}
if (match->data) {
struct mpc_i2c_data *data = match->data;
if (op->dev.of_match->data) {
struct mpc_i2c_data *data = op->dev.of_match->data;
data->setup(op->dev.of_node, i2c, clock, data->prescaler);
} else {
/* Backwards compatibility */
@ -700,7 +702,7 @@ static const struct of_device_id mpc_i2c_of_match[] = {
MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
/* Structure for a device driver */
static struct of_platform_driver mpc_i2c_driver = {
static struct platform_driver mpc_i2c_driver = {
.probe = fsl_i2c_probe,
.remove = __devexit_p(fsl_i2c_remove),
.driver = {
@ -712,18 +714,12 @@ static struct of_platform_driver mpc_i2c_driver = {
static int __init fsl_i2c_init(void)
{
int rv;
rv = of_register_platform_driver(&mpc_i2c_driver);
if (rv)
printk(KERN_ERR DRV_NAME
" of_register_platform_driver failed (%i)\n", rv);
return rv;
return platform_driver_register(&mpc_i2c_driver);
}
static void __exit fsl_i2c_exit(void)
{
of_unregister_platform_driver(&mpc_i2c_driver);
platform_driver_unregister(&mpc_i2c_driver);
}
module_init(fsl_i2c_init);

View File

@ -173,18 +173,16 @@ static int __devinit sparcspkr_probe(struct device *dev)
return 0;
}
static int sparcspkr_shutdown(struct platform_device *dev)
static void sparcspkr_shutdown(struct platform_device *dev)
{
struct sparcspkr_state *state = dev_get_drvdata(&dev->dev);
struct input_dev *input_dev = state->input_dev;
/* turn off the speaker */
state->event(input_dev, EV_SND, SND_BELL, 0);
return 0;
}
static int __devinit bbc_beep_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit bbc_beep_probe(struct platform_device *op)
{
struct sparcspkr_state *state;
struct bbc_beep_info *info;
@ -258,7 +256,7 @@ static const struct of_device_id bbc_beep_match[] = {
{},
};
static struct of_platform_driver bbc_beep_driver = {
static struct platform_driver bbc_beep_driver = {
.driver = {
.name = "bbcbeep",
.owner = THIS_MODULE,
@ -269,7 +267,7 @@ static struct of_platform_driver bbc_beep_driver = {
.shutdown = sparcspkr_shutdown,
};
static int __devinit grover_beep_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit grover_beep_probe(struct platform_device *op)
{
struct sparcspkr_state *state;
struct grover_beep_info *info;
@ -340,7 +338,7 @@ static const struct of_device_id grover_beep_match[] = {
{},
};
static struct of_platform_driver grover_beep_driver = {
static struct platform_driver grover_beep_driver = {
.driver = {
.name = "groverbeep",
.owner = THIS_MODULE,
@ -353,12 +351,12 @@ static struct of_platform_driver grover_beep_driver = {
static int __init sparcspkr_init(void)
{
int err = of_register_platform_driver(&bbc_beep_driver);
int err = platform_driver_register(&bbc_beep_driver);
if (!err) {
err = of_register_platform_driver(&grover_beep_driver);
err = platform_driver_register(&grover_beep_driver);
if (err)
of_unregister_platform_driver(&bbc_beep_driver);
platform_driver_unregister(&bbc_beep_driver);
}
return err;
@ -366,8 +364,8 @@ static int __init sparcspkr_init(void)
static void __exit sparcspkr_exit(void)
{
of_unregister_platform_driver(&bbc_beep_driver);
of_unregister_platform_driver(&grover_beep_driver);
platform_driver_unregister(&bbc_beep_driver);
platform_driver_unregister(&grover_beep_driver);
}
module_init(sparcspkr_init);

View File

@ -19,6 +19,7 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/of.h>
#define DRV_NAME "altera_ps2"
@ -173,6 +174,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
return 0;
}
#ifdef CONFIG_OF
static const struct of_device_id altera_ps2_match[] = {
{ .compatible = "ALTR,ps2-1.0", },
{},
};
MODULE_DEVICE_TABLE(of, altera_ps2_match);
#else /* CONFIG_OF */
#define altera_ps2_match NULL
#endif /* CONFIG_OF */
/*
* Our device driver structure
*/
@ -182,6 +193,7 @@ static struct platform_driver altera_ps2_driver = {
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
.of_match_table = altera_ps2_match,
},
};
@ -189,13 +201,12 @@ static int __init altera_ps2_init(void)
{
return platform_driver_register(&altera_ps2_driver);
}
module_init(altera_ps2_init);
static void __exit altera_ps2_exit(void)
{
platform_driver_unregister(&altera_ps2_driver);
}
module_init(altera_ps2_init);
module_exit(altera_ps2_exit);
MODULE_DESCRIPTION("Altera University Program PS2 controller driver");

View File

@ -49,7 +49,7 @@ static inline void i8042_write_command(int val)
#define OBP_PS2MS_NAME1 "kdmouse"
#define OBP_PS2MS_NAME2 "mouse"
static int __devinit sparc_i8042_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit sparc_i8042_probe(struct platform_device *op)
{
struct device_node *dp = op->dev.of_node;
@ -95,7 +95,7 @@ static const struct of_device_id sparc_i8042_match[] = {
};
MODULE_DEVICE_TABLE(of, sparc_i8042_match);
static struct of_platform_driver sparc_i8042_driver = {
static struct platform_driver sparc_i8042_driver = {
.driver = {
.name = "i8042",
.owner = THIS_MODULE,
@ -116,7 +116,7 @@ static int __init i8042_platform_init(void)
if (!kbd_iobase)
return -ENODEV;
} else {
int err = of_register_platform_driver(&sparc_i8042_driver);
int err = platform_driver_register(&sparc_i8042_driver);
if (err)
return err;
@ -140,7 +140,7 @@ static inline void i8042_platform_exit(void)
struct device_node *root = of_find_node_by_path("/");
if (strcmp(root->name, "SUNW,JavaStation-1"))
of_unregister_platform_driver(&sparc_i8042_driver);
platform_driver_unregister(&sparc_i8042_driver);
}
#else /* !CONFIG_PCI */

View File

@ -232,8 +232,7 @@ static void sxps2_close(struct serio *pserio)
* It returns 0, if the driver is bound to the PS/2 device, or a negative
* value if there is an error.
*/
static int __devinit xps2_of_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit xps2_of_probe(struct platform_device *ofdev)
{
struct resource r_irq; /* Interrupt resources */
struct resource r_mem; /* IO mem resources */
@ -361,7 +360,7 @@ static const struct of_device_id xps2_of_match[] __devinitconst = {
};
MODULE_DEVICE_TABLE(of, xps2_of_match);
static struct of_platform_driver xps2_of_driver = {
static struct platform_driver xps2_of_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
@ -373,12 +372,12 @@ static struct of_platform_driver xps2_of_driver = {
static int __init xps2_init(void)
{
return of_register_platform_driver(&xps2_of_driver);
return platform_driver_register(&xps2_of_driver);
}
static void __exit xps2_cleanup(void)
{
of_unregister_platform_driver(&xps2_of_driver);
platform_driver_unregister(&xps2_of_driver);
}
module_init(xps2_init);

View File

@ -14,6 +14,8 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/leds.h>
#include <linux/of_platform.h>
#include <linux/of_gpio.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
@ -151,96 +153,34 @@ static void delete_gpio_led(struct gpio_led_data *led)
gpio_free(led->gpio);
}
#ifdef CONFIG_LEDS_GPIO_PLATFORM
static int __devinit gpio_led_probe(struct platform_device *pdev)
{
struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
struct gpio_led_data *leds_data;
int i, ret = 0;
if (!pdata)
return -EBUSY;
leds_data = kzalloc(sizeof(struct gpio_led_data) * pdata->num_leds,
GFP_KERNEL);
if (!leds_data)
return -ENOMEM;
for (i = 0; i < pdata->num_leds; i++) {
ret = create_gpio_led(&pdata->leds[i], &leds_data[i],
&pdev->dev, pdata->gpio_blink_set);
if (ret < 0)
goto err;
}
platform_set_drvdata(pdev, leds_data);
return 0;
err:
for (i = i - 1; i >= 0; i--)
delete_gpio_led(&leds_data[i]);
kfree(leds_data);
return ret;
}
static int __devexit gpio_led_remove(struct platform_device *pdev)
{
int i;
struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
struct gpio_led_data *leds_data;
leds_data = platform_get_drvdata(pdev);
for (i = 0; i < pdata->num_leds; i++)
delete_gpio_led(&leds_data[i]);
kfree(leds_data);
return 0;
}
static struct platform_driver gpio_led_driver = {
.probe = gpio_led_probe,
.remove = __devexit_p(gpio_led_remove),
.driver = {
.name = "leds-gpio",
.owner = THIS_MODULE,
},
struct gpio_leds_priv {
int num_leds;
struct gpio_led_data leds[];
};
MODULE_ALIAS("platform:leds-gpio");
#endif /* CONFIG_LEDS_GPIO_PLATFORM */
static inline int sizeof_gpio_leds_priv(int num_leds)
{
return sizeof(struct gpio_leds_priv) +
(sizeof(struct gpio_led_data) * num_leds);
}
/* Code to create from OpenFirmware platform devices */
#ifdef CONFIG_LEDS_GPIO_OF
#include <linux/of_platform.h>
#include <linux/of_gpio.h>
struct gpio_led_of_platform_data {
int num_leds;
struct gpio_led_data led_data[];
};
static int __devinit of_gpio_leds_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_device *pdev)
{
struct device_node *np = ofdev->dev.of_node, *child;
struct gpio_led_of_platform_data *pdata;
struct device_node *np = pdev->dev.of_node, *child;
struct gpio_leds_priv *priv;
int count = 0, ret;
/* count LEDs defined by this device, so we know how much to allocate */
/* count LEDs in this device, so we know how much to allocate */
for_each_child_of_node(np, child)
count++;
if (!count)
return 0; /* or ENODEV? */
return NULL;
pdata = kzalloc(sizeof(*pdata) + sizeof(struct gpio_led_data) * count,
GFP_KERNEL);
if (!pdata)
return -ENOMEM;
priv = kzalloc(sizeof_gpio_leds_priv(count), GFP_KERNEL);
if (!priv)
return NULL;
for_each_child_of_node(np, child) {
struct gpio_led led = {};
@ -256,92 +196,112 @@ static int __devinit of_gpio_leds_probe(struct platform_device *ofdev,
if (state) {
if (!strcmp(state, "keep"))
led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
else if(!strcmp(state, "on"))
else if (!strcmp(state, "on"))
led.default_state = LEDS_GPIO_DEFSTATE_ON;
else
led.default_state = LEDS_GPIO_DEFSTATE_OFF;
}
ret = create_gpio_led(&led, &pdata->led_data[pdata->num_leds++],
&ofdev->dev, NULL);
ret = create_gpio_led(&led, &priv->leds[priv->num_leds++],
&pdev->dev, NULL);
if (ret < 0) {
of_node_put(child);
goto err;
}
}
dev_set_drvdata(&ofdev->dev, pdata);
return 0;
return priv;
err:
for (count = pdata->num_leds - 2; count >= 0; count--)
delete_gpio_led(&pdata->led_data[count]);
kfree(pdata);
return ret;
}
static int __devexit of_gpio_leds_remove(struct platform_device *ofdev)
{
struct gpio_led_of_platform_data *pdata = dev_get_drvdata(&ofdev->dev);
int i;
for (i = 0; i < pdata->num_leds; i++)
delete_gpio_led(&pdata->led_data[i]);
kfree(pdata);
dev_set_drvdata(&ofdev->dev, NULL);
return 0;
for (count = priv->num_leds - 2; count >= 0; count--)
delete_gpio_led(&priv->leds[count]);
kfree(priv);
return NULL;
}
static const struct of_device_id of_gpio_leds_match[] = {
{ .compatible = "gpio-leds", },
{},
};
#else
static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_device *pdev)
{
return NULL;
}
#define of_gpio_leds_match NULL
#endif
static struct of_platform_driver of_gpio_leds_driver = {
.driver = {
.name = "of_gpio_leds",
.owner = THIS_MODULE,
static int __devinit gpio_led_probe(struct platform_device *pdev)
{
struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
struct gpio_leds_priv *priv;
int i, ret = 0;
if (pdata && pdata->num_leds) {
priv = kzalloc(sizeof_gpio_leds_priv(pdata->num_leds),
GFP_KERNEL);
if (!priv)
return -ENOMEM;
priv->num_leds = pdata->num_leds;
for (i = 0; i < priv->num_leds; i++) {
ret = create_gpio_led(&pdata->leds[i],
&priv->leds[i],
&pdev->dev, pdata->gpio_blink_set);
if (ret < 0) {
/* On failure: unwind the led creations */
for (i = i - 1; i >= 0; i--)
delete_gpio_led(&priv->leds[i]);
kfree(priv);
return ret;
}
}
} else {
priv = gpio_leds_create_of(pdev);
if (!priv)
return -ENODEV;
}
platform_set_drvdata(pdev, priv);
return 0;
}
static int __devexit gpio_led_remove(struct platform_device *pdev)
{
struct gpio_leds_priv *priv = dev_get_drvdata(&pdev->dev);
int i;
for (i = 0; i < priv->num_leds; i++)
delete_gpio_led(&priv->leds[i]);
dev_set_drvdata(&pdev->dev, NULL);
kfree(priv);
return 0;
}
static struct platform_driver gpio_led_driver = {
.probe = gpio_led_probe,
.remove = __devexit_p(gpio_led_remove),
.driver = {
.name = "leds-gpio",
.owner = THIS_MODULE,
.of_match_table = of_gpio_leds_match,
},
.probe = of_gpio_leds_probe,
.remove = __devexit_p(of_gpio_leds_remove),
};
#endif
MODULE_ALIAS("platform:leds-gpio");
static int __init gpio_led_init(void)
{
int ret = 0;
#ifdef CONFIG_LEDS_GPIO_PLATFORM
ret = platform_driver_register(&gpio_led_driver);
if (ret)
return ret;
#endif
#ifdef CONFIG_LEDS_GPIO_OF
ret = of_register_platform_driver(&of_gpio_leds_driver);
#endif
#ifdef CONFIG_LEDS_GPIO_PLATFORM
if (ret)
platform_driver_unregister(&gpio_led_driver);
#endif
return ret;
return platform_driver_register(&gpio_led_driver);
}
static void __exit gpio_led_exit(void)
{
#ifdef CONFIG_LEDS_GPIO_PLATFORM
platform_driver_unregister(&gpio_led_driver);
#endif
#ifdef CONFIG_LEDS_GPIO_OF
of_unregister_platform_driver(&of_gpio_leds_driver);
#endif
}
module_init(gpio_led_init);

View File

@ -645,8 +645,7 @@ static void smu_expose_childs(struct work_struct *unused)
static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs);
static int smu_platform_probe(struct platform_device* dev,
const struct of_device_id *match)
static int smu_platform_probe(struct platform_device* dev)
{
if (!smu)
return -ENODEV;
@ -669,7 +668,7 @@ static const struct of_device_id smu_platform_match[] =
{},
};
static struct of_platform_driver smu_of_platform_driver =
static struct platform_driver smu_of_platform_driver =
{
.driver = {
.name = "smu",
@ -689,7 +688,7 @@ static int __init smu_init_sysfs(void)
* I'm a bit too far from figuring out how that works with those
* new chipsets, but that will come back and bite us
*/
of_register_platform_driver(&smu_of_platform_driver);
platform_driver_register(&smu_of_platform_driver);
return 0;
}

View File

@ -2210,7 +2210,7 @@ static void fcu_lookup_fans(struct device_node *fcu_node)
}
}
static int fcu_of_probe(struct platform_device* dev, const struct of_device_id *match)
static int fcu_of_probe(struct platform_device* dev)
{
state = state_detached;
of_dev = dev;
@ -2240,7 +2240,7 @@ static const struct of_device_id fcu_match[] =
};
MODULE_DEVICE_TABLE(of, fcu_match);
static struct of_platform_driver fcu_of_platform_driver =
static struct platform_driver fcu_of_platform_driver =
{
.driver = {
.name = "temperature",
@ -2263,12 +2263,12 @@ static int __init therm_pm72_init(void)
!rackmac)
return -ENODEV;
return of_register_platform_driver(&fcu_of_platform_driver);
return platform_driver_register(&fcu_of_platform_driver);
}
static void __exit therm_pm72_exit(void)
{
of_unregister_platform_driver(&fcu_of_platform_driver);
platform_driver_unregister(&fcu_of_platform_driver);
}
module_init(therm_pm72_init);

View File

@ -443,8 +443,7 @@ static struct i2c_driver g4fan_driver = {
/* initialization / cleanup */
/************************************************************************/
static int
therm_of_probe( struct platform_device *dev, const struct of_device_id *match )
static int therm_of_probe(struct platform_device *dev)
{
return i2c_add_driver( &g4fan_driver );
}
@ -462,7 +461,7 @@ static const struct of_device_id therm_of_match[] = {{
}, {}
};
static struct of_platform_driver therm_of_driver = {
static struct platform_driver therm_of_driver = {
.driver = {
.name = "temperature",
.owner = THIS_MODULE,
@ -509,14 +508,14 @@ g4fan_init( void )
return -ENODEV;
}
of_register_platform_driver( &therm_of_driver );
platform_driver_register( &therm_of_driver );
return 0;
}
static void __exit
g4fan_exit( void )
{
of_unregister_platform_driver( &therm_of_driver );
platform_driver_unregister( &therm_of_driver );
if( x.of_dev )
of_device_unregister( x.of_dev );

View File

@ -1445,8 +1445,7 @@ static struct video_device viu_template = {
.current_norm = V4L2_STD_NTSC_M,
};
static int __devinit viu_of_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit viu_of_probe(struct platform_device *op)
{
struct viu_dev *viu_dev;
struct video_device *vdev;
@ -1627,7 +1626,7 @@ static struct of_device_id mpc512x_viu_of_match[] = {
};
MODULE_DEVICE_TABLE(of, mpc512x_viu_of_match);
static struct of_platform_driver viu_of_platform_driver = {
static struct platform_driver viu_of_platform_driver = {
.probe = viu_of_probe,
.remove = __devexit_p(viu_of_remove),
#ifdef CONFIG_PM
@ -1643,12 +1642,12 @@ static struct of_platform_driver viu_of_platform_driver = {
static int __init viu_init(void)
{
return of_register_platform_driver(&viu_of_platform_driver);
return platform_driver_register(&viu_of_platform_driver);
}
static void __exit viu_exit(void)
{
of_unregister_platform_driver(&viu_of_platform_driver);
platform_driver_unregister(&viu_of_platform_driver);
}
module_init(viu_init);

View File

@ -124,17 +124,20 @@ static bool __devinit sdhci_of_wp_inverted(struct device_node *np)
#endif
}
static int __devinit sdhci_of_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit sdhci_of_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct sdhci_of_data *sdhci_of_data = match->data;
struct sdhci_of_data *sdhci_of_data;
struct sdhci_host *host;
struct sdhci_of_host *of_host;
const __be32 *clk;
int size;
int ret;
if (!ofdev->dev.of_match)
return -EINVAL;
sdhci_of_data = ofdev->dev.of_match->data;
if (!of_device_is_available(np))
return -ENODEV;
@ -217,7 +220,7 @@ static const struct of_device_id sdhci_of_match[] = {
};
MODULE_DEVICE_TABLE(of, sdhci_of_match);
static struct of_platform_driver sdhci_of_driver = {
static struct platform_driver sdhci_of_driver = {
.driver = {
.name = "sdhci-of",
.owner = THIS_MODULE,
@ -231,13 +234,13 @@ static struct of_platform_driver sdhci_of_driver = {
static int __init sdhci_of_init(void)
{
return of_register_platform_driver(&sdhci_of_driver);
return platform_driver_register(&sdhci_of_driver);
}
module_init(sdhci_of_init);
static void __exit sdhci_of_exit(void)
{
of_unregister_platform_driver(&sdhci_of_driver);
platform_driver_unregister(&sdhci_of_driver);
}
module_exit(sdhci_of_exit);

View File

@ -216,8 +216,7 @@ static void __devinit of_free_probes(const char **probes)
}
#endif
static int __devinit of_flash_probe(struct platform_device *dev,
const struct of_device_id *match)
static int __devinit of_flash_probe(struct platform_device *dev)
{
#ifdef CONFIG_MTD_PARTITIONS
const char **part_probe_types;
@ -225,7 +224,7 @@ static int __devinit of_flash_probe(struct platform_device *dev,
struct device_node *dp = dev->dev.of_node;
struct resource res;
struct of_flash *info;
const char *probe_type = match->data;
const char *probe_type;
const __be32 *width;
int err;
int i;
@ -235,6 +234,10 @@ static int __devinit of_flash_probe(struct platform_device *dev,
struct mtd_info **mtd_list = NULL;
resource_size_t res_size;
if (!dev->dev.of_match)
return -EINVAL;
probe_type = dev->dev.of_match->data;
reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32);
/*
@ -418,7 +421,7 @@ static struct of_device_id of_flash_match[] = {
};
MODULE_DEVICE_TABLE(of, of_flash_match);
static struct of_platform_driver of_flash_driver = {
static struct platform_driver of_flash_driver = {
.driver = {
.name = "of-flash",
.owner = THIS_MODULE,
@ -430,12 +433,12 @@ static struct of_platform_driver of_flash_driver = {
static int __init of_flash_init(void)
{
return of_register_platform_driver(&of_flash_driver);
return platform_driver_register(&of_flash_driver);
}
static void __exit of_flash_exit(void)
{
of_unregister_platform_driver(&of_flash_driver);
platform_driver_unregister(&of_flash_driver);
}
module_init(of_flash_init);

View File

@ -108,7 +108,7 @@ int uflash_devinit(struct platform_device *op, struct device_node *dp)
return 0;
}
static int __devinit uflash_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit uflash_probe(struct platform_device *op)
{
struct device_node *dp = op->dev.of_node;
@ -148,7 +148,7 @@ static const struct of_device_id uflash_match[] = {
MODULE_DEVICE_TABLE(of, uflash_match);
static struct of_platform_driver uflash_driver = {
static struct platform_driver uflash_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
@ -160,12 +160,12 @@ static struct of_platform_driver uflash_driver = {
static int __init uflash_init(void)
{
return of_register_platform_driver(&uflash_driver);
return platform_driver_register(&uflash_driver);
}
static void __exit uflash_exit(void)
{
of_unregister_platform_driver(&uflash_driver);
platform_driver_unregister(&uflash_driver);
}
module_init(uflash_init);

View File

@ -217,8 +217,7 @@ err:
return ret;
}
static int __devinit fun_probe(struct platform_device *ofdev,
const struct of_device_id *ofid)
static int __devinit fun_probe(struct platform_device *ofdev)
{
struct fsl_upm_nand *fun;
struct resource io_res;
@ -360,7 +359,7 @@ static const struct of_device_id of_fun_match[] = {
};
MODULE_DEVICE_TABLE(of, of_fun_match);
static struct of_platform_driver of_fun_driver = {
static struct platform_driver of_fun_driver = {
.driver = {
.name = "fsl,upm-nand",
.owner = THIS_MODULE,
@ -372,13 +371,13 @@ static struct of_platform_driver of_fun_driver = {
static int __init fun_module_init(void)
{
return of_register_platform_driver(&of_fun_driver);
return platform_driver_register(&of_fun_driver);
}
module_init(fun_module_init);
static void __exit fun_module_exit(void)
{
of_unregister_platform_driver(&of_fun_driver);
platform_driver_unregister(&of_fun_driver);
}
module_exit(fun_module_exit);

View File

@ -650,8 +650,7 @@ static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd)
iounmap(prv->csreg);
}
static int __devinit mpc5121_nfc_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit mpc5121_nfc_probe(struct platform_device *op)
{
struct device_node *rootnode, *dn = op->dev.of_node;
struct device *dev = &op->dev;
@ -891,7 +890,7 @@ static struct of_device_id mpc5121_nfc_match[] __devinitdata = {
{},
};
static struct of_platform_driver mpc5121_nfc_driver = {
static struct platform_driver mpc5121_nfc_driver = {
.probe = mpc5121_nfc_probe,
.remove = __devexit_p(mpc5121_nfc_remove),
.driver = {
@ -903,14 +902,14 @@ static struct of_platform_driver mpc5121_nfc_driver = {
static int __init mpc5121_nfc_init(void)
{
return of_register_platform_driver(&mpc5121_nfc_driver);
return platform_driver_register(&mpc5121_nfc_driver);
}
module_init(mpc5121_nfc_init);
static void __exit mpc5121_nfc_cleanup(void)
{
of_unregister_platform_driver(&mpc5121_nfc_driver);
platform_driver_unregister(&mpc5121_nfc_driver);
}
module_exit(mpc5121_nfc_cleanup);

View File

@ -225,8 +225,7 @@ err:
return ret;
}
static int __devinit ndfc_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit ndfc_probe(struct platform_device *ofdev)
{
struct ndfc_controller *ndfc = &ndfc_ctrl;
const __be32 *reg;
@ -292,7 +291,7 @@ static const struct of_device_id ndfc_match[] = {
};
MODULE_DEVICE_TABLE(of, ndfc_match);
static struct of_platform_driver ndfc_driver = {
static struct platform_driver ndfc_driver = {
.driver = {
.name = "ndfc",
.owner = THIS_MODULE,
@ -304,12 +303,12 @@ static struct of_platform_driver ndfc_driver = {
static int __init ndfc_nand_init(void)
{
return of_register_platform_driver(&ndfc_driver);
return platform_driver_register(&ndfc_driver);
}
static void __exit ndfc_nand_exit(void)
{
of_unregister_platform_driver(&ndfc_driver);
platform_driver_unregister(&ndfc_driver);
}
module_init(ndfc_nand_init);

View File

@ -89,8 +89,7 @@ int pasemi_device_ready(struct mtd_info *mtd)
return !!(inl(lpcctl) & LBICTRL_LPCCTL_NR);
}
static int __devinit pasemi_nand_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit pasemi_nand_probe(struct platform_device *ofdev)
{
struct pci_dev *pdev;
struct device_node *np = ofdev->dev.of_node;
@ -219,7 +218,7 @@ static const struct of_device_id pasemi_nand_match[] =
MODULE_DEVICE_TABLE(of, pasemi_nand_match);
static struct of_platform_driver pasemi_nand_driver =
static struct platform_driver pasemi_nand_driver =
{
.driver = {
.name = (char*)driver_name,
@ -232,13 +231,13 @@ static struct of_platform_driver pasemi_nand_driver =
static int __init pasemi_nand_init(void)
{
return of_register_platform_driver(&pasemi_nand_driver);
return platform_driver_register(&pasemi_nand_driver);
}
module_init(pasemi_nand_init);
static void __exit pasemi_nand_exit(void)
{
of_unregister_platform_driver(&pasemi_nand_driver);
platform_driver_unregister(&pasemi_nand_driver);
}
module_exit(pasemi_nand_exit);

View File

@ -162,8 +162,7 @@ static const char *part_probes[] = { "cmdlinepart", NULL };
/*
* Probe for the NAND device.
*/
static int __devinit socrates_nand_probe(struct platform_device *ofdev,
const struct of_device_id *ofid)
static int __devinit socrates_nand_probe(struct platform_device *ofdev)
{
struct socrates_nand_host *host;
struct mtd_info *mtd;
@ -300,7 +299,7 @@ static const struct of_device_id socrates_nand_match[] =
MODULE_DEVICE_TABLE(of, socrates_nand_match);
static struct of_platform_driver socrates_nand_driver = {
static struct platform_driver socrates_nand_driver = {
.driver = {
.name = "socrates_nand",
.owner = THIS_MODULE,
@ -312,12 +311,12 @@ static struct of_platform_driver socrates_nand_driver = {
static int __init socrates_nand_init(void)
{
return of_register_platform_driver(&socrates_nand_driver);
return platform_driver_register(&socrates_nand_driver);
}
static void __exit socrates_nand_exit(void)
{
of_unregister_platform_driver(&socrates_nand_driver);
platform_driver_unregister(&socrates_nand_driver);
}
module_init(socrates_nand_init);

View File

@ -247,10 +247,9 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
}
#endif /* CONFIG_PPC_MPC512x */
static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev,
const struct of_device_id *id)
static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
{
struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data;
struct mpc5xxx_can_data *data;
struct device_node *np = ofdev->dev.of_node;
struct net_device *dev;
struct mscan_priv *priv;
@ -259,6 +258,10 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev,
int irq, mscan_clksrc = 0;
int err = -ENOMEM;
if (!ofdev->dev.of_match)
return -EINVAL;
data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data;
base = of_iomap(np, 0);
if (!base) {
dev_err(&ofdev->dev, "couldn't ioremap\n");
@ -391,7 +394,7 @@ static struct of_device_id __devinitdata mpc5xxx_can_table[] = {
{},
};
static struct of_platform_driver mpc5xxx_can_driver = {
static struct platform_driver mpc5xxx_can_driver = {
.driver = {
.name = "mpc5xxx_can",
.owner = THIS_MODULE,
@ -407,13 +410,13 @@ static struct of_platform_driver mpc5xxx_can_driver = {
static int __init mpc5xxx_can_init(void)
{
return of_register_platform_driver(&mpc5xxx_can_driver);
return platform_driver_register(&mpc5xxx_can_driver);
}
module_init(mpc5xxx_can_init);
static void __exit mpc5xxx_can_exit(void)
{
return of_unregister_platform_driver(&mpc5xxx_can_driver);
platform_driver_unregister(&mpc5xxx_can_driver);
};
module_exit(mpc5xxx_can_exit);

View File

@ -87,8 +87,7 @@ static int __devexit sja1000_ofp_remove(struct platform_device *ofdev)
return 0;
}
static int __devinit sja1000_ofp_probe(struct platform_device *ofdev,
const struct of_device_id *id)
static int __devinit sja1000_ofp_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct net_device *dev;
@ -210,7 +209,7 @@ static struct of_device_id __devinitdata sja1000_ofp_table[] = {
};
MODULE_DEVICE_TABLE(of, sja1000_ofp_table);
static struct of_platform_driver sja1000_ofp_driver = {
static struct platform_driver sja1000_ofp_driver = {
.driver = {
.owner = THIS_MODULE,
.name = DRV_NAME,
@ -222,12 +221,12 @@ static struct of_platform_driver sja1000_ofp_driver = {
static int __init sja1000_ofp_init(void)
{
return of_register_platform_driver(&sja1000_ofp_driver);
return platform_driver_register(&sja1000_ofp_driver);
}
module_init(sja1000_ofp_init);
static void __exit sja1000_ofp_exit(void)
{
return of_unregister_platform_driver(&sja1000_ofp_driver);
return platform_driver_unregister(&sja1000_ofp_driver);
};
module_exit(sja1000_ofp_exit);

View File

@ -840,8 +840,7 @@ static const struct net_device_ops mpc52xx_fec_netdev_ops = {
/* OF Driver */
/* ======================================================================== */
static int __devinit
mpc52xx_fec_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit mpc52xx_fec_probe(struct platform_device *op)
{
int rv;
struct net_device *ndev;
@ -1049,7 +1048,7 @@ static struct of_device_id mpc52xx_fec_match[] = {
MODULE_DEVICE_TABLE(of, mpc52xx_fec_match);
static struct of_platform_driver mpc52xx_fec_driver = {
static struct platform_driver mpc52xx_fec_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
@ -1073,21 +1072,21 @@ mpc52xx_fec_init(void)
{
#ifdef CONFIG_FEC_MPC52xx_MDIO
int ret;
ret = of_register_platform_driver(&mpc52xx_fec_mdio_driver);
ret = platform_driver_register(&mpc52xx_fec_mdio_driver);
if (ret) {
printk(KERN_ERR DRIVER_NAME ": failed to register mdio driver\n");
return ret;
}
#endif
return of_register_platform_driver(&mpc52xx_fec_driver);
return platform_driver_register(&mpc52xx_fec_driver);
}
static void __exit
mpc52xx_fec_exit(void)
{
of_unregister_platform_driver(&mpc52xx_fec_driver);
platform_driver_unregister(&mpc52xx_fec_driver);
#ifdef CONFIG_FEC_MPC52xx_MDIO
of_unregister_platform_driver(&mpc52xx_fec_mdio_driver);
platform_driver_unregister(&mpc52xx_fec_mdio_driver);
#endif
}

View File

@ -289,6 +289,6 @@ struct mpc52xx_fec {
#define FEC_XMIT_FSM_ENABLE_CRC 0x01000000
extern struct of_platform_driver mpc52xx_fec_mdio_driver;
extern struct platform_driver mpc52xx_fec_mdio_driver;
#endif /* __DRIVERS_NET_MPC52XX_FEC_H__ */

View File

@ -61,8 +61,7 @@ static int mpc52xx_fec_mdio_write(struct mii_bus *bus, int phy_id, int reg,
data | FEC_MII_WRITE_FRAME);
}
static int mpc52xx_fec_mdio_probe(struct platform_device *of,
const struct of_device_id *match)
static int mpc52xx_fec_mdio_probe(struct platform_device *of)
{
struct device *dev = &of->dev;
struct device_node *np = of->dev.of_node;
@ -145,7 +144,7 @@ static struct of_device_id mpc52xx_fec_mdio_match[] = {
};
MODULE_DEVICE_TABLE(of, mpc52xx_fec_mdio_match);
struct of_platform_driver mpc52xx_fec_mdio_driver = {
struct platform_driver mpc52xx_fec_mdio_driver = {
.driver = {
.name = "mpc5200b-fec-phy",
.owner = THIS_MODULE,

View File

@ -998,8 +998,7 @@ static const struct net_device_ops fs_enet_netdev_ops = {
#endif
};
static int __devinit fs_enet_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit fs_enet_probe(struct platform_device *ofdev)
{
struct net_device *ndev;
struct fs_enet_private *fep;
@ -1008,11 +1007,14 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev,
const u8 *mac_addr;
int privsize, len, ret = -ENODEV;
if (!ofdev->dev.of_match)
return -EINVAL;
fpi = kzalloc(sizeof(*fpi), GFP_KERNEL);
if (!fpi)
return -ENOMEM;
if (!IS_FEC(match)) {
if (!IS_FEC(ofdev->dev.of_match)) {
data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len);
if (!data || len != 4)
goto out_free_fpi;
@ -1047,7 +1049,7 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev,
fep->dev = &ofdev->dev;
fep->ndev = ndev;
fep->fpi = fpi;
fep->ops = match->data;
fep->ops = ofdev->dev.of_match->data;
ret = fep->ops->setup_data(ndev);
if (ret)
@ -1156,7 +1158,7 @@ static struct of_device_id fs_enet_match[] = {
};
MODULE_DEVICE_TABLE(of, fs_enet_match);
static struct of_platform_driver fs_enet_driver = {
static struct platform_driver fs_enet_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "fs_enet",
@ -1168,12 +1170,12 @@ static struct of_platform_driver fs_enet_driver = {
static int __init fs_init(void)
{
return of_register_platform_driver(&fs_enet_driver);
return platform_driver_register(&fs_enet_driver);
}
static void __exit fs_cleanup(void)
{
of_unregister_platform_driver(&fs_enet_driver);
platform_driver_unregister(&fs_enet_driver);
}
#ifdef CONFIG_NET_POLL_CONTROLLER

View File

@ -150,8 +150,7 @@ static int __devinit fs_mii_bitbang_init(struct mii_bus *bus,
return 0;
}
static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
{
struct mii_bus *new_bus;
struct bb_info *bitbang;
@ -223,7 +222,7 @@ static struct of_device_id fs_enet_mdio_bb_match[] = {
};
MODULE_DEVICE_TABLE(of, fs_enet_mdio_bb_match);
static struct of_platform_driver fs_enet_bb_mdio_driver = {
static struct platform_driver fs_enet_bb_mdio_driver = {
.driver = {
.name = "fsl-bb-mdio",
.owner = THIS_MODULE,
@ -235,12 +234,12 @@ static struct of_platform_driver fs_enet_bb_mdio_driver = {
static int fs_enet_mdio_bb_init(void)
{
return of_register_platform_driver(&fs_enet_bb_mdio_driver);
return platform_driver_register(&fs_enet_bb_mdio_driver);
}
static void fs_enet_mdio_bb_exit(void)
{
of_unregister_platform_driver(&fs_enet_bb_mdio_driver);
platform_driver_unregister(&fs_enet_bb_mdio_driver);
}
module_init(fs_enet_mdio_bb_init);

View File

@ -101,15 +101,18 @@ static int fs_enet_fec_mii_reset(struct mii_bus *bus)
return 0;
}
static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
{
struct resource res;
struct mii_bus *new_bus;
struct fec_info *fec;
int (*get_bus_freq)(struct device_node *) = match->data;
int (*get_bus_freq)(struct device_node *);
int ret = -ENOMEM, clock, speed;
if (!ofdev->dev.of_match)
return -EINVAL;
get_bus_freq = ofdev->dev.of_match->data;
new_bus = mdiobus_alloc();
if (!new_bus)
goto out;
@ -221,7 +224,7 @@ static struct of_device_id fs_enet_mdio_fec_match[] = {
};
MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match);
static struct of_platform_driver fs_enet_fec_mdio_driver = {
static struct platform_driver fs_enet_fec_mdio_driver = {
.driver = {
.name = "fsl-fec-mdio",
.owner = THIS_MODULE,
@ -233,12 +236,12 @@ static struct of_platform_driver fs_enet_fec_mdio_driver = {
static int fs_enet_mdio_fec_init(void)
{
return of_register_platform_driver(&fs_enet_fec_mdio_driver);
return platform_driver_register(&fs_enet_fec_mdio_driver);
}
static void fs_enet_mdio_fec_exit(void)
{
of_unregister_platform_driver(&fs_enet_fec_mdio_driver);
platform_driver_unregister(&fs_enet_fec_mdio_driver);
}
module_init(fs_enet_mdio_fec_init);

View File

@ -265,8 +265,7 @@ static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
#endif
static int fsl_pq_mdio_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int fsl_pq_mdio_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct device_node *tbi;
@ -471,7 +470,7 @@ static struct of_device_id fsl_pq_mdio_match[] = {
};
MODULE_DEVICE_TABLE(of, fsl_pq_mdio_match);
static struct of_platform_driver fsl_pq_mdio_driver = {
static struct platform_driver fsl_pq_mdio_driver = {
.driver = {
.name = "fsl-pq_mdio",
.owner = THIS_MODULE,
@ -483,13 +482,13 @@ static struct of_platform_driver fsl_pq_mdio_driver = {
int __init fsl_pq_mdio_init(void)
{
return of_register_platform_driver(&fsl_pq_mdio_driver);
return platform_driver_register(&fsl_pq_mdio_driver);
}
module_init(fsl_pq_mdio_init);
void fsl_pq_mdio_exit(void)
{
of_unregister_platform_driver(&fsl_pq_mdio_driver);
platform_driver_unregister(&fsl_pq_mdio_driver);
}
module_exit(fsl_pq_mdio_exit);
MODULE_LICENSE("GPL");

View File

@ -123,8 +123,7 @@ static irqreturn_t gfar_interrupt(int irq, void *dev_id);
static void adjust_link(struct net_device *dev);
static void init_registers(struct net_device *dev);
static int init_phy(struct net_device *dev);
static int gfar_probe(struct platform_device *ofdev,
const struct of_device_id *match);
static int gfar_probe(struct platform_device *ofdev);
static int gfar_remove(struct platform_device *ofdev);
static void free_skb_resources(struct gfar_private *priv);
static void gfar_set_multi(struct net_device *dev);
@ -957,8 +956,7 @@ static void gfar_detect_errata(struct gfar_private *priv)
/* Set up the ethernet device structure, private data,
* and anything else we need before we start */
static int gfar_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int gfar_probe(struct platform_device *ofdev)
{
u32 tempval;
struct net_device *dev = NULL;
@ -3256,7 +3254,7 @@ static struct of_device_id gfar_match[] =
MODULE_DEVICE_TABLE(of, gfar_match);
/* Structure for a device driver */
static struct of_platform_driver gfar_driver = {
static struct platform_driver gfar_driver = {
.driver = {
.name = "fsl-gianfar",
.owner = THIS_MODULE,
@ -3269,12 +3267,12 @@ static struct of_platform_driver gfar_driver = {
static int __init gfar_init(void)
{
return of_register_platform_driver(&gfar_driver);
return platform_driver_register(&gfar_driver);
}
static void __exit gfar_exit(void)
{
of_unregister_platform_driver(&gfar_driver);
platform_driver_unregister(&gfar_driver);
}
module_init(gfar_init);

View File

@ -1411,7 +1411,7 @@ error:
}
/* Initialize the GRETH MAC */
static int __devinit greth_of_probe(struct platform_device *ofdev, const struct of_device_id *match)
static int __devinit greth_of_probe(struct platform_device *ofdev)
{
struct net_device *dev;
struct greth_private *greth;
@ -1646,7 +1646,7 @@ static struct of_device_id greth_of_match[] = {
MODULE_DEVICE_TABLE(of, greth_of_match);
static struct of_platform_driver greth_of_driver = {
static struct platform_driver greth_of_driver = {
.driver = {
.name = "grlib-greth",
.owner = THIS_MODULE,
@ -1658,12 +1658,12 @@ static struct of_platform_driver greth_of_driver = {
static int __init greth_init(void)
{
return of_register_platform_driver(&greth_of_driver);
return platform_driver_register(&greth_of_driver);
}
static void __exit greth_cleanup(void)
{
of_unregister_platform_driver(&greth_of_driver);
platform_driver_unregister(&greth_of_driver);
}
module_init(greth_init);

View File

@ -2719,8 +2719,7 @@ static const struct net_device_ops emac_gige_netdev_ops = {
.ndo_change_mtu = emac_change_mtu,
};
static int __devinit emac_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit emac_probe(struct platform_device *ofdev)
{
struct net_device *ndev;
struct emac_instance *dev;
@ -2994,7 +2993,7 @@ static struct of_device_id emac_match[] =
};
MODULE_DEVICE_TABLE(of, emac_match);
static struct of_platform_driver emac_driver = {
static struct platform_driver emac_driver = {
.driver = {
.name = "emac",
.owner = THIS_MODULE,
@ -3069,7 +3068,7 @@ static int __init emac_init(void)
rc = tah_init();
if (rc)
goto err_rgmii;
rc = of_register_platform_driver(&emac_driver);
rc = platform_driver_register(&emac_driver);
if (rc)
goto err_tah;
@ -3091,7 +3090,7 @@ static void __exit emac_exit(void)
{
int i;
of_unregister_platform_driver(&emac_driver);
platform_driver_unregister(&emac_driver);
tah_exit();
rgmii_exit();

View File

@ -517,8 +517,7 @@ void *mal_dump_regs(struct mal_instance *mal, void *buf)
return regs + 1;
}
static int __devinit mal_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit mal_probe(struct platform_device *ofdev)
{
struct mal_instance *mal;
int err = 0, i, bd_size;
@ -789,7 +788,7 @@ static struct of_device_id mal_platform_match[] =
{},
};
static struct of_platform_driver mal_of_driver = {
static struct platform_driver mal_of_driver = {
.driver = {
.name = "mcmal",
.owner = THIS_MODULE,
@ -801,10 +800,10 @@ static struct of_platform_driver mal_of_driver = {
int __init mal_init(void)
{
return of_register_platform_driver(&mal_of_driver);
return platform_driver_register(&mal_of_driver);
}
void mal_exit(void)
{
of_unregister_platform_driver(&mal_of_driver);
platform_driver_unregister(&mal_of_driver);
}

View File

@ -228,8 +228,7 @@ void *rgmii_dump_regs(struct platform_device *ofdev, void *buf)
}
static int __devinit rgmii_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit rgmii_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct rgmii_instance *dev;
@ -318,7 +317,7 @@ static struct of_device_id rgmii_match[] =
{},
};
static struct of_platform_driver rgmii_driver = {
static struct platform_driver rgmii_driver = {
.driver = {
.name = "emac-rgmii",
.owner = THIS_MODULE,
@ -330,10 +329,10 @@ static struct of_platform_driver rgmii_driver = {
int __init rgmii_init(void)
{
return of_register_platform_driver(&rgmii_driver);
return platform_driver_register(&rgmii_driver);
}
void rgmii_exit(void)
{
of_unregister_platform_driver(&rgmii_driver);
platform_driver_unregister(&rgmii_driver);
}

View File

@ -87,8 +87,7 @@ void *tah_dump_regs(struct platform_device *ofdev, void *buf)
return regs + 1;
}
static int __devinit tah_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit tah_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct tah_instance *dev;
@ -165,7 +164,7 @@ static struct of_device_id tah_match[] =
{},
};
static struct of_platform_driver tah_driver = {
static struct platform_driver tah_driver = {
.driver = {
.name = "emac-tah",
.owner = THIS_MODULE,
@ -177,10 +176,10 @@ static struct of_platform_driver tah_driver = {
int __init tah_init(void)
{
return of_register_platform_driver(&tah_driver);
return platform_driver_register(&tah_driver);
}
void tah_exit(void)
{
of_unregister_platform_driver(&tah_driver);
platform_driver_unregister(&tah_driver);
}

View File

@ -231,8 +231,7 @@ void *zmii_dump_regs(struct platform_device *ofdev, void *buf)
return regs + 1;
}
static int __devinit zmii_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit zmii_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct zmii_instance *dev;
@ -312,7 +311,7 @@ static struct of_device_id zmii_match[] =
{},
};
static struct of_platform_driver zmii_driver = {
static struct platform_driver zmii_driver = {
.driver = {
.name = "emac-zmii",
.owner = THIS_MODULE,
@ -324,10 +323,10 @@ static struct of_platform_driver zmii_driver = {
int __init zmii_init(void)
{
return of_register_platform_driver(&zmii_driver);
return platform_driver_register(&zmii_driver);
}
void zmii_exit(void)
{
of_unregister_platform_driver(&zmii_driver);
platform_driver_unregister(&zmii_driver);
}

View File

@ -952,8 +952,7 @@ static const struct attribute_group temac_attr_group = {
.attrs = temac_device_attrs,
};
static int __devinit
temac_of_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit temac_of_probe(struct platform_device *op)
{
struct device_node *np;
struct temac_local *lp;
@ -1123,7 +1122,7 @@ static struct of_device_id temac_of_match[] __devinitdata = {
};
MODULE_DEVICE_TABLE(of, temac_of_match);
static struct of_platform_driver temac_of_driver = {
static struct platform_driver temac_of_driver = {
.probe = temac_of_probe,
.remove = __devexit_p(temac_of_remove),
.driver = {
@ -1135,13 +1134,13 @@ static struct of_platform_driver temac_of_driver = {
static int __init temac_init(void)
{
return of_register_platform_driver(&temac_of_driver);
return platform_driver_register(&temac_of_driver);
}
module_init(temac_init);
static void __exit temac_exit(void)
{
of_unregister_platform_driver(&temac_of_driver);
platform_driver_unregister(&temac_of_driver);
}
module_exit(temac_exit);

View File

@ -926,7 +926,7 @@ static const struct net_device_ops myri_ops = {
.ndo_validate_addr = eth_validate_addr,
};
static int __devinit myri_sbus_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit myri_sbus_probe(struct platform_device *op)
{
struct device_node *dp = op->dev.of_node;
static unsigned version_printed;
@ -1160,7 +1160,7 @@ static const struct of_device_id myri_sbus_match[] = {
MODULE_DEVICE_TABLE(of, myri_sbus_match);
static struct of_platform_driver myri_sbus_driver = {
static struct platform_driver myri_sbus_driver = {
.driver = {
.name = "myri",
.owner = THIS_MODULE,
@ -1172,12 +1172,12 @@ static struct of_platform_driver myri_sbus_driver = {
static int __init myri_sbus_init(void)
{
return of_register_platform_driver(&myri_sbus_driver);
return platform_driver_register(&myri_sbus_driver);
}
static void __exit myri_sbus_exit(void)
{
of_unregister_platform_driver(&myri_sbus_driver);
platform_driver_unregister(&myri_sbus_driver);
}
module_init(myri_sbus_init);

Some files were not shown because too many files have changed in this diff Show More