switch all platform_bus device/driver registering to platform_driver/device_register
now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
parent
c0620a4b50
commit
3c5327e660
|
@ -40,7 +40,7 @@ extra-y += barebox.lds
|
|||
|
||||
static int scb9328_console_init(void)
|
||||
{
|
||||
register_device(&scb9328_serial_device);
|
||||
platform_device_register(&scb9328_serial_device);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ static int nhk8815_devices_init(void)
|
|||
add_generic_device("smc91c111", DEVICE_ID_DYNAMIC, NULL, 0x34000300, 16,
|
||||
IORESOURCE_MEM, NULL);
|
||||
|
||||
register_device(&nhk8815_nand_device);
|
||||
platform_device_register(&nhk8815_nand_device);
|
||||
|
||||
armlinux_set_architecture(MACH_TYPE_NOMADIK);
|
||||
armlinux_set_bootparams((void *)(0x00000100));
|
||||
|
|
|
@ -141,7 +141,7 @@ static void pcm970_ide_init(void)
|
|||
/* Make PCMCIA bank0 valid */
|
||||
writel(readl(PCMCIA_POR(0)) | (1 << 29), PCMCIA_POR(0));
|
||||
|
||||
register_device(&pcm970_ide_device);
|
||||
platform_device_register(&pcm970_ide_device);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ static struct driver_d imx_gpt_driver = {
|
|||
|
||||
static int imx_gpt_init(void)
|
||||
{
|
||||
return register_driver(&imx_gpt_driver);
|
||||
return platform_driver_register(&imx_gpt_driver);
|
||||
}
|
||||
coredevice_initcall(imx_gpt_init);
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ static struct driver_d imx_gpio_driver = {
|
|||
|
||||
static int imx_gpio_add(void)
|
||||
{
|
||||
register_driver(&imx_gpio_driver);
|
||||
platform_driver_register(&imx_gpio_driver);
|
||||
return 0;
|
||||
}
|
||||
coredevice_initcall(imx_gpio_add);
|
||||
|
|
|
@ -295,7 +295,7 @@ static struct driver_d imx_iim_driver = {
|
|||
|
||||
static int imx_iim_init(void)
|
||||
{
|
||||
register_driver(&imx_iim_driver);
|
||||
platform_driver_register(&imx_iim_driver);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ static inline struct device_d *imx51_add_nand(struct imx_nand_platform_data *pda
|
|||
dev->id = DEVICE_ID_DYNAMIC;
|
||||
dev->platform_data = pdata;
|
||||
|
||||
register_device(dev);
|
||||
platform_device_register(dev);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ static inline struct device_d *imx53_add_nand(struct imx_nand_platform_data *pda
|
|||
dev->id = DEVICE_ID_DYNAMIC;
|
||||
dev->platform_data = pdata;
|
||||
|
||||
register_device(dev);
|
||||
platform_device_register(dev);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ static struct driver_d mxs_ocotp_driver = {
|
|||
|
||||
static int mxs_ocotp_init(void)
|
||||
{
|
||||
register_driver(&mxs_ocotp_driver);
|
||||
platform_driver_register(&mxs_ocotp_driver);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ static struct device_d my_little_device = {
|
|||
};
|
||||
static int my_board_devices_init(void) {
|
||||
/* Do Blah Blah Blah */
|
||||
return register_device(&my_little_device);
|
||||
return platform_device_register(&my_little_device);
|
||||
}
|
||||
|
||||
device_initcall(my_board_devices_init);
|
||||
|
|
|
@ -151,7 +151,6 @@ static struct driver_d omap_gpio_driver = {
|
|||
|
||||
static int omap_gpio_add(void)
|
||||
{
|
||||
register_driver(&omap_gpio_driver);
|
||||
return 0;
|
||||
return platform_driver_register(&omap_gpio_driver);
|
||||
}
|
||||
coredevice_initcall(omap_gpio_add);
|
||||
|
|
|
@ -37,7 +37,7 @@ static int generic_devices_init(void)
|
|||
add_cfi_flash_device(DEVICE_ID_DYNAMIC, NIOS_SOPC_FLASH_BASE, NIOS_SOPC_FLASH_SIZE, 0);
|
||||
add_mem_device("ram0", NIOS_SOPC_MEMORY_BASE, NIOS_SOPC_MEMORY_SIZE,
|
||||
IORESOURCE_MEM_WRITEABLE);
|
||||
register_device(&mac_dev);
|
||||
platform_device_register(&mac_dev);
|
||||
/*register_device(&epcs_flash_device);*/
|
||||
|
||||
devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self0");
|
||||
|
|
|
@ -44,7 +44,7 @@ static struct device_d sdl_device = {
|
|||
|
||||
static int devices_init(void)
|
||||
{
|
||||
register_device(&tap_device);
|
||||
platform_device_register(&tap_device);
|
||||
|
||||
if (sdl_xres)
|
||||
mode.xres = sdl_xres;
|
||||
|
@ -52,7 +52,7 @@ static int devices_init(void)
|
|||
if (sdl_yres)
|
||||
mode.yres = sdl_yres;
|
||||
|
||||
register_device(&sdl_device);
|
||||
platform_device_register(&sdl_device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ static int sandbox_device_init(void)
|
|||
/* reset the list_head before registering for real */
|
||||
dev->list.prev = NULL;
|
||||
dev->list.next = NULL;
|
||||
register_device(dev);
|
||||
platform_device_register(dev);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -92,7 +92,7 @@ static struct driver_d hf_drv = {
|
|||
|
||||
static int hf_init(void)
|
||||
{
|
||||
return register_driver(&hf_drv);
|
||||
return platform_driver_register(&hf_drv);
|
||||
}
|
||||
|
||||
device_initcall(hf_init);
|
||||
|
|
|
@ -614,7 +614,7 @@ static int mem_init(void)
|
|||
}
|
||||
|
||||
add_mem_device("mem", 0, ~0, IORESOURCE_MEM_WRITEABLE);
|
||||
register_driver(&mem_drv);
|
||||
platform_driver_register(&mem_drv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ int console_register(struct console_device *newcdev)
|
|||
strcpy(dev->name, "cs");
|
||||
if (newcdev->dev)
|
||||
dev_add_child(newcdev->dev, dev);
|
||||
register_device(dev);
|
||||
platform_device_register(dev);
|
||||
|
||||
if (newcdev->setbrg) {
|
||||
dev_add_param(dev, "baudrate", console_baudrate_set, NULL, 0);
|
||||
|
|
|
@ -295,7 +295,7 @@ static int biosdisk_init(void)
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
register_driver(&biosdisk_driver);
|
||||
platform_driver_register(&biosdisk_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ static struct driver_d platform_ide_driver = {
|
|||
|
||||
static int platform_ide_init(void)
|
||||
{
|
||||
return register_driver(&platform_ide_driver);
|
||||
return platform_driver_register(&platform_ide_driver);
|
||||
}
|
||||
|
||||
device_initcall(platform_ide_init);
|
||||
|
|
|
@ -111,28 +111,17 @@ int register_device(struct device_d *new_device)
|
|||
|
||||
debug ("register_device: %s\n", dev_name(new_device));
|
||||
|
||||
if (!new_device->bus)
|
||||
new_device->bus = &platform_bus;
|
||||
|
||||
if (new_device->bus == &platform_bus && new_device->resource) {
|
||||
struct device_d *dev;
|
||||
|
||||
bus_for_each_device(new_device->bus, dev) {
|
||||
if (!dev->resource)
|
||||
continue;
|
||||
if (dev->resource->start == new_device->resource->start) {
|
||||
return -EBUSY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list_add_tail(&new_device->list, &device_list);
|
||||
list_add_tail(&new_device->bus_list, &new_device->bus->device_list);
|
||||
INIT_LIST_HEAD(&new_device->children);
|
||||
INIT_LIST_HEAD(&new_device->cdevs);
|
||||
INIT_LIST_HEAD(&new_device->parameters);
|
||||
INIT_LIST_HEAD(&new_device->active);
|
||||
|
||||
if (!new_device->bus)
|
||||
return 0;
|
||||
|
||||
list_add_tail(&new_device->bus_list, &new_device->bus->device_list);
|
||||
|
||||
bus_for_each_driver(new_device->bus, drv) {
|
||||
if (!match(drv, new_device))
|
||||
break;
|
||||
|
@ -213,10 +202,7 @@ int register_driver(struct driver_d *drv)
|
|||
|
||||
debug("register_driver: %s\n", drv->name);
|
||||
|
||||
if (!drv->bus) {
|
||||
// pr_err("driver %s has no bus type associated. Needs fixup\n", drv->name);
|
||||
drv->bus = &platform_bus;
|
||||
}
|
||||
BUG_ON(!drv->bus);
|
||||
|
||||
list_add_tail(&drv->list, &driver_list);
|
||||
list_add_tail(&drv->bus_list, &drv->bus->driver_list);
|
||||
|
|
|
@ -55,6 +55,32 @@ static void platform_remove(struct device_d *dev)
|
|||
dev->driver->remove(dev);
|
||||
}
|
||||
|
||||
int platform_driver_register(struct driver_d *drv)
|
||||
{
|
||||
drv->bus = &platform_bus;
|
||||
|
||||
return register_driver(drv);
|
||||
}
|
||||
|
||||
int platform_device_register(struct device_d *new_device)
|
||||
{
|
||||
new_device->bus = &platform_bus;
|
||||
|
||||
if (new_device->resource) {
|
||||
struct device_d *dev;
|
||||
|
||||
bus_for_each_device(new_device->bus, dev) {
|
||||
if (!dev->resource)
|
||||
continue;
|
||||
if (dev->resource->start == new_device->resource->start) {
|
||||
return -EBUSY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return register_device(new_device);
|
||||
}
|
||||
|
||||
struct bus_type platform_bus = {
|
||||
.name = "platform",
|
||||
.match = platform_match,
|
||||
|
|
|
@ -59,7 +59,7 @@ struct device_d *add_generic_device_res(const char* devname, int id,
|
|||
dev->resource = res;
|
||||
dev->num_resources = nb;
|
||||
|
||||
register_device(dev);
|
||||
platform_device_register(dev);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
|
|
@ -156,6 +156,6 @@ static struct driver_d stmpe_gpio_driver = {
|
|||
|
||||
static int stmpe_gpio_add(void)
|
||||
{
|
||||
return register_driver(&stmpe_gpio_driver);
|
||||
return platform_driver_register(&stmpe_gpio_driver);
|
||||
}
|
||||
coredevice_initcall(stmpe_gpio_add);
|
||||
|
|
|
@ -573,6 +573,6 @@ static struct driver_d i2c_fsl_driver = {
|
|||
|
||||
static int __init i2c_adap_fsl_init(void)
|
||||
{
|
||||
return register_driver(&i2c_fsl_driver);
|
||||
return platform_driver_register(&i2c_fsl_driver);
|
||||
}
|
||||
device_initcall(i2c_adap_fsl_init);
|
||||
|
|
|
@ -864,7 +864,7 @@ static struct driver_d omap_i2c_driver = {
|
|||
/* I2C may be needed to bring up other drivers */
|
||||
static int __init omap_i2c_init_driver(void)
|
||||
{
|
||||
return register_driver(&omap_i2c_driver);
|
||||
return platform_driver_register(&omap_i2c_driver);
|
||||
}
|
||||
device_initcall(omap_i2c_init_driver);
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ static struct driver_d gpio_keys_driver = {
|
|||
|
||||
static int gpio_keys_init(void)
|
||||
{
|
||||
register_driver(&gpio_keys_driver);
|
||||
platform_driver_register(&gpio_keys_driver);
|
||||
return 0;
|
||||
}
|
||||
device_initcall(gpio_keys_init);
|
||||
|
|
|
@ -457,7 +457,7 @@ static struct driver_d imx_keypad_driver = {
|
|||
|
||||
static int imx_keypad_init(void)
|
||||
{
|
||||
register_driver(&imx_keypad_driver);
|
||||
platform_driver_register(&imx_keypad_driver);
|
||||
return 0;
|
||||
}
|
||||
device_initcall(imx_keypad_init);
|
||||
|
|
|
@ -494,7 +494,7 @@ static struct driver_d atmel_mci_driver = {
|
|||
|
||||
static int atmel_mci_init_driver(void)
|
||||
{
|
||||
register_driver(&atmel_mci_driver);
|
||||
platform_driver_register(&atmel_mci_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -583,7 +583,7 @@ static struct driver_d fsl_esdhc_driver = {
|
|||
|
||||
static int fsl_esdhc_init_driver(void)
|
||||
{
|
||||
register_driver(&fsl_esdhc_driver);
|
||||
platform_driver_register(&fsl_esdhc_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -518,7 +518,7 @@ static struct driver_d mxcmci_driver = {
|
|||
|
||||
static int mxcmci_init_driver(void)
|
||||
{
|
||||
register_driver(&mxcmci_driver);
|
||||
platform_driver_register(&mxcmci_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1497,7 +1497,7 @@ static struct driver_d mci_driver = {
|
|||
static int mci_init(void)
|
||||
{
|
||||
sector_buf = xmemalign(32, 512);
|
||||
return register_driver(&mci_driver);
|
||||
return platform_driver_register(&mci_driver);
|
||||
}
|
||||
|
||||
device_initcall(mci_init);
|
||||
|
@ -1516,5 +1516,5 @@ int mci_register(struct mci_host *host)
|
|||
mci_dev->platform_data = host;
|
||||
dev_add_child(host->hw_dev, mci_dev);
|
||||
|
||||
return register_device(mci_dev);
|
||||
return platform_device_register(mci_dev);
|
||||
}
|
||||
|
|
|
@ -763,7 +763,7 @@ static struct driver_d mxs_mci_driver = {
|
|||
|
||||
static int mxs_mci_init_driver(void)
|
||||
{
|
||||
register_driver(&mxs_mci_driver);
|
||||
platform_driver_register(&mxs_mci_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -599,7 +599,7 @@ static struct driver_d omap_mmc_driver = {
|
|||
|
||||
static int omap_mmc_init_driver(void)
|
||||
{
|
||||
register_driver(&omap_mmc_driver);
|
||||
platform_driver_register(&omap_mmc_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -381,7 +381,7 @@ static struct driver_d pxamci_driver = {
|
|||
|
||||
static int __init pxamci_init_driver(void)
|
||||
{
|
||||
register_driver(&pxamci_driver);
|
||||
platform_driver_register(&pxamci_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -770,7 +770,7 @@ static struct driver_d s3c_mci_driver = {
|
|||
|
||||
static int s3c_mci_init_driver(void)
|
||||
{
|
||||
register_driver(&s3c_mci_driver);
|
||||
platform_driver_register(&s3c_mci_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -381,7 +381,7 @@ static struct driver_d jtag_driver = {
|
|||
|
||||
static int jtag_module_init(void)
|
||||
{
|
||||
return register_driver(&jtag_driver);
|
||||
return platform_driver_register(&jtag_driver);
|
||||
}
|
||||
|
||||
device_initcall(jtag_module_init);
|
||||
|
|
|
@ -224,7 +224,7 @@ int add_mtd_device(struct mtd_info *mtd, char *devname)
|
|||
devname = "mtd";
|
||||
strcpy(mtd->class_dev.name, devname);
|
||||
mtd->class_dev.id = DEVICE_ID_DYNAMIC;
|
||||
register_device(&mtd->class_dev);
|
||||
platform_device_register(&mtd->class_dev);
|
||||
|
||||
mtd->cdev.ops = &mtd_ops;
|
||||
mtd->cdev.size = mtd->size;
|
||||
|
|
|
@ -1201,7 +1201,7 @@ static struct driver_d g3_driver = {
|
|||
|
||||
static int __init docg3_init(void)
|
||||
{
|
||||
return register_driver(&g3_driver);
|
||||
return platform_driver_register(&g3_driver);
|
||||
}
|
||||
|
||||
device_initcall(docg3_init);
|
||||
|
|
|
@ -484,7 +484,7 @@ static struct driver_d atmel_nand_driver = {
|
|||
|
||||
static int __init atmel_nand_init(void)
|
||||
{
|
||||
return register_driver(&atmel_nand_driver);
|
||||
return platform_driver_register(&atmel_nand_driver);
|
||||
}
|
||||
|
||||
device_initcall(atmel_nand_init);
|
||||
|
|
|
@ -1288,7 +1288,7 @@ static struct driver_d imx_nand_driver = {
|
|||
*/
|
||||
static int __init imx_nand_init(void)
|
||||
{
|
||||
return register_driver(&imx_nand_driver);
|
||||
return platform_driver_register(&imx_nand_driver);
|
||||
}
|
||||
|
||||
device_initcall(imx_nand_init);
|
||||
|
|
|
@ -1248,7 +1248,7 @@ static struct driver_d mxs_nand_driver = {
|
|||
|
||||
static int __init mxs_nand_init(void)
|
||||
{
|
||||
return register_driver(&mxs_nand_driver);
|
||||
return platform_driver_register(&mxs_nand_driver);
|
||||
}
|
||||
|
||||
device_initcall(mxs_nand_init);
|
||||
|
|
|
@ -1084,7 +1084,7 @@ static struct driver_d gpmc_nand_driver = {
|
|||
|
||||
static int gpmc_nand_init(void)
|
||||
{
|
||||
return register_driver(&gpmc_nand_driver);
|
||||
return platform_driver_register(&gpmc_nand_driver);
|
||||
}
|
||||
|
||||
device_initcall(gpmc_nand_init);
|
||||
|
|
|
@ -651,7 +651,7 @@ BAREBOX_CMD_END
|
|||
*/
|
||||
static int __init s3c24x0_nand_init(void)
|
||||
{
|
||||
return register_driver(&s3c24x0_nand_driver);
|
||||
return platform_driver_register(&s3c24x0_nand_driver);
|
||||
}
|
||||
|
||||
device_initcall(s3c24x0_nand_init);
|
||||
|
|
|
@ -237,7 +237,7 @@ static struct driver_d nomadik_nand_driver = {
|
|||
static int __init nand_nomadik_init(void)
|
||||
{
|
||||
pr_info("Nomadik NAND driver\n");
|
||||
return register_driver(&nomadik_nand_driver);
|
||||
return platform_driver_register(&nomadik_nand_driver);
|
||||
}
|
||||
|
||||
device_initcall(nand_nomadik_init);
|
||||
|
|
|
@ -560,7 +560,7 @@ static struct driver_d altera_tse_driver = {
|
|||
|
||||
static int tse_init(void)
|
||||
{
|
||||
register_driver(&altera_tse_driver);
|
||||
platform_driver_register(&altera_tse_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ static struct driver_d at91_ether_driver = {
|
|||
|
||||
static int at91_ether_driver_init(void)
|
||||
{
|
||||
register_driver(&at91_ether_driver);
|
||||
platform_driver_register(&at91_ether_driver);
|
||||
return 0;
|
||||
}
|
||||
device_initcall(at91_ether_driver_init);
|
||||
|
|
|
@ -471,7 +471,7 @@ static struct driver_d cs8900_driver = {
|
|||
|
||||
static int cs8900_init(void)
|
||||
{
|
||||
register_driver(&cs8900_driver);
|
||||
platform_driver_register(&cs8900_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -611,7 +611,7 @@ static struct driver_d davinci_emac_driver = {
|
|||
|
||||
static int davinci_emac_register(void)
|
||||
{
|
||||
register_driver(&davinci_emac_driver);
|
||||
platform_driver_register(&davinci_emac_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -434,7 +434,7 @@ static struct driver_d dwc_ether_driver = {
|
|||
|
||||
static int dwc_ether_driver_init(void)
|
||||
{
|
||||
register_driver(&dwc_ether_driver);
|
||||
platform_driver_register(&dwc_ether_driver);
|
||||
return 0;
|
||||
}
|
||||
device_initcall(dwc_ether_driver_init);
|
||||
|
|
|
@ -783,7 +783,7 @@ static struct driver_d dm9k_driver = {
|
|||
|
||||
static int dm9k_init(void)
|
||||
{
|
||||
register_driver(&dm9k_driver);
|
||||
platform_driver_register(&dm9k_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -666,7 +666,7 @@ static struct driver_d ep93xx_eth_driver = {
|
|||
|
||||
static int ep93xx_eth_init(void)
|
||||
{
|
||||
register_driver(&ep93xx_eth_driver);
|
||||
platform_driver_register(&ep93xx_eth_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -702,8 +702,8 @@ static struct driver_d fec_driver = {
|
|||
|
||||
static int fec_register(void)
|
||||
{
|
||||
register_driver(&fec_driver);
|
||||
return 0;
|
||||
platform_driver_register(&fec_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
device_initcall(fec_register);
|
||||
|
|
|
@ -720,7 +720,7 @@ static struct driver_d mpc5xxx_driver = {
|
|||
|
||||
static int mpc5xxx_fec_register(void)
|
||||
{
|
||||
register_driver(&mpc5xxx_driver);
|
||||
platform_driver_register(&mpc5xxx_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -532,7 +532,7 @@ static struct driver_d gfar_eth_driver = {
|
|||
|
||||
static int gfar_eth_init(void)
|
||||
{
|
||||
register_driver(&gfar_eth_driver);
|
||||
platform_driver_register(&gfar_eth_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -876,7 +876,7 @@ static struct driver_d ks8851_driver = {
|
|||
|
||||
static int ks8851_init(void)
|
||||
{
|
||||
register_driver(&ks8851_driver);
|
||||
platform_driver_register(&ks8851_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -494,7 +494,7 @@ static struct driver_d macb_driver = {
|
|||
static int macb_driver_init(void)
|
||||
{
|
||||
debug("%s\n", __func__);
|
||||
register_driver(&macb_driver);
|
||||
platform_driver_register(&macb_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -279,7 +279,7 @@ static struct driver_d netx_eth_driver = {
|
|||
|
||||
static int netx_eth_init(void)
|
||||
{
|
||||
register_driver(&netx_eth_driver);
|
||||
platform_driver_register(&netx_eth_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1322,7 +1322,7 @@ static struct driver_d smc91c111_driver = {
|
|||
|
||||
static int smc91c111_init(void)
|
||||
{
|
||||
register_driver(&smc91c111_driver);
|
||||
platform_driver_register(&smc91c111_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -552,7 +552,7 @@ static struct driver_d smc911x_driver = {
|
|||
|
||||
static int smc911x_init(void)
|
||||
{
|
||||
register_driver(&smc911x_driver);
|
||||
platform_driver_register(&smc911x_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ static struct driver_d tap_driver = {
|
|||
|
||||
static int tap_init(void)
|
||||
{
|
||||
register_driver(&tap_driver);
|
||||
platform_driver_register(&tap_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1034,7 +1034,7 @@ static struct driver_d cfi_driver = {
|
|||
|
||||
static int cfi_init(void)
|
||||
{
|
||||
return register_driver(&cfi_driver);
|
||||
return platform_driver_register(&cfi_driver);
|
||||
}
|
||||
|
||||
device_initcall(cfi_init);
|
||||
|
|
|
@ -604,7 +604,7 @@ static struct device_d *add_of_device(struct device_node *node)
|
|||
|
||||
debug("register device 0x%08x\n", node->resource[0].start);
|
||||
|
||||
register_device(dev);
|
||||
platform_device_register(dev);
|
||||
|
||||
free(name);
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ static struct driver_d pxa_pwm_driver = {
|
|||
static int __init pxa_pwm_init_driver(void)
|
||||
{
|
||||
CKEN &= ~CKEN_PWM0 & ~CKEN_PWM1;
|
||||
register_driver(&pxa_pwm_driver);
|
||||
platform_driver_register(&pxa_pwm_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -157,8 +157,8 @@ static struct device_d arm_dcc_device = {
|
|||
|
||||
static int arm_dcc_init(void)
|
||||
{
|
||||
register_device(&arm_dcc_device);
|
||||
register_driver(&arm_dcc_driver);
|
||||
platform_device_register(&arm_dcc_device);
|
||||
platform_driver_register(&arm_dcc_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -421,7 +421,7 @@ static struct driver_d atmel_serial_driver = {
|
|||
|
||||
static int atmel_serial_init(void)
|
||||
{
|
||||
register_driver(&atmel_serial_driver);
|
||||
platform_driver_register(&atmel_serial_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ static struct driver_d linux_console_driver = {
|
|||
|
||||
static int console_init(void)
|
||||
{
|
||||
return register_driver(&linux_console_driver);
|
||||
return platform_driver_register(&linux_console_driver);
|
||||
}
|
||||
|
||||
console_initcall(console_init);
|
||||
|
|
|
@ -104,7 +104,7 @@ static struct driver_d altera_serial_driver = {
|
|||
|
||||
static int altera_serial_init(void)
|
||||
{
|
||||
return register_driver(&altera_serial_driver);
|
||||
return platform_driver_register(&altera_serial_driver);
|
||||
}
|
||||
|
||||
console_initcall(altera_serial_init);
|
||||
|
|
|
@ -109,7 +109,7 @@ static struct driver_d altera_serial_jtag_driver = {
|
|||
|
||||
static int altera_serial_jtag_init(void)
|
||||
{
|
||||
return register_driver(&altera_serial_jtag_driver);
|
||||
return platform_driver_register(&altera_serial_jtag_driver);
|
||||
}
|
||||
|
||||
console_initcall(altera_serial_jtag_init);
|
||||
|
|
|
@ -133,7 +133,7 @@ static struct driver_d blackfin_serial_driver = {
|
|||
|
||||
static int blackfin_serial_init(void)
|
||||
{
|
||||
register_driver(&blackfin_serial_driver);
|
||||
platform_driver_register(&blackfin_serial_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -375,7 +375,7 @@ static struct driver_d imx_serial_driver = {
|
|||
|
||||
static int imx_serial_init(void)
|
||||
{
|
||||
register_driver(&imx_serial_driver);
|
||||
platform_driver_register(&imx_serial_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ static struct driver_d mpc5xxx_serial_driver = {
|
|||
|
||||
static int mpc5xxx_serial_register(void)
|
||||
{
|
||||
register_driver(&mpc5xxx_serial_driver);
|
||||
platform_driver_register(&mpc5xxx_serial_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ static struct driver_d netx_serial_driver = {
|
|||
|
||||
static int netx_serial_init(void)
|
||||
{
|
||||
register_driver(&netx_serial_driver);
|
||||
platform_driver_register(&netx_serial_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -266,11 +266,11 @@ static struct driver_d ns16550_serial_driver = {
|
|||
/**
|
||||
* @brief driver initialization function
|
||||
*
|
||||
* @return result of register_driver
|
||||
* @return result of platform_driver_register
|
||||
*/
|
||||
static int ns16550_serial_init(void)
|
||||
{
|
||||
return register_driver(&ns16550_serial_driver);
|
||||
return platform_driver_register(&ns16550_serial_driver);
|
||||
}
|
||||
|
||||
console_initcall(ns16550_serial_init);
|
||||
|
|
|
@ -160,7 +160,7 @@ static struct driver_d pl010_driver = {
|
|||
|
||||
static int pl010_init(void)
|
||||
{
|
||||
register_driver(&pl010_driver);
|
||||
platform_driver_register(&pl010_driver);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ static struct driver_d pxa_serial_driver = {
|
|||
|
||||
static int pxa_serial_init(void)
|
||||
{
|
||||
return register_driver(&pxa_serial_driver);
|
||||
return platform_driver_register(&pxa_serial_driver);
|
||||
}
|
||||
|
||||
console_initcall(pxa_serial_init);
|
||||
|
|
|
@ -216,7 +216,7 @@ static struct driver_d s3c_serial_driver = {
|
|||
|
||||
static int s3c_serial_init(void)
|
||||
{
|
||||
register_driver(&s3c_serial_driver);
|
||||
platform_driver_register(&s3c_serial_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ static struct driver_d stm_serial_driver = {
|
|||
|
||||
static int stm_serial_init(void)
|
||||
{
|
||||
register_driver(&stm_serial_driver);
|
||||
platform_driver_register(&stm_serial_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ static struct driver_d altera_spi_driver = {
|
|||
|
||||
static int altera_spi_driver_init(void)
|
||||
{
|
||||
return register_driver(&altera_spi_driver);
|
||||
return platform_driver_register(&altera_spi_driver);
|
||||
}
|
||||
|
||||
device_initcall(altera_spi_driver_init);
|
||||
|
|
|
@ -312,7 +312,7 @@ static struct driver_d atmel_spi_driver = {
|
|||
|
||||
static int atmel_spi_init(void)
|
||||
{
|
||||
register_driver(&atmel_spi_driver);
|
||||
platform_driver_register(&atmel_spi_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -584,7 +584,7 @@ static struct driver_d imx_spi_driver = {
|
|||
|
||||
static int imx_spi_init(void)
|
||||
{
|
||||
register_driver(&imx_spi_driver);
|
||||
platform_driver_register(&imx_spi_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -393,7 +393,7 @@ static struct driver_d omap3_spi_driver = {
|
|||
|
||||
static int omap3_spi_init(void)
|
||||
{
|
||||
return register_driver(&omap3_spi_driver);
|
||||
return platform_driver_register(&omap3_spi_driver);
|
||||
}
|
||||
|
||||
device_initcall(omap3_spi_init);
|
||||
|
|
|
@ -1533,7 +1533,7 @@ static struct driver_d at91_udc_driver = {
|
|||
|
||||
static int at91_udc_init(void)
|
||||
{
|
||||
register_driver(&at91_udc_driver);
|
||||
platform_driver_register(&at91_udc_driver);
|
||||
return 0;
|
||||
}
|
||||
device_initcall(at91_udc_init);
|
||||
|
|
|
@ -2333,7 +2333,7 @@ static struct driver_d fsl_udc_driver = {
|
|||
|
||||
static int fsl_udc_init(void)
|
||||
{
|
||||
register_driver(&fsl_udc_driver);
|
||||
platform_driver_register(&fsl_udc_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1515,7 +1515,7 @@ static struct driver_d udc_driver = {
|
|||
|
||||
static int __init pxa27x_udc_init(void)
|
||||
{
|
||||
register_driver(&udc_driver);
|
||||
platform_driver_register(&udc_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -868,7 +868,7 @@ static struct driver_d ehci_driver = {
|
|||
|
||||
static int ehcil_init(void)
|
||||
{
|
||||
register_driver(&ehci_driver);
|
||||
platform_driver_register(&ehci_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ static struct driver_d at91_ohci_driver = {
|
|||
|
||||
static int at91_ohci_init(void)
|
||||
{
|
||||
register_driver(&at91_ohci_driver);
|
||||
platform_driver_register(&at91_ohci_driver);
|
||||
return 0;
|
||||
}
|
||||
device_initcall(at91_ohci_init);
|
||||
|
|
|
@ -1822,7 +1822,7 @@ static struct driver_d ohci_driver = {
|
|||
|
||||
static int ohcil_init(void)
|
||||
{
|
||||
register_driver(&ohci_driver);
|
||||
platform_driver_register(&ohci_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1036,7 +1036,7 @@ static struct driver_d imx3fb_driver = {
|
|||
|
||||
static int imx3fb_init(void)
|
||||
{
|
||||
return register_driver(&imx3fb_driver);
|
||||
return platform_driver_register(&imx3fb_driver);
|
||||
}
|
||||
|
||||
device_initcall(imx3fb_init);
|
||||
|
|
|
@ -614,7 +614,7 @@ static struct driver_d imxfb_driver = {
|
|||
|
||||
static int imxfb_init(void)
|
||||
{
|
||||
return register_driver(&imxfb_driver);
|
||||
return platform_driver_register(&imxfb_driver);
|
||||
}
|
||||
|
||||
device_initcall(imxfb_init);
|
||||
|
|
|
@ -548,7 +548,7 @@ static struct driver_d pxafb_driver = {
|
|||
|
||||
static int pxafb_init(void)
|
||||
{
|
||||
return register_driver(&pxafb_driver);
|
||||
return platform_driver_register(&pxafb_driver);
|
||||
}
|
||||
|
||||
device_initcall(pxafb_init);
|
||||
|
|
|
@ -409,7 +409,7 @@ static struct driver_d s3cfb_driver = {
|
|||
|
||||
static int s3cfb_init(void)
|
||||
{
|
||||
return register_driver(&s3cfb_driver);
|
||||
return platform_driver_register(&s3cfb_driver);
|
||||
}
|
||||
|
||||
device_initcall(s3cfb_init);
|
||||
|
|
|
@ -96,6 +96,6 @@ static struct driver_d sdlfb_driver = {
|
|||
|
||||
static int sdlfb_init(void)
|
||||
{
|
||||
return register_driver(&sdlfb_driver);
|
||||
return platform_driver_register(&sdlfb_driver);
|
||||
}
|
||||
device_initcall(sdlfb_init);
|
||||
|
|
|
@ -519,7 +519,7 @@ static struct driver_d stmfb_driver = {
|
|||
|
||||
static int stmfb_init(void)
|
||||
{
|
||||
return register_driver(&stmfb_driver);
|
||||
return platform_driver_register(&stmfb_driver);
|
||||
}
|
||||
|
||||
device_initcall(stmfb_init);
|
||||
|
|
|
@ -142,7 +142,7 @@ static struct driver_d imx28_wd_driver = {
|
|||
|
||||
static int imx28_wd_init(void)
|
||||
{
|
||||
register_driver(&imx28_wd_driver);
|
||||
platform_driver_register(&imx28_wd_driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -401,6 +401,9 @@ extern struct list_head bus_list;
|
|||
|
||||
extern struct bus_type platform_bus;
|
||||
|
||||
int platform_driver_register(struct driver_d *drv);
|
||||
int platform_device_register(struct device_d *new_device);
|
||||
|
||||
struct file_operations {
|
||||
/*! Called in response of reading from this device. Required */
|
||||
ssize_t (*read)(struct cdev*, void* buf, size_t count, loff_t offset, ulong flags);
|
||||
|
|
|
@ -261,7 +261,7 @@ int eth_register(struct eth_device *edev)
|
|||
if (edev->parent)
|
||||
dev_add_child(edev->parent, &edev->dev);
|
||||
|
||||
register_device(&edev->dev);
|
||||
platform_device_register(&edev->dev);
|
||||
|
||||
dev_add_param(dev, "ipaddr", eth_set_ipaddr, NULL, 0);
|
||||
dev_add_param(dev, "ethaddr", eth_set_ethaddr, NULL, 0);
|
||||
|
|
Loading…
Reference in New Issue