usb: gadget: s3c2410_udc: use platform ids instead
This also fixes the error path: If the second device fails to register we never remove the first one. This is compile-tested only. I don't see any difference between those two. Maybe we should just use one name instead? Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>wifi-calibration
parent
86081d7be3
commit
513385a3cf
|
@ -2057,26 +2057,22 @@ static int s3c2410_udc_resume(struct platform_device *pdev)
|
||||||
#define s3c2410_udc_resume NULL
|
#define s3c2410_udc_resume NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct platform_driver udc_driver_2410 = {
|
static const struct platform_device_id s3c_udc_ids[] = {
|
||||||
.driver = {
|
{ "s3c2410-usbgadget", },
|
||||||
.name = "s3c2410-usbgadget",
|
{ "s3c2440-usbgadget", },
|
||||||
.owner = THIS_MODULE,
|
|
||||||
},
|
|
||||||
.probe = s3c2410_udc_probe,
|
|
||||||
.remove = s3c2410_udc_remove,
|
|
||||||
.suspend = s3c2410_udc_suspend,
|
|
||||||
.resume = s3c2410_udc_resume,
|
|
||||||
};
|
};
|
||||||
|
MODULE_DEVICE_TABLE(platform, s3c_udc_ids);
|
||||||
|
|
||||||
static struct platform_driver udc_driver_2440 = {
|
static struct platform_driver udc_driver_24x0 = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "s3c2440-usbgadget",
|
.name = "s3c24x0-usbgadget",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
},
|
},
|
||||||
.probe = s3c2410_udc_probe,
|
.probe = s3c2410_udc_probe,
|
||||||
.remove = s3c2410_udc_remove,
|
.remove = s3c2410_udc_remove,
|
||||||
.suspend = s3c2410_udc_suspend,
|
.suspend = s3c2410_udc_suspend,
|
||||||
.resume = s3c2410_udc_resume,
|
.resume = s3c2410_udc_resume,
|
||||||
|
.id_table = s3c_udc_ids,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init udc_init(void)
|
static int __init udc_init(void)
|
||||||
|
@ -2092,11 +2088,7 @@ static int __init udc_init(void)
|
||||||
s3c2410_udc_debugfs_root = NULL;
|
s3c2410_udc_debugfs_root = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = platform_driver_register(&udc_driver_2410);
|
retval = platform_driver_register(&udc_driver_24x0);
|
||||||
if (retval)
|
|
||||||
goto err;
|
|
||||||
|
|
||||||
retval = platform_driver_register(&udc_driver_2440);
|
|
||||||
if (retval)
|
if (retval)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
@ -2109,8 +2101,7 @@ err:
|
||||||
|
|
||||||
static void __exit udc_exit(void)
|
static void __exit udc_exit(void)
|
||||||
{
|
{
|
||||||
platform_driver_unregister(&udc_driver_2410);
|
platform_driver_unregister(&udc_driver_24x0);
|
||||||
platform_driver_unregister(&udc_driver_2440);
|
|
||||||
debugfs_remove(s3c2410_udc_debugfs_root);
|
debugfs_remove(s3c2410_udc_debugfs_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2121,5 +2112,3 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
|
||||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||||
MODULE_VERSION(DRIVER_VERSION);
|
MODULE_VERSION(DRIVER_VERSION);
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
MODULE_ALIAS("platform:s3c2410-usbgadget");
|
|
||||||
MODULE_ALIAS("platform:s3c2440-usbgadget");
|
|
||||||
|
|
Loading…
Reference in New Issue