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

Commit 4018294b authored by Grant Likely's avatar Grant Likely
Browse files

of: Remove duplicate fields from of_platform_driver



.name, .match_table and .owner are duplicated in both of_platform_driver
and device_driver.  This patch is a removes the extra copies from struct
of_platform_driver and converts all users to the device_driver members.

This patch is a pretty mechanical change.  The usage model doesn't change
and if any drivers have been missed, or if anything has been fixed up
incorrectly, then it will fail with a compile time error, and the fixup
will be trivial.  This patch looks big and scary because it touches so
many files, but it should be pretty safe.

Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarSean MacLennan <smaclennan@pikatech.com>
parent 597b9d1e
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -201,9 +201,6 @@ static int ibmebus_create_devices(const struct of_device_id *matches)

int ibmebus_register_driver(struct of_platform_driver *drv)
{
	if (!drv->driver.of_match_table)
		drv->driver.of_match_table = drv->match_table;

	/* If the driver uses devices that ibmebus doesn't know, add them */
	ibmebus_create_devices(drv->driver.of_match_table);

+2 −1
Original line number Diff line number Diff line
@@ -306,10 +306,11 @@ static struct of_device_id of_pci_phb_ids[] = {
};

static struct of_platform_driver of_pci_phb_driver = {
	.match_table = of_pci_phb_ids,
	.probe = of_pci_phb_probe,
	.driver = {
		.name = "of-pci",
		.owner = THIS_MODULE,
		.of_match_table = of_pci_phb_ids,
	},
};

+10 −4
Original line number Diff line number Diff line
@@ -193,8 +193,11 @@ static const struct of_device_id mpc52xx_wkup_gpiochip_match[] = {
};

static struct of_platform_driver mpc52xx_wkup_gpiochip_driver = {
	.driver = {
		.name = "gpio_wkup",
	.match_table = mpc52xx_wkup_gpiochip_match,
		.owner = THIS_MODULE,
		.of_match_table = mpc52xx_wkup_gpiochip_match,
	},
	.probe = mpc52xx_wkup_gpiochip_probe,
	.remove = mpc52xx_gpiochip_remove,
};
@@ -349,8 +352,11 @@ static const struct of_device_id mpc52xx_simple_gpiochip_match[] = {
};

static struct of_platform_driver mpc52xx_simple_gpiochip_driver = {
	.driver = {
		.name = "gpio",
	.match_table = mpc52xx_simple_gpiochip_match,
		.owner = THIS_MODULE,
		.of_match_table = mpc52xx_simple_gpiochip_match,
	},
	.probe = mpc52xx_simple_gpiochip_probe,
	.remove = mpc52xx_gpiochip_remove,
};
+5 −2
Original line number Diff line number Diff line
@@ -784,8 +784,11 @@ static const struct of_device_id mpc52xx_gpt_match[] = {
};

static struct of_platform_driver mpc52xx_gpt_driver = {
	.driver = {
		.name = "mpc52xx-gpt",
	.match_table = mpc52xx_gpt_match,
		.owner = THIS_MODULE,
		.of_match_table = mpc52xx_gpt_match,
	},
	.probe = mpc52xx_gpt_probe,
	.remove = mpc52xx_gpt_remove,
};
+5 −3
Original line number Diff line number Diff line
@@ -537,9 +537,11 @@ static struct of_device_id mpc52xx_lpbfifo_match[] __devinitconst = {
};

static struct of_platform_driver mpc52xx_lpbfifo_driver = {
	.owner = THIS_MODULE,
	.driver = {
		.name = "mpc52xx-lpbfifo",
	.match_table = mpc52xx_lpbfifo_match,
		.owner = THIS_MODULE,
		.of_match_table = mpc52xx_lpbfifo_match,
	},
	.probe = mpc52xx_lpbfifo_probe,
	.remove = __devexit_p(mpc52xx_lpbfifo_remove),
};
Loading