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

Commit 793218df authored by Grant Likely's avatar Grant Likely
Browse files

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



Get rid of users of of_platform_driver in drivers/serial.  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>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
parent d35fb641
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -553,8 +553,7 @@ static struct uart_driver grlib_apbuart_driver = {
/* OF Platform Driver                                                       */
/* ======================================================================== */

static int __devinit apbuart_probe(struct platform_device *op,
				   const struct of_device_id *match)
static int __devinit apbuart_probe(struct platform_device *op)
{
	int i = -1;
	struct uart_port *port = NULL;
@@ -587,7 +586,7 @@ static struct of_device_id __initdata apbuart_match[] = {
	{},
};

static struct of_platform_driver grlib_apbuart_of_driver = {
static struct platform_driver grlib_apbuart_of_driver = {
	.probe = apbuart_probe,
	.driver = {
		.owner = THIS_MODULE,
@@ -676,10 +675,10 @@ static int __init grlib_apbuart_init(void)
		return ret;
	}

	ret = of_register_platform_driver(&grlib_apbuart_of_driver);
	ret = platform_driver_register(&grlib_apbuart_of_driver);
	if (ret) {
		printk(KERN_ERR
		       "%s: of_register_platform_driver failed (%i)\n",
		       "%s: platform_driver_register failed (%i)\n",
		       __FILE__, ret);
		uart_unregister_driver(&grlib_apbuart_driver);
		return ret;
@@ -697,7 +696,7 @@ static void __exit grlib_apbuart_exit(void)
				     &grlib_apbuart_ports[i]);

	uart_unregister_driver(&grlib_apbuart_driver);
	of_unregister_platform_driver(&grlib_apbuart_of_driver);
	platform_driver_unregister(&grlib_apbuart_of_driver);
}

module_init(grlib_apbuart_init);
+4 −5
Original line number Diff line number Diff line
@@ -1359,8 +1359,7 @@ static struct uart_driver cpm_reg = {

static int probe_index;

static int __devinit cpm_uart_probe(struct platform_device *ofdev,
                                    const struct of_device_id *match)
static int __devinit cpm_uart_probe(struct platform_device *ofdev)
{
	int index = probe_index++;
	struct uart_cpm_port *pinfo = &cpm_uart_ports[index];
@@ -1405,7 +1404,7 @@ static struct of_device_id cpm_uart_match[] = {
	{}
};

static struct of_platform_driver cpm_uart_driver = {
static struct platform_driver cpm_uart_driver = {
	.driver = {
		.name = "cpm_uart",
		.owner = THIS_MODULE,
@@ -1421,7 +1420,7 @@ static int __init cpm_uart_init(void)
	if (ret)
		return ret;

	ret = of_register_platform_driver(&cpm_uart_driver);
	ret = platform_driver_register(&cpm_uart_driver);
	if (ret)
		uart_unregister_driver(&cpm_reg);

@@ -1430,7 +1429,7 @@ static int __init cpm_uart_init(void)

static void __exit cpm_uart_exit(void)
{
	of_unregister_platform_driver(&cpm_uart_driver);
	platform_driver_unregister(&cpm_uart_driver);
	uart_unregister_driver(&cpm_reg);
}

+5 −8
Original line number Diff line number Diff line
@@ -1302,8 +1302,7 @@ static struct of_device_id mpc52xx_uart_of_match[] = {
	{},
};

static int __devinit
mpc52xx_uart_of_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit mpc52xx_uart_of_probe(struct platform_device *op)
{
	int idx = -1;
	unsigned int uartclk;
@@ -1311,8 +1310,6 @@ mpc52xx_uart_of_probe(struct platform_device *op, const struct of_device_id *mat
	struct resource res;
	int ret;

	dev_dbg(&op->dev, "mpc52xx_uart_probe(op=%p, match=%p)\n", op, match);

	/* Check validity & presence */
	for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++)
		if (mpc52xx_uart_nodes[idx] == op->dev.of_node)
@@ -1453,7 +1450,7 @@ mpc52xx_uart_of_enumerate(void)

MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match);

static struct of_platform_driver mpc52xx_uart_of_driver = {
static struct platform_driver mpc52xx_uart_of_driver = {
	.probe		= mpc52xx_uart_of_probe,
	.remove		= mpc52xx_uart_of_remove,
#ifdef CONFIG_PM
@@ -1497,9 +1494,9 @@ mpc52xx_uart_init(void)
			return ret;
	}

	ret = of_register_platform_driver(&mpc52xx_uart_of_driver);
	ret = platform_driver_register(&mpc52xx_uart_of_driver);
	if (ret) {
		printk(KERN_ERR "%s: of_register_platform_driver failed (%i)\n",
		printk(KERN_ERR "%s: platform_driver_register failed (%i)\n",
		       __FILE__, ret);
		uart_unregister_driver(&mpc52xx_uart_driver);
		return ret;
@@ -1514,7 +1511,7 @@ mpc52xx_uart_exit(void)
	if (psc_ops->fifoc_uninit)
		psc_ops->fifoc_uninit();

	of_unregister_platform_driver(&mpc52xx_uart_of_driver);
	platform_driver_unregister(&mpc52xx_uart_of_driver);
	uart_unregister_driver(&mpc52xx_uart_driver);
}

+8 −6
Original line number Diff line number Diff line
@@ -80,14 +80,16 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev,
/*
 * Try to register a serial port
 */
static int __devinit of_platform_serial_probe(struct platform_device *ofdev,
						const struct of_device_id *id)
static int __devinit of_platform_serial_probe(struct platform_device *ofdev)
{
	struct of_serial_info *info;
	struct uart_port port;
	int port_type;
	int ret;

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

	if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL))
		return -EBUSY;

@@ -95,7 +97,7 @@ static int __devinit of_platform_serial_probe(struct platform_device *ofdev,
	if (info == NULL)
		return -ENOMEM;

	port_type = (unsigned long)id->data;
	port_type = (unsigned long)ofdev->dev.of_match->data;
	ret = of_platform_serial_setup(ofdev, port_type, &port);
	if (ret)
		goto out;
@@ -174,7 +176,7 @@ static struct of_device_id __devinitdata of_platform_serial_table[] = {
	{ /* end of list */ },
};

static struct of_platform_driver of_platform_serial_driver = {
static struct platform_driver of_platform_serial_driver = {
	.driver = {
		.name = "of_serial",
		.owner = THIS_MODULE,
@@ -186,13 +188,13 @@ static struct of_platform_driver of_platform_serial_driver = {

static int __init of_platform_serial_init(void)
{
	return of_register_platform_driver(&of_platform_serial_driver);
	return platform_driver_register(&of_platform_serial_driver);
}
module_init(of_platform_serial_init);

static void __exit of_platform_serial_exit(void)
{
	return of_unregister_platform_driver(&of_platform_serial_driver);
	return platform_driver_unregister(&of_platform_serial_driver);
};
module_exit(of_platform_serial_exit);

+4 −4
Original line number Diff line number Diff line
@@ -519,7 +519,7 @@ static struct console sunhv_console = {
	.data	=	&sunhv_reg,
};

static int __devinit hv_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit hv_probe(struct platform_device *op)
{
	struct uart_port *port;
	unsigned long minor;
@@ -629,7 +629,7 @@ static const struct of_device_id hv_match[] = {
};
MODULE_DEVICE_TABLE(of, hv_match);

static struct of_platform_driver hv_driver = {
static struct platform_driver hv_driver = {
	.driver = {
		.name = "hv",
		.owner = THIS_MODULE,
@@ -644,12 +644,12 @@ static int __init sunhv_init(void)
	if (tlb_type != hypervisor)
		return -ENODEV;

	return of_register_platform_driver(&hv_driver);
	return platform_driver_register(&hv_driver);
}

static void __exit sunhv_exit(void)
{
	of_unregister_platform_driver(&hv_driver);
	platform_driver_unregister(&hv_driver);
}

module_init(sunhv_init);
Loading