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>
This commit is contained in:
Benjamin Herrenschmidt 2010-06-02 17:09:18 +10:00
Родитель 79905ad50b
Коммит c2cdf6aba0
14 изменённых файлов: 58 добавлений и 34 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -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[] = {

Просмотреть файл

@ -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,

Просмотреть файл

@ -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,

Просмотреть файл

@ -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 */

Просмотреть файл

@ -728,8 +728,10 @@ static struct of_device_id media_bay_match[] =
static struct macio_driver media_bay_driver =
{
.driver = {
.name = "media-bay",
.match_table = media_bay_match,
.of_match_table = media_bay_match,
},
.probe = media_bay_attach,
.suspend = media_bay_suspend,
.resume = media_bay_resume

Просмотреть файл

@ -584,9 +584,11 @@ static struct of_device_id rackmeter_match[] = {
};
static struct macio_driver rackmeter_driver = {
.driver = {
.name = "rackmeter",
.owner = THIS_MODULE,
.match_table = rackmeter_match,
.of_match_table = rackmeter_match,
},
.probe = rackmeter_probe,
.remove = __devexit_p(rackmeter_remove),
.shutdown = rackmeter_shutdown,

Просмотреть файл

@ -1654,8 +1654,11 @@ MODULE_DEVICE_TABLE (of, bmac_match);
static struct macio_driver bmac_driver =
{
.driver = {
.name = "bmac",
.match_table = bmac_match,
.owner = THIS_MODULE,
.of_match_table = bmac_match,
},
.probe = bmac_probe,
.remove = bmac_remove,
#ifdef CONFIG_PM

Просмотреть файл

@ -997,8 +997,11 @@ MODULE_DEVICE_TABLE (of, mace_match);
static struct macio_driver mace_driver =
{
.driver = {
.name = "mace",
.match_table = mace_match,
.owner = THIS_MODULE,
.of_match_table = mace_match,
},
.probe = mace_probe,
.remove = mace_remove,
};

Просмотреть файл

@ -239,8 +239,11 @@ static struct of_device_id airport_match[] =
MODULE_DEVICE_TABLE(of, airport_match);
static struct macio_driver airport_driver = {
.driver = {
.name = DRIVER_NAME,
.match_table = airport_match,
.owner = THIS_MODULE,
.of_match_table = airport_match,
},
.probe = airport_attach,
.remove = airport_detach,
.suspend = airport_suspend,

Просмотреть файл

@ -542,8 +542,11 @@ MODULE_DEVICE_TABLE (of, mac53c94_match);
static struct macio_driver mac53c94_driver =
{
.driver = {
.name = "mac53c94",
.match_table = mac53c94_match,
.owner = THIS_MODULE,
.of_match_table = mac53c94_match,
},
.probe = mac53c94_probe,
.remove = mac53c94_remove,
};

Просмотреть файл

@ -2036,8 +2036,11 @@ MODULE_DEVICE_TABLE (of, mesh_match);
static struct macio_driver mesh_driver =
{
.driver = {
.name = "mesh",
.match_table = mesh_match,
.owner = THIS_MODULE,
.of_match_table = mesh_match,
},
.probe = mesh_probe,
.remove = mesh_remove,
.shutdown = mesh_shutdown,

Просмотреть файл

@ -2005,8 +2005,11 @@ static struct of_device_id pmz_match[] =
MODULE_DEVICE_TABLE (of, pmz_match);
static struct macio_driver pmz_driver = {
.driver = {
.name = "pmac_zilog",
.match_table = pmz_match,
.owner = THIS_MODULE,
.of_match_table = pmz_match,
},
.probe = pmz_attach,
.remove = pmz_detach,
.suspend = pmz_suspend,

Просмотреть файл

@ -437,9 +437,11 @@ static int i2sbus_shutdown(struct macio_dev* dev)
}
static struct macio_driver i2sbus_drv = {
.driver = {
.name = "soundbus-i2s",
.owner = THIS_MODULE,
.match_table = i2sbus_match,
.of_match_table = i2sbus_match,
},
.probe = i2sbus_probe,
.remove = i2sbus_remove,
#ifdef CONFIG_PM