Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d35fb641 authored by Grant Likely's avatar Grant Likely
Browse files

dt/usb: Eliminate users of of_platform_{,un}register_driver



Get rid of users of of_platform_driver in drivers/usb.  The
of_platform_{,un}register_driver functions are going away, so the
users need to be converted to using the platform_bus_type directly.

Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 28541d0f
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -2523,8 +2523,7 @@ static void qe_udc_release(struct device *dev)
}

/* Driver probe functions */
static int __devinit qe_udc_probe(struct platform_device *ofdev,
			const struct of_device_id *match)
static int __devinit qe_udc_probe(struct platform_device *ofdev)
{
	struct device_node *np = ofdev->dev.of_node;
	struct qe_ep *ep;
@@ -2532,6 +2531,9 @@ static int __devinit qe_udc_probe(struct platform_device *ofdev,
	unsigned int i;
	const void *prop;

	if (!ofdev->dev.of_match)
		return -EINVAL;

	prop = of_get_property(np, "mode", NULL);
	if (!prop || strcmp(prop, "peripheral"))
		return -ENODEV;
@@ -2543,7 +2545,7 @@ static int __devinit qe_udc_probe(struct platform_device *ofdev,
		return -ENOMEM;
	}

	udc_controller->soc_type = (unsigned long)match->data;
	udc_controller->soc_type = (unsigned long)ofdev->dev.of_match->data;
	udc_controller->usb_regs = of_iomap(np, 0);
	if (!udc_controller->usb_regs) {
		ret = -ENOMEM;
@@ -2768,7 +2770,7 @@ static const struct of_device_id qe_udc_match[] __devinitconst = {

MODULE_DEVICE_TABLE(of, qe_udc_match);

static struct of_platform_driver udc_driver = {
static struct platform_driver udc_driver = {
	.driver = {
		.name = (char *)driver_name,
		.owner = THIS_MODULE,
@@ -2786,12 +2788,12 @@ static int __init qe_udc_init(void)
{
	printk(KERN_INFO "%s: %s, %s\n", driver_name, driver_desc,
			DRIVER_VERSION);
	return of_register_platform_driver(&udc_driver);
	return platform_driver_register(&udc_driver);
}

static void __exit qe_udc_exit(void)
{
	of_unregister_platform_driver(&udc_driver);
	platform_driver_unregister(&udc_driver);
}

module_init(qe_udc_init);
+6 −6
Original line number Diff line number Diff line
@@ -1306,24 +1306,24 @@ static int __init ehci_hcd_init(void)
#endif

#ifdef OF_PLATFORM_DRIVER
	retval = of_register_platform_driver(&OF_PLATFORM_DRIVER);
	retval = platform_driver_register(&OF_PLATFORM_DRIVER);
	if (retval < 0)
		goto clean3;
#endif

#ifdef XILINX_OF_PLATFORM_DRIVER
	retval = of_register_platform_driver(&XILINX_OF_PLATFORM_DRIVER);
	retval = platform_driver_register(&XILINX_OF_PLATFORM_DRIVER);
	if (retval < 0)
		goto clean4;
#endif
	return retval;

#ifdef XILINX_OF_PLATFORM_DRIVER
	/* of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); */
	/* platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER); */
clean4:
#endif
#ifdef OF_PLATFORM_DRIVER
	of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
	platform_driver_unregister(&OF_PLATFORM_DRIVER);
clean3:
#endif
#ifdef PS3_SYSTEM_BUS_DRIVER
@@ -1351,10 +1351,10 @@ module_init(ehci_hcd_init);
static void __exit ehci_hcd_cleanup(void)
{
#ifdef XILINX_OF_PLATFORM_DRIVER
	of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER);
	platform_driver_unregister(&XILINX_OF_PLATFORM_DRIVER);
#endif
#ifdef OF_PLATFORM_DRIVER
	of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
	platform_driver_unregister(&OF_PLATFORM_DRIVER);
#endif
#ifdef PLATFORM_DRIVER
	platform_driver_unregister(&PLATFORM_DRIVER);
+3 −6
Original line number Diff line number Diff line
@@ -105,8 +105,7 @@ ppc44x_enable_bmt(struct device_node *dn)
}


static int __devinit
ehci_hcd_ppc_of_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit ehci_hcd_ppc_of_probe(struct platform_device *op)
{
	struct device_node *dn = op->dev.of_node;
	struct usb_hcd *hcd;
@@ -255,14 +254,12 @@ static int ehci_hcd_ppc_of_remove(struct platform_device *op)
}


static int ehci_hcd_ppc_of_shutdown(struct platform_device *op)
static void ehci_hcd_ppc_of_shutdown(struct platform_device *op)
{
	struct usb_hcd *hcd = dev_get_drvdata(&op->dev);

	if (hcd->driver->shutdown)
		hcd->driver->shutdown(hcd);

	return 0;
}


@@ -275,7 +272,7 @@ static const struct of_device_id ehci_hcd_ppc_of_match[] = {
MODULE_DEVICE_TABLE(of, ehci_hcd_ppc_of_match);


static struct of_platform_driver ehci_hcd_ppc_of_driver = {
static struct platform_driver ehci_hcd_ppc_of_driver = {
	.probe		= ehci_hcd_ppc_of_probe,
	.remove		= ehci_hcd_ppc_of_remove,
	.shutdown	= ehci_hcd_ppc_of_shutdown,
+2 −4
Original line number Diff line number Diff line
@@ -142,15 +142,13 @@ static const struct hc_driver ehci_xilinx_of_hc_driver = {
/**
 * ehci_hcd_xilinx_of_probe - Probe method for the USB host controller
 * @op:		pointer to the platform_device bound to the host controller
 * @match:	pointer to of_device_id structure, not used
 *
 * This function requests resources and sets up appropriate properties for the
 * host controller. Because the Xilinx USB host controller can be configured
 * as HS only or HS/FS only, it checks the configuration in the device tree
 * entry, and sets an appropriate value for hcd->has_tt.
 */
static int __devinit
ehci_hcd_xilinx_of_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit ehci_hcd_xilinx_of_probe(struct platform_device *op)
{
	struct device_node *dn = op->dev.of_node;
	struct usb_hcd *hcd;
@@ -288,7 +286,7 @@ static const struct of_device_id ehci_hcd_xilinx_of_match[] = {
};
MODULE_DEVICE_TABLE(of, ehci_hcd_xilinx_of_match);

static struct of_platform_driver ehci_hcd_xilinx_of_driver = {
static struct platform_driver ehci_hcd_xilinx_of_driver = {
	.probe		= ehci_hcd_xilinx_of_probe,
	.remove		= ehci_hcd_xilinx_of_remove,
	.shutdown	= ehci_hcd_xilinx_of_shutdown,
+4 −5
Original line number Diff line number Diff line
@@ -561,8 +561,7 @@ static const struct hc_driver fhci_driver = {
	.hub_control = fhci_hub_control,
};

static int __devinit of_fhci_probe(struct platform_device *ofdev,
				   const struct of_device_id *ofid)
static int __devinit of_fhci_probe(struct platform_device *ofdev)
{
	struct device *dev = &ofdev->dev;
	struct device_node *node = dev->of_node;
@@ -812,7 +811,7 @@ static const struct of_device_id of_fhci_match[] = {
};
MODULE_DEVICE_TABLE(of, of_fhci_match);

static struct of_platform_driver of_fhci_driver = {
static struct platform_driver of_fhci_driver = {
	.driver = {
		.name = "fsl,usb-fhci",
		.owner = THIS_MODULE,
@@ -824,13 +823,13 @@ static struct of_platform_driver of_fhci_driver = {

static int __init fhci_module_init(void)
{
	return of_register_platform_driver(&of_fhci_driver);
	return platform_driver_register(&of_fhci_driver);
}
module_init(fhci_module_init);

static void __exit fhci_module_exit(void)
{
	of_unregister_platform_driver(&of_fhci_driver);
	platform_driver_unregister(&of_fhci_driver);
}
module_exit(fhci_module_exit);

Loading