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

Commit c2cdf6ab authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt
Browse files

powerpc/macio: Fix probing of macio devices by using the right of match table



Grant patches added an of mach table to struct device_driver. However,
while he changed the macio device code to use that, he left the match
table pointer in struct macio_driver and didn't update drivers to use
the "new" one, thus breaking the probing.

This completes the change by moving all drivers to setup the "new"
one, removing all traces of the old one, and while at it (since it
changes the exact same locations), I also remove two other duplicates
from struct driver which are the name and owner fields.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 79905ad5
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -123,10 +123,6 @@ static inline struct pci_dev *macio_get_pci_dev(struct macio_dev *mdev)
 */
struct macio_driver
{
	char			*name;
	struct of_device_id	*match_table;
	struct module		*owner;

	int	(*probe)(struct macio_dev* dev, const struct of_device_id *match);
	int	(*remove)(struct macio_dev* dev);

+5 −5
Original line number Diff line number Diff line
@@ -1355,8 +1355,11 @@ static struct of_device_id pata_macio_match[] =

static struct macio_driver pata_macio_driver =
{
	.driver = {
		.name 		= "pata-macio",
	.match_table	= pata_macio_match,
		.owner		= THIS_MODULE,
		.of_match_table	= pata_macio_match,
	},
	.probe		= pata_macio_attach,
	.remove		= pata_macio_detach,
#ifdef CONFIG_PM
@@ -1366,9 +1369,6 @@ static struct macio_driver pata_macio_driver =
#ifdef CONFIG_PMAC_MEDIABAY
	.mediabay_event	= pata_macio_mb_event,
#endif
	.driver = {
		.owner		= THIS_MODULE,
	},
};

static const struct pci_device_id pata_macio_pci_match[] = {
+4 −2
Original line number Diff line number Diff line
@@ -1159,8 +1159,10 @@ static struct of_device_id swim3_match[] =

static struct macio_driver swim3_driver =
{
	.driver = {
		.name 		= "swim3",
	.match_table	= swim3_match,
		.of_match_table	= swim3_match,
	},
	.probe		= swim3_attach,
#if 0
	.suspend	= swim3_suspend,
+5 −2
Original line number Diff line number Diff line
@@ -1400,8 +1400,11 @@ static struct of_device_id pmac_ide_macio_match[] =

static struct macio_driver pmac_ide_macio_driver = 
{
	.driver = {
		.name 		= "ide-pmac",
	.match_table	= pmac_ide_macio_match,
		.owner		= THIS_MODULE,
		.of_match_table	= pmac_ide_macio_match,
	},
	.probe		= pmac_ide_macio_attach,
	.suspend	= pmac_ide_macio_suspend,
	.resume		= pmac_ide_macio_resume,
+0 −1
Original line number Diff line number Diff line
@@ -526,7 +526,6 @@ static void macio_pci_add_devices(struct macio_chip *chip)
int macio_register_driver(struct macio_driver *drv)
{
	/* initialize common driver fields */
	drv->driver.name = drv->name;
	drv->driver.bus = &macio_bus_type;

	/* register with core */
Loading