[POWERPC] Prepare to remove of_platform_driver name
The name field of of_platform_driver is just copied into the included device_driver. By not overriding an already initialised device_driver name, we can convert the drivers over time to stop using the of_platform_driver name. Also we were not copying the owner field from of_platform_driver, so do the same with it. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
parent
7d6524f035
commit
cd6eed3718
@ -19,11 +19,11 @@
|
|||||||
#include <linux/mod_devicetable.h>
|
#include <linux/mod_devicetable.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
|
#include <linux/of_device.h>
|
||||||
|
#include <linux/of_platform.h>
|
||||||
|
|
||||||
#include <asm/errno.h>
|
#include <asm/errno.h>
|
||||||
#include <asm/dcr.h>
|
#include <asm/dcr.h>
|
||||||
#include <asm/of_device.h>
|
|
||||||
#include <asm/of_platform.h>
|
|
||||||
#include <asm/topology.h>
|
#include <asm/topology.h>
|
||||||
#include <asm/pci-bridge.h>
|
#include <asm/pci-bridge.h>
|
||||||
#include <asm/ppc-pci.h>
|
#include <asm/ppc-pci.h>
|
||||||
@ -70,7 +70,10 @@ postcore_initcall(of_bus_driver_init);
|
|||||||
int of_register_platform_driver(struct of_platform_driver *drv)
|
int of_register_platform_driver(struct of_platform_driver *drv)
|
||||||
{
|
{
|
||||||
/* initialize common driver fields */
|
/* initialize common driver fields */
|
||||||
drv->driver.name = drv->name;
|
if (!drv->driver.name)
|
||||||
|
drv->driver.name = drv->name;
|
||||||
|
if (!drv->driver.owner)
|
||||||
|
drv->driver.owner = drv->owner;
|
||||||
drv->driver.bus = &of_platform_bus_type;
|
drv->driver.bus = &of_platform_bus_type;
|
||||||
|
|
||||||
/* register with core */
|
/* register with core */
|
||||||
@ -385,9 +388,11 @@ static struct of_device_id of_pci_phb_ids[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct of_platform_driver of_pci_phb_driver = {
|
static struct of_platform_driver of_pci_phb_driver = {
|
||||||
.name = "of-pci",
|
.match_table = of_pci_phb_ids,
|
||||||
.match_table = of_pci_phb_ids,
|
.probe = of_pci_phb_probe,
|
||||||
.probe = of_pci_phb_probe,
|
.driver = {
|
||||||
|
.name = "of-pci",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static __init int of_pci_phb_init(void)
|
static __init int of_pci_phb_init(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user