Skip to content

Commit c2cdf6a

Browse files
committed
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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1 parent 79905ad commit c2cdf6a

14 files changed

Lines changed: 58 additions & 34 deletions

File tree

‎arch/powerpc/include/asm/macio.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ static inline struct pci_dev *macio_get_pci_dev(struct macio_dev *mdev)
123123
*/
124124
struct macio_driver
125125
{
126-
char *name;
127-
struct of_device_id *match_table;
128-
struct module *owner;
129-
130126
int (*probe)(struct macio_dev* dev, const struct of_device_id *match);
131127
int (*remove)(struct macio_dev* dev);
132128

‎drivers/ata/pata_macio.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,8 +1355,11 @@ static struct of_device_id pata_macio_match[] =
13551355

13561356
static struct macio_driver pata_macio_driver =
13571357
{
1358-
.name = "pata-macio",
1359-
.match_table = pata_macio_match,
1358+
.driver = {
1359+
.name = "pata-macio",
1360+
.owner = THIS_MODULE,
1361+
.of_match_table = pata_macio_match,
1362+
},
13601363
.probe = pata_macio_attach,
13611364
.remove = pata_macio_detach,
13621365
#ifdef CONFIG_PM
@@ -1366,9 +1369,6 @@ static struct macio_driver pata_macio_driver =
13661369
#ifdef CONFIG_PMAC_MEDIABAY
13671370
.mediabay_event = pata_macio_mb_event,
13681371
#endif
1369-
.driver = {
1370-
.owner = THIS_MODULE,
1371-
},
13721372
};
13731373

13741374
static const struct pci_device_id pata_macio_pci_match[] = {

‎drivers/block/swim3.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,8 +1159,10 @@ static struct of_device_id swim3_match[] =
11591159

11601160
static struct macio_driver swim3_driver =
11611161
{
1162-
.name = "swim3",
1163-
.match_table = swim3_match,
1162+
.driver = {
1163+
.name = "swim3",
1164+
.of_match_table = swim3_match,
1165+
},
11641166
.probe = swim3_attach,
11651167
#if 0
11661168
.suspend = swim3_suspend,

‎drivers/ide/pmac.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,8 +1400,11 @@ static struct of_device_id pmac_ide_macio_match[] =
14001400

14011401
static struct macio_driver pmac_ide_macio_driver =
14021402
{
1403-
.name = "ide-pmac",
1404-
.match_table = pmac_ide_macio_match,
1403+
.driver = {
1404+
.name = "ide-pmac",
1405+
.owner = THIS_MODULE,
1406+
.of_match_table = pmac_ide_macio_match,
1407+
},
14051408
.probe = pmac_ide_macio_attach,
14061409
.suspend = pmac_ide_macio_suspend,
14071410
.resume = pmac_ide_macio_resume,

‎drivers/macintosh/macio_asic.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ static void macio_pci_add_devices(struct macio_chip *chip)
526526
int macio_register_driver(struct macio_driver *drv)
527527
{
528528
/* initialize common driver fields */
529-
drv->driver.name = drv->name;
530529
drv->driver.bus = &macio_bus_type;
531530

532531
/* register with core */

‎drivers/macintosh/mediabay.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,10 @@ static struct of_device_id media_bay_match[] =
728728

729729
static struct macio_driver media_bay_driver =
730730
{
731-
.name = "media-bay",
732-
.match_table = media_bay_match,
731+
.driver = {
732+
.name = "media-bay",
733+
.of_match_table = media_bay_match,
734+
},
733735
.probe = media_bay_attach,
734736
.suspend = media_bay_suspend,
735737
.resume = media_bay_resume

‎drivers/macintosh/rack-meter.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,11 @@ static struct of_device_id rackmeter_match[] = {
584584
};
585585

586586
static struct macio_driver rackmeter_driver = {
587-
.name = "rackmeter",
588-
.owner = THIS_MODULE,
589-
.match_table = rackmeter_match,
587+
.driver = {
588+
.name = "rackmeter",
589+
.owner = THIS_MODULE,
590+
.of_match_table = rackmeter_match,
591+
},
590592
.probe = rackmeter_probe,
591593
.remove = __devexit_p(rackmeter_remove),
592594
.shutdown = rackmeter_shutdown,

‎drivers/net/bmac.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,8 +1654,11 @@ MODULE_DEVICE_TABLE (of, bmac_match);
16541654

16551655
static struct macio_driver bmac_driver =
16561656
{
1657-
.name = "bmac",
1658-
.match_table = bmac_match,
1657+
.driver = {
1658+
.name = "bmac",
1659+
.owner = THIS_MODULE,
1660+
.of_match_table = bmac_match,
1661+
},
16591662
.probe = bmac_probe,
16601663
.remove = bmac_remove,
16611664
#ifdef CONFIG_PM

‎drivers/net/mace.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,8 +997,11 @@ MODULE_DEVICE_TABLE (of, mace_match);
997997

998998
static struct macio_driver mace_driver =
999999
{
1000-
.name = "mace",
1001-
.match_table = mace_match,
1000+
.driver = {
1001+
.name = "mace",
1002+
.owner = THIS_MODULE,
1003+
.of_match_table = mace_match,
1004+
},
10021005
.probe = mace_probe,
10031006
.remove = mace_remove,
10041007
};

‎drivers/net/wireless/orinoco/airport.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,11 @@ static struct of_device_id airport_match[] =
239239
MODULE_DEVICE_TABLE(of, airport_match);
240240

241241
static struct macio_driver airport_driver = {
242-
.name = DRIVER_NAME,
243-
.match_table = airport_match,
242+
.driver = {
243+
.name = DRIVER_NAME,
244+
.owner = THIS_MODULE,
245+
.of_match_table = airport_match,
246+
},
244247
.probe = airport_attach,
245248
.remove = airport_detach,
246249
.suspend = airport_suspend,

0 commit comments

Comments
 (0)